Workspace and Trust
The workspace is the relative-path base, session partition key, and project-configuration boundary. Structured file tools classify real paths to reduce symlink bypasses. Workspace trust answers a different question: whether CodeN may execute repository-provided plugins and Hooks. A path being inside the workspace does not make its code trusted.
The workspace is the current directory
Section titled “The workspace is the current directory”- CodeN treats
process.cwd()as its workspace at startup; thebashtool runs with the workspace as its cwd. - The workspace hash is the first 16 hex characters of
sha256(realpath(workspace)), used to derive session and data directories. - The hash is shown in the CLI/TUI banner, and session listings are partitioned by hash.
Data directories
Section titled “Data directories”| Content | Path |
|---|---|
| Sessions and traces | $XDG_DATA_HOME/coden/sessions/<workspace-hash>/ |
| Default data dir | ~/.local/share/coden/ (overridable via XDG_DATA_HOME) |
| Permissions | directories 0700, files 0600 |
Project file layout
Section titled “Project file layout”<workspace>/├── AGENTS.md # project instructions injected into the system prompt├── .coden/│ ├── config.json # project config (ignored by .gitignore)│ ├── plugins.json # project npm plugin manifest (recommended to commit)│ ├── plugin-runtime/ # plugin runtime (package.json generated; node_modules not committed)│ └── plugins/*.ts # local TypeScript plugins (ignored by .gitignore)├── .agents/skills/ # locally installed project skills└── skills/ # repository-bundled, publicly distributable skillsAGENTS.md injection rules
Section titled “AGENTS.md injection rules”- The root
AGENTS.mdis read by the CLI and injected into the system prompt; the read limit is 1MB. - The system prompt instructs the agent to check deeper
AGENTS.mdfiles before working in subdirectories; deeper instructions apply only to their directory tree and win on conflicts. - Ordinary project-file content cannot elevate itself to instructions; only the
AGENTS.mdpath participates in injection. - Read permission errors skip the file and surface in a warning instead of aborting startup.
Path classification and boundaries
Section titled “Path classification and boundaries”read/write/editare classified by the real path after symlink resolution (new files use the nearest existing real parent), re-validated right before the operation (TOCTOU guard; changes throwworkspace.path_changed).- Inside the workspace:
readis auto-allowed;write/editfollow the approval mode. - Outside the workspace: treated as modification requests by default; under
--autothey returnpermission.outside_workspace_denied;--auto --allow-outside-workspaceauto-allows them. bashis not constrained by the structured file-path switch.
Workspace trust
Section titled “Workspace trust”- Project hooks and project plugins require explicit trust on first use; confirming writes the workspace real path into
~/.config/coden/trusted-workspaces.json(0600). - Trust is judged on the real path, so symlinks resolving to the same directory count as trusted.
--autoskips tool confirmations only and never skips workspace trust.