claudewheel v0.20.1 /claudewheel.discovery
Edit
On this page

Scan the filesystem for Claude Code profiles and their credentials.

#claudewheel.discovery

#claudewheel.discovery

Scan the filesystem for Claude Code profiles and their credentials.

#ProfileInfo

A profile's name, path, and credential/token presence.

#discover_profiles

python
def discover_profiles() -> list[ProfileInfo]

Discover all Claude Code profiles on this machine.

Scans ~/.claudewheel/profiles/ for subdirectories. Also checks bare ~/.claude/ as the "default" profile (Claude Code's built-in default, not a claudewheel profile). A directory qualifies as a profile if it has .credentials.json, settings.json, or has a matching entry in tokens.json.

Returns a sorted list of ProfileInfo.

#classify_shared_dirs

python
def classify_shared_dirs(profile_path: Path) -> dict[str, str]

Classify each shared-store entry in a profile dir into one of four states.

Covers PROFILE_SHARED_DIRS (targets under SHARED_DIR) plus "skills" (target SKILLS_DIR). States:

  • "intact": a symlink pointing at the shared-store target
  • "wrong-target": a symlink pointing elsewhere (safe to unlink)
  • "real-dir": a real directory OR a real file at that name (deleting it

would destroy data; files get the same state because the danger is identical -- the entry holds real data, not a link)

  • "missing": no entry at that name (not a danger; some profiles were

created without symlinks)

#detect_browsers

python
def detect_browsers() -> list[tuple[str, str]]

Detect installed web browsers.

Returns (binary_path, display_name) pairs -- path first, because the results are concatenated with (key, label) selection-form options where the key is the path. Detection order is native (PATH), then flatpak exports, then snap. Deduplicated by display name: the first source that finds a browser wins.