Skip to main content

Module layout

Module layout 

Source
Expand description

The names of the engine’s directories and of what is in them, and the values that vary between instances: what the engine is called in scripts and file names, what a project’s directory is called, what the product is called, and what the repository directory the engine’s worktrees go in is called (Layout: agix, .agix, Agix and .wkts unless the embedder or the user’s settings name others).

Every other module takes these names from here — the derived paths from super::ConfigPaths, Layout and StateRoot, the security decisions from super::SensitivePaths, the engine’s name wherever a script finds it, the product’s name wherever a person or the model reads it — so that renaming any of them is one value carried through, not a search for literals. A Layout is carried by value from the pool’s paths into every session’s settings; there is no process-wide one, since two pools in one process may name these differently.

Modules§

entry
Entries of an engine directory: the state root, a scene directory, a project directory.

Structs§

ConfigRoot
One configuration root as Layout::config_roots lists it.
EngineNameError
Why a name cannot be the engine’s.
Layout
The names an instance gives its directories and itself. One per pool, carried in the pool’s paths and every session’s settings.
LayoutError
Why a name cannot be a project directory’s.
ProductNameError
Why a name cannot be the product’s.
StateRoot
An instance’s state root: global settings, scenes, transcripts, plugins, the daemon’s files. The names under it do not follow Layout.
WorktreesDirError
Why a name cannot be the worktrees directory’s.

Constants§

AGENTS_DIR
The cross-tool directory beside the project directory; its skills is PROJECT_SKILLS_DIR. Its name belongs to that convention, not to the instance, and does not follow Layout.
CLAUDE_CREDENTIALS
Claude Code’s login, in the user’s home.
CLAUDE_DIR
Claude Code’s directory, which the engine imports from.
DEFAULT_ENGINE
The engine’s name when the embedder names none.
DEFAULT_PRODUCT_NAME
The product’s name when the embedder names none.
DEFAULT_PRODUCT_URL
Where the product of that name is published.
DEFAULT_PROJECT_DIR
The project directory’s name under DEFAULT_ENGINE: .<engine>.
DEFAULT_STATE_DIR
$HOME/<this> is agixd’s state root when nothing names one, and the state directory’s name under DEFAULT_ENGINE.
DEFAULT_WORKTREES_DIR
The directory at a repository’s root that the engine’s worktrees go in when the settings name none.
ENGINE_CONFIG_DIRS
Directories directly in a configuration root that configure the engine or that it acts on unsandboxed, guarded with everything under them. With commands, which the engine does not read but Claude Code reads its slash commands from.
ENGINE_CONFIG_FILES
Files in a configuration root that configure the engine. The write tools refuse them anywhere under such a directory, a sandboxed command directly in it.
FOREIGN_CONFIG_ROOTS
Configuration roots of other agents, or of this engine under its default name, guarded beside the instance’s own: a model that rewrote one would be granting a later session of that agent, or the import, what it was not granted.
GIT_WORKTREES_DIR
The directory in a git directory holding the linked worktrees’ entries.
LOCAL_CONFIG_FILES
The files of a project directory outside its state/ that its .gitignore keeps out of the repository along with state/: one user’s own configuration and keys, which stay beside the shared settings where people look for them. Only what a project’s collaborators share is committed.
OTHER_TOOLS_DIRS
Project directories other tools own, which an instance’s cannot be: git’s, the cross-tool skills directory, the other agents’ configuration roots, and the editors’ and forges’ settings, whose files would collide with the engine’s or become unwritable under its protection.
PROJECT_ENGINE_CONFIG_DIRS
Directories in a project, outside the configuration roots, that the engine loads configuration from: the project’s skills, whose allowed-tools grant permissions. Guarded like a configuration directory in those roots: a write tool asks, a sandboxed command cannot write, and the directories above one cannot be moved aside.
PROJECT_SKILLS_DIR
A project’s skills, where Codex and other agent tools look for them too.
PROJECT_STATE_ENGINE_DIRS
The directories in a project’s state/ the engine acts on unsandboxed — it exports, forks and resumes from them — guarded with everything under them even inside a writable root the sandbox policy names there.
PROJECT_STATE_ENTRIES
What the engine keeps in a project directory’s state/ and an older engine kept directly in the project directory: opening the project moves each found there into state/.
SETTINGS_FILE
The shared, committed settings file present in every tier.
SETTINGS_LOCAL_FILE
The gitignored per-machine overlay sitting beside SETTINGS_FILE in the same tier, overriding it.
STATE_RESERVED_NAMES
The names the engine has, or keeps for itself, in a project’s state/. No product’s id may be one: state/<product id>/ is the embedder’s (Layout::host_state_dir).
STATE_ROOT_SCENE_FILES
The files in the state root and in each scenes/<scene>/ under it that a sandboxed command must not rewrite: the settings, and — for a declarative scene — the files that define it.
STATE_ROOT_SCRATCHPAD
The state root’s scratchpad, one of STATE_ROOT_WORKING_DIRS.
STATE_ROOT_SESSION_TMP
Under the state root, one temporary directory per session, <state root>/tmp/<session>: the session’s sandboxed commands may write their own and no other.
STATE_ROOT_WORKING_DIRS
The subdirectories of the state root, and of a project directory’s state/, that are the agent’s own working space rather than configuration: the only parts of them the agent’s tools and its sandboxed commands may write.