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.
Constants§
- SCRATCH_
GITIGNORE - Ignore file every scratch dir carries so
git statusnever lists it.
Functions§
- config_
dir config.toml,skills/,plugins.toml.- config_
file $config_dir/config.toml.- create_
scratch_ dir - Create the scratch dir of
working_dirand return it. The dir gets a.gitignoreof*the first time, so throwaway agent files never show up as untracked changes in the user’s repository. - 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.