You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 2d03bf6
Browse filesBrowse the repository at this point in the historyBrowse files
|`CBM_ALLOWED_ROOT`|*(unset)*|Restrict`index_repository` to paths within this directory. When set, a `repo_path` that resolves (after symlink / `..` resolution) outside this root is refused; unset imposes no restriction. Useful when the server may be driven by an untrusted caller, e.g. agentic or multi-tenant deployments. |
673
+
|`CBM_ALLOWED_ROOT`|*(unset)*|Confine`index_repository` to paths within this directory. When set, a `repo_path` that resolves (after symlink / `..` resolution) outside this root is refused, and the same check now applies to the graph UI's `POST /api/index` route rather than only to the MCP tool. Unset imposes no *containment*restriction — but see the always-on limits below, which apply whether or not this is set. Useful when the server may be driven by an untrusted caller, e.g. agentic or multi-tenant deployments. |
674
674
|`CBM_CACHE_DIR`|`~/.cache/codebase-memory-mcp`| Override the database storage directory. All project indexes and config are stored here. One account can use only one canonical cache root at a time; close active CBM sessions/commands before switching it. |
675
675
|`CBM_DIAGNOSTICS`|`false`| Set to `1` or `true` to enable the shared daemon's periodic `snapshot.json` and retained `trajectory.ndjson` below a fresh owner-private directory in the system temp directory. Exact paths are logged by `diagnostics.start`. |
676
676
|`CBM_DOWNLOAD_URL`|*(GitHub releases)*| Override the download URL for updates. Used for testing or self-hosted deployments. |
Copy file name to clipboardExpand all lines: docs/CONFIGURATION.md
+20-1Lines changed: 20 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -116,7 +116,7 @@ These environment variables affect runtime behavior:
116
116
117
117
| Variable | Default | Description |
118
118
|---|---|---|
119
-
|`CBM_ALLOWED_ROOT`|*(unset)*|Restrict`index_repository` to paths within this directory. When set, a `repo_path` that resolves (after symlink / `..` resolution) outside this root is refused; unset imposes no restriction. Useful when the server may be driven by an untrusted caller (agentic or multi-tenant deployments). |
119
+
|`CBM_ALLOWED_ROOT`|*(unset)*|Confine`index_repository` to paths within this directory. When set, a `repo_path` that resolves (after symlink / `..` resolution) outside this root is refused, and the same check now applies to the graph UI's `POST /api/index` route rather than only to the MCP tool. Unset imposes no *containment*restriction — but see the always-on limits below, which apply whether or not this is set. Useful when the server may be driven by an untrusted caller, e.g. agentic or multi-tenant deployments. |
120
120
|`CBM_CACHE_DIR`|`~/.cache/codebase-memory-mcp`| Override the cache directory used for indexes, `_config.db`, and UI `config.json`. |
121
121
|`CBM_DIAGNOSTICS`|`false`| Enable periodic `snapshot.json` and retained `trajectory.ndjson` below a fresh owner-private directory in the system temp directory. The daemon records the randomized paths in the `diagnostics.start` discovery record (a single JSON line) in `${CBM_CACHE_DIR}/logs/cbm-daemon.log`; that one record is emitted even when `CBM_LOG_LEVEL` suppresses ordinary logging, so the paths always remain discoverable. |
122
122
|`CBM_DOWNLOAD_URL`| GitHub releases | Override the update download URL. |
@@ -125,6 +125,25 @@ These environment variables affect runtime behavior:
125
125
126
126
Environment used by daemon-owned components—such as diagnostics, daemon logging, and process-wide indexing resource limits—is captured from the first daemon-backed session that starts the daemon. Later sessions join the existing process and cannot replace those values. To change them, close every daemon-backed session, update the relevant agent configurations consistently, and restart a session. `CBM_ALLOWED_ROOT` remains session-specific, a conflicting `CBM_CACHE_DIR` is rejected, and one-shot CLI commands use their own current environment without starting the daemon.
127
127
128
+
129
+
### Roots that are always refused
130
+
131
+
Independently of `CBM_ALLOWED_ROOT`, some directories are refused as an indexing
132
+
root because they are too broad or too sensitive to index as a unit:
133
+
134
+
- a filesystem root, a Windows drive root, or a UNC share root;
135
+
- a top-level system tree — `/etc`, `/var`, `/usr`, `/home`, `/Users`, and on
136
+
Windows `C:\Windows`, `C:\Users`, `C:\ProgramData`, `C:\Program Files`;
137
+
- your home directory itself (directories *below* it are fine);
138
+
- a credential directory at any depth — `.ssh`, `.aws`, `.gnupg`, `.kube`,
Two limits are worth stating plainly. This constrains *scope*, not
142
+
*sensitivity*: inside a root that is allowed, every file the process can read may
143
+
be indexed and later returned. And the credential list is a denylist, so it
144
+
raises the cost of a mistake rather than closing the class — a directory it does
145
+
not name is permitted.
146
+
128
147
## 5. Agent and Editor Integration Files
129
148
130
149
The `install` command can also write MCP entries and instruction blocks into agent/editor config files such as Claude Code, Codex, Gemini, VS Code, Cursor, Zed, and others.
0 commit comments