Skip to content
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.

#_read_options_registration

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

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

#_read_token_state

python
def _read_token_state(ws: 'Workspace', name: str) -> tuple[bool, TokenExpiry | None, str | None, str | None]

Return (has_token, expiry, tier, subscription) from name's own store.

A corrupt token entry raises :class:TokenStoreError (the hard-error contract): profile inspection is a CLI command, so token corruption is a workspace-integrity problem the operator must fix, never a silent skip.

#_count_active_sessions

python
def _count_active_sessions(config_dir: Path) -> tuple[int, int]

Return (live, live_interactive) session counts for config_dir.

A delegate to :mod:claudewheel.session_registry, the single reader of Claude Code's per-session registry: it parses sessions/<pid>.json and drops phantoms (a leftover file, or a PID the kernel has recycled). The two numbers are kept apart because they answer different questions -- the report shows how much is running, while the delete guard only refuses for a human's session.

#_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(ws: 'Workspace', 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 name's own claudewheel data dir
  • .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(ws: 'Workspace', 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).

More tools from this site

  • claudestream Drive Claude Code from Python: run it as a subprocess and read its output as typed events, with async and sync sessions, sandbox policies, and tools you define in Python
  • dirstat Fast, single-binary directory statistics CLI: every file under a tree grouped by format, with counts, sizes, and lines of code, as a colored terminal table or as JSON
  • fastware A batteries-included ASGI framework: msgspec JSON, a managed Granian server, dependency injection, SSE, WebSockets, auth, and a test client
  • go-toml-edit Zero-dep TOML editing library for Go with comment preservation
  • howmuchleft The fastest Claude Code statusline: context window, 5-hour, and weekly limit usage as three customizable gradient bars, rendering in about 6 ms
  • orxtra
  • pgdesign
  • predraw Declarative rendering pipeline: describe a scene in JSON and get SVG, PNG and WebP out, with light and dark style tokens, reusable components and text converted to path outlines
  • reposummary Turn a git repository's history into a Markdown journal: pick a time window or revision range and get a readable digest of what changed, optionally narrated by an LLM
  • rlsbl Release orchestration and project scaffolding CLI that bumps versions, validates a structured JSONL changelog, tags only the commit CI verified, and publishes to npm, PyPI, Go and more
  • safegit git wrapper CLI that gives each commit its own temporary index and retries ref updates on conflict, so concurrent agents share one repository
  • saferm Command-line replacement for rm that archives every deletion with a mandatory reason and the context it ran in, so deleted files can be listed, inspected and restored
  • selfdoc Static Site Generator that builds a project's documentation site directly from its source code, so the docs can never drift from the code they describe, with SEO/AEO, first-class blog, search, and cross-project linking built in
  • strictcli
  • stricttest An always-on test-isolation floor: a pytest plugin and a Go env-hygiene module that make a test suite structurally unable to reach real credentials, the real HOME, the network, or the development repository.
  • wesktop A Python framework that turns an ASGI web app into a desktop application, serving it from a local Granian server and displaying it in a native OS window via pywebview
Search