claudewheel v0.15.1 /claudewheel.config
Edit
On this page

ConfigManager class for claudewheel.

#claudewheel.config

#claudewheel.config

Config loading, saving, and schema migration system.

#_migration_1_github_optional

python
def _migration_1_github_optional(config: dict, segments_def: list[dict], theme: dict, options_def: dict) -> None

Make github segment optional (was incorrectly required).

#_migration_2_profile_paths

python
def _migration_2_profile_paths(config: dict, segments_def: list[dict], theme: dict, options_def: dict) -> None

Rewrite profile metadata config_dir from ~/.claude- to ~/.claudewheel/profiles/.

#_migration_3_classify_pinned

python
def _migration_3_classify_pinned(config: dict, segments_def: list[dict], theme: dict, options_def: dict) -> None

Classify existing 'values' into 'pinned' vs discard.

Discovery-backed segments: values with metadata -> pinned (wizard-created), values without metadata -> discard (from discovery, will be re-discovered).

Static segments (no discovery): values in HISTORICAL_DEFAULTS that are still in DEFAULT_OPTIONS -> discard (they come from defaults now). Values in HISTORICAL_DEFAULTS but NOT in current defaults -> pinned (conservative). Values not in any defaults -> pinned (user-added).

#ConfigManager

Manages the four JSON config files (config, segments, options, state) and runs migrations on init.

#_warn_old_profile_dirs

python
def _warn_old_profile_dirs() -> None

Print a warning if old-style ~/.claude-/ profile dirs exist.

#_ensure_shared_settings

python
def _ensure_shared_settings(self) -> None

Create shared-settings.json from canonical values if it doesn't exist.

#_ensure_dir

python
def _ensure_dir(self)

Create config directories and write default files on first run.

#_save_json

python
def _save_json(self, path: Path, data: dict | list) -> None

Atomic write via tmp-file rename.

#_migrate

python
def _migrate(self, theme_file: Path, theme_default: dict) -> None

Add missing default keys to existing config files on startup.

Only adds keys that are absent — never overwrites existing user values. Saves each file only when something actually changed, so running twice is a no-op (idempotent).

#_run_versioned_migrations

python
def _run_versioned_migrations(self, theme_file: Path) -> None

Run schema-versioned migrations that change existing values.

Complements _migrate() which only adds missing keys. Versioned migrations can mutate values and run exactly once per version bump.

#_deep_merge_missing

python
def _deep_merge_missing(target: dict, defaults: dict) -> bool

Recursively add keys from defaults that are absent in target.

Returns True if any key was added (i.e. the target was mutated).

#add_option

python
def add_option(self, segment_key: str, value: str) -> None

Add a new option value to the pinned list in options.json for the given segment.

#set_option_metadata

python
def set_option_metadata(self, segment_key: str, value: str, meta: dict) -> None

Set metadata for a specific option value in options.json.

#save_state

python
def save_state(self)