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 72a2c0b
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: README.md
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -151,6 +151,8 @@ codebase-memory-mcp config set auto_index true
151
151
152
152
When enabled, new projects are indexed automatically on first connection. Previously-indexed projects are registered with the background watcher for ongoing git-based change detection. Configurable file limit: `config set auto_index_limit 50000`.
153
153
154
+
The watcher follows MCP sessions: it watches the project each open MCP session is rooted in (the client's working directory) and stops when the last session for that project closes. A repository indexed with `cli index_repository`, or indexed from a session rooted somewhere else, is not watched — re-run `index_repository` after changing it. `index_status` reports this in its `watch` object: `watched`, and either the poll cadence and last scan time or the `reason` it is not watched.
155
+
154
156
Watcher registration is controlled separately by `auto_watch` (default `true`). Set `config set auto_watch false` to keep a session from registering its project with the background watcher — useful when working across many projects and you want each session contained to explicit indexing.
155
157
156
158
To turn the watcher off entirely, set `config set watcher_enabled false` (default `true`): the background poll thread never starts and no project is registered, while `auto_index` and manual `index_repository` keep working. Unlike `auto_watch` — which is consulted per session — `watcher_enabled` is read once when the background daemon starts, so run `codebase-memory-mcp daemon stop` after changing it; reconnecting your MCP client alone will not restart the daemon. See [docs/CONFIGURATION.md](docs/CONFIGURATION.md#2-cli-managed-runtime-settings).
@@ -246,7 +248,7 @@ The install script placed beside the binary is **reported, not deleted** — uni
246
248
247
249
### Distribution & operation
248
250
-**Native runtime set, zero infrastructure services**: SQLite-backed, persists to `~/.cache/codebase-memory-mcp/`
249
-
-**Auto-sync**: Background watcher detects file changes and re-indexes automatically
251
+
-**Auto-sync**: Background watcher detects file changes in the project an MCP session is working in and re-indexes it automatically (other indexed repos: re-run `index_repository`)
250
252
-**Route nodes**: REST endpoints are first-class graph entities
@@ -681,7 +683,7 @@ JSON arguments can also be piped on stdin, for tools that take arguments. A tool
681
683
682
684
| Tool | Description |
683
685
|------|-------------|
684
-
|`index_repository`| Index a repository into the graph. Auto-sync keeps it fresh after that. Waits for the whole index by default; pass `async: true` to start it in the daemon and return at once, then poll with `status: true` (see below). |
686
+
|`index_repository`| Index a repository into the graph. Auto-sync keeps it fresh only while it is the project of an open MCP session; repos indexed from the CLI or from another project's session need a re-run (`index_status` shows `watch`). Waits for the whole index by default; pass `async: true` to start it in the daemon and return at once, then poll with `status: true` (see below). |
685
687
|`list_projects`| List all indexed projects with node/edge counts. |
686
688
|`delete_project`| Remove a project and all its graph data. |
687
689
|`index_status`| Check indexing status of a project. |
Copy file name to clipboardExpand all lines: docs/CONFIGURATION.md
+7-1Lines changed: 7 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -88,11 +88,17 @@ Current keys:
88
88
|`auto_index`|`false`| Automatically index new projects when an MCP session starts. |
89
89
|`auto_index_limit`|`50000`| Maximum file count allowed for automatic indexing of a new project. |
90
90
|`auto_watch`|`true`| Register the session's project with the background git watcher on connect. Set `false` to keep a session from registering its project (the watcher still runs for other projects). |
91
-
|`watcher_enabled`|`true`| Master switch for the background watcher subsystem. Set `false` to stop the watcher from starting at all — no poll thread and no project registration. Reindex manually with `index_repository` when disabled. |
91
+
|`watcher_enabled`|`true`| Master switch for the background watcher subsystem. Set `false` to stop the watcher from starting at all — no poll thread and no project registration. Reindex manually with `index_repository` when disabled. Only an open MCP session's own project is ever watched; `index_status` reports the current state in its `watch` object. |
92
92
|`watch_non_git`|`false`| Also poll project roots that are **not git repositories**. By default the watcher only follows git projects, so a project indexed from a plain directory is never refreshed after its first index — reindex it manually with `index_repository`. Set `true` to poll such roots on the same adaptive cadence with a file-tree scan: the indexer's own discovery walk (same skip lists, `.gitignore` and `.cbmignore` rules) hashed over each file's path, size and mtime. Any change reindexes once; paths the indexer skips (including cbm's own `.codebase-memory/` output) never trigger. The first poll after the daemon starts reindexes each such project once, since nothing records which tree state the index holds. The scan walks the whole tree every poll, so it costs more than git polling on very large trees. Read once when the daemon starts, like `watcher_enabled`. |
93
93
|`index_max_files`|`off`| Optional maximum number of accepted source files in one discovery run. |
94
94
|`index_max_source_mb`|`off`| Optional maximum accepted source size in MiB in one discovery run. |
95
95
96
+
For a watched project, `index_status` names the polling method in `watch.strategy`:
97
+
`git` (HEAD and dirty-state polling), `tree` (a non-git root polled by the
98
+
`watch_non_git` file-tree scan), `none` (a non-git root that is registered but never
99
+
polled, the default for a plain directory) or `pending` (registered; the first poll
100
+
has not run yet).
101
+
96
102
> **`watcher_enabled` vs `auto_watch`.**`watcher_enabled` controls whether the
97
103
> watcher *subsystem* starts at all (the background poll thread). `auto_watch` is
98
104
> narrower: it only controls whether a connecting session registers *its own*
<p>A background watcher detects changes and re-indexes incrementally. No manual reindex after editing files.</p>
731
+
<p>A background watcher detects changes in the project your MCP session is working in and re-indexes it incrementally. No manual reindex after editing files there.</p>
0 commit comments