claudewheel v0.20.1 /claudewheel.profile_info
Edit
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

python
def config_dir_for(name: str) -> Path

Resolve 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

python
def _read_options_registration(name: str) -> tuple[bool, bool]

Return (registered, pinned) for name from options.json.

#_read_token_state

python
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

python
def _count_active_sessions(config_dir: Path) -> int

Count live sessions by scanning /sessions/*.pid.

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

python
def _disk_usage(config_dir: Path) -> int

Sum 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

python
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

python
def detect_auth_shadow(name: str) -> bool

Return 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

python
def gather_profile_info(name: str) -> ProfileReport

Assemble 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

python
def _format_size(size: int) -> str

Human-readable byte size (B / KB / MB / GB).

#format_report

python
def format_report(report: ProfileReport) -> list[str]

Render a ProfileReport as plain display lines (TUI page and CLI).