On this page
Gather and format a detailed inspection report for a single profile.
#claudewheel.profile_info
#claudewheel.profile_info
Gather and format a detailed inspection report for a single profile.
#ProfileReport
Everything gather_profile_info() learns about one profile.
#config_dir_for
def config_dir_for(name: str) -> PathResolve a profile name to its config directory.
The "default" profile is Claude Code's built-in ~/.claude, not a claudewheel profile dir (mirrors discovery and segment metadata).
#_read_options_registration
def _read_options_registration(name: str) -> tuple[bool, bool]Return (registered, pinned) for name from options.json.
#_read_token_state
def _read_token_state(name: str) -> tuple[bool, TokenExpiry | None, str | None, str | None]Return (has_token, expiry, tier, subscription) for name from tokens.json.
#_count_active_sessions
def _count_active_sessions(config_dir: Path) -> intCount live sessions by scanning
The .pid files are written by Claude Code itself (an external dependency, not claudewheel). A session counts as active when its recorded PID is a live process (os.kill(pid, 0) succeeds).
#_disk_usage
def _disk_usage(config_dir: Path) -> intSum file sizes under config_dir, never following symlinks.
Uses os.walk(followlinks=False) so symlinked dirs (the shared-store links inside profile dirs) are not descended into, and skips symlinked files so only data truly owned by the profile dir is counted.
#_read_settings
def _read_settings(config_dir: Path) -> tuple[bool, dict[str, int], bool | None, int | None, bool | None]Summarize settings.json; tolerate a missing/corrupt file and keys.
#detect_auth_shadow
def detect_auth_shadow(name: str) -> boolReturn True if profile has session credentials shadowing a long-lived token.
Conditions (all must be true):
- A valid token entry exists in tokens.json for name
- .credentials.json exists in the profile's config dir
- .credentials.json contains a "claudeAiOauth" key
Lightweight check usable from both gather_profile_info and health checks.
#gather_profile_info
def gather_profile_info(name: str) -> ProfileReportAssemble a full ProfileReport for name.
Never raises for unknown profiles: callers check report.exists / report.registered / report.has_token to decide how to present one.
#_format_size
def _format_size(size: int) -> strHuman-readable byte size (B / KB / MB / GB).
#format_report
def format_report(report: ProfileReport) -> list[str]Render a ProfileReport as plain display lines (TUI page and CLI).