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 b42159e
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: README.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -263,6 +263,8 @@ To turn the watcher off entirely, set `config set watcher_enabled false` (defaul
263
263
264
264
The watcher follows **git** projects only by default: a project indexed from a directory that is not a git repository is not watched and stays at its last index until you run `index_repository` again. To have such roots polled too, set `config set watch_non_git true` (default `false`, read when the daemon starts): they are then checked on the same cadence with a file-tree scan that uses the indexer's own ignore rules.
265
265
266
+
Linked git worktrees are indexed as their own projects by default. Set `config set ignore_worktrees true` to skip them on the automatic paths — useful when short-lived `git worktree add` checkouts would otherwise each leave behind a permanent index of the same repository. An explicit `index_repository` call on a worktree is then refused unless you pass `index_worktree=true`. See [docs/CONFIGURATION.md](docs/CONFIGURATION.md#ignore_worktrees).
267
+
266
268
### Keeping Up to Date
267
269
268
270
**Updates run from the install script on every platform, not from inside the running binary.**`codebase-memory-mcp update` validates your flags and then prints the exact command to run:
@@ -1016,6 +1018,7 @@ codebase-memory-mcp config list # show all settings
1016
1018
codebase-memory-mcp config set auto_index true# auto-index on session start
1017
1019
codebase-memory-mcp config set auto_index_limit 50000 # max files for auto-index
1018
1020
codebase-memory-mcp config set auto_watch false# remove/disable all background watches (default: true)
1021
+
codebase-memory-mcp config set ignore_worktrees true# skip linked git worktrees when auto-indexing (default: false)
1019
1022
codebase-memory-mcp config set doc_candidates false# skip doc<->code candidate scoring on huge repos (default: auto = on for full, off for moderate/fast)
1020
1023
codebase-memory-mcp config set watcher_enabled false# stop the watcher thread entirely (default: true)
1021
1024
codebase-memory-mcp config set watch_non_git true# also poll non-git project roots (default: false)
|`auto_watch`|`true`| Global switch for MCP session watch registration. On the next refresh or registration request, `true` allows session roots and successful `index_repository` targets to be watched; `false` removes all watches. The background watcher can still run with no registered projects. |
91
92
|`doc_candidates`|`auto`| Score documentation sections against code to store doc↔code candidates (the possible targets of a section, and the sections that may describe a function or file, each with a judged probability). Unset (`auto`), the index mode decides: on for `full` indexes (the default mode), off for `moderate` and `fast`. Set `true` or `false` to choose for every mode; `config reset doc_candidates` returns to `auto`. The scoring grows with sections × functions: under a second up to ~100k functions, ~15 s at ~400k, ~3 minutes on the Linux kernel. Off stores no candidates and leaves the rest of the graph unchanged; on in `fast` mode stores candidates without adding `fast`'s skipped `SIMILAR_TO` / `SEMANTICALLY_RELATED` edges. `index_repository` also takes `doc_candidates` for a single index, which wins over this setting. Applies from the next index. |
92
93
|`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. Active MCP sessions can register their root project and successful explicit index targets; under `daemon start` those watches outlive the session until the daemon stops, the project is deleted, its directory disappears, or `auto_watch` is set to `false`. `index_status` reports the current state in its `watch` object. |
@@ -142,6 +143,44 @@ and preserves any previously serving database. See
142
143
[Index resource limits](INDEX_RESOURCE_LIMITS.md) for counting, validation, and
143
144
error-response details.
144
145
146
+
### `ignore_worktrees`
147
+
148
+
Every indexed project is registered under its own absolute root path, so each
149
+
linked worktree becomes a separate permanent index. On machines that create many
150
+
short-lived worktrees, the automatic paths (`auto_index`, and the session hook's
151
+
"index this project first" guidance) turn every throwaway checkout into another
152
+
stored index of what is largely the same repository.
153
+
154
+
Enable the key to keep those checkouts out of the index:
155
+
156
+
```bash
157
+
codebase-memory-mcp config set ignore_worktrees true
158
+
```
159
+
160
+
With it enabled:
161
+
162
+
- automatic indexing skips a session whose root is a linked worktree;
163
+
- the `hook-augment` context says the worktree is unindexed on purpose instead
164
+
of telling the agent to run `index_repository`;
165
+
- an explicit `index_repository` call on a linked worktree is refused, and names
166
+
both ways forward — pass `index_worktree=true` for that one call, or turn the
167
+
key back off.
168
+
169
+
The main checkout of the same repository is unaffected, as are ordinary clones
170
+
and submodules. Detection is git plumbing only: a linked worktree's `.git` is a
171
+
file pointing at a gitdir that contains a `commondir` entry.
172
+
173
+
A subdirectory counts as the worktree it sits in. Detection walks up from the
174
+
given path to the nearest `.git` entry, so `index_repository` on any
175
+
subdirectory of a linked worktree is refused the same way, and a session root or
176
+
hook working directory inside one is treated as that worktree. The walk stops at
177
+
the first `.git` it finds; a main checkout or a submodule ends it as "not a
178
+
worktree". A path outside any git checkout is checked one directory at a time up
179
+
to the filesystem root and is never treated as a worktree. None of this runs
180
+
while the key is off.
181
+
182
+
The default is `false`, so indexing behavior is unchanged unless you opt in.
183
+
145
184
## 3. UI Settings
146
185
147
186
The optional built-in graph UI stores its settings in:
0 commit comments