Skip to main content

Module paths

Module paths 

Source
Expand description

User-visible WhyCodes directories.

WHYCODES_HOME (if set and non-empty) is the instance root: config is $WHYCODES_HOME/config.toml and session/auth/memory/browser data live under $WHYCODES_HOME. Otherwise the default is $HOME/.whycodes (%USERPROFILE%\.whycodes on Windows) — the usual short ~/.<tool> shape.

Pre-0.7 installs used directories::ProjectDirs (com.whycorporation.whycodes / XDG). legacy_instance_roots lists those paths so config load can copy config.toml / auth.json / whycodes.db into ~/.whycodes.

Project-local state lives under .whycodes/ next to a repo.

Functions§

config_dir
config.toml, skills/, plugins.toml.
config_file
$config_dir/config.toml.
data_dir
Sessions, auth store, memory banks, browser profile.
display_path
Format a path for humans (status bar, toasts, copy-to-clipboard).
instance_root
Config + data live together under this directory.
legacy_instance_roots
Former ProjectDirs locations (config and/or data). Used only to migrate an existing install into instance_root.
project_dir
Project-local WhyCodes directory: .whycodes.
project_rule_dirs
Directories of per-topic project rule files, with the extension each one holds, in precedence order. The context loader appends every file in them to the system prompt and read rule://<name> serves one by file stem.
project_scratch_dir
Throwaway agent files (bg-*.log, detached output). Not the OS temp dir.
user_home
User home ($HOME, then %USERPROFILE%).
whycodes_home
Isolated instance root from the environment.