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

State persistence for claudewheel.

#claudewheel.state

#claudewheel.state

Save selections, launch count, and recent directories to state.json.

#load_state_value

python
def load_state_value(key: str)

Read a single value fresh from state.json on disk.

Returns None if the file is missing, unreadable, or lacks the key. Unlike ConfigManager.state, this never uses an in-memory copy -- it is for code paths (e.g., the auth wizard) that run outside the TUI's ConfigManager lifecycle.

#save_state_value

python
def save_state_value(key: str, value) -> None

Read-modify-write a single key in state.json (atomic tmp + rename).

Only key is touched; all other keys on disk are preserved. Counterpart of load_state_value() for writers that don't hold a ConfigManager.

#merge_out_of_band_keys

python
def merge_out_of_band_keys(state: dict) -> None

Re-read keys written straight to state.json by out-of-band writers.

The auth wizard writes AUTH_BROWSER_KEY directly to disk while the TUI holds its own in-memory state (loaded at startup). Any wholesale ConfigManager.save_state() must call this first so it doesn't clobber those fresh on-disk values with stale in-memory ones.

#save_launch_state

python
def save_launch_state(cfg: ConfigManager, selections: dict[str, str | None]) -> None

Save current selections to state.json before launch.

#record_inode

python
def record_inode(directory: str) -> None

Record the inode of a project directory for rename detection.