Summary
Currently, .cdidxignore patterns are only recognized in the indexed project root and inherited down to child directories (FileIndexer line 67, IgnoreFileNames = [".gitignore", ".cdidxignore"]). Monorepo and multi-workspace setups have no way to define workspace-local ignore rules in a central .codeindex/config/ directory without modifying the root .cdidxignore or .gitignore. This blocks scenarios like: "Index /workspace/repo1 AND /workspace/repo2 from a shared .codeindex/workspaces/ config manifest."
Where
src/CodeIndex/Indexer/Scanning/FileIndexer.cs:67 (IgnoreFileNames hardcoded, no config-dir variant)
src/CodeIndex/Indexer/Scanning/FileIndexer.cs:1526 (LoadIgnoreRulesForDirectory iterates IgnoreFileNames; no config-dir lookup)
src/CodeIndex/Cli/IndexCommandRunner.cs:95 (no per-workspace config loading before FileIndexer construction)
Suggested approach
- Add support for a
.codeindex/.cdidxignore file (workspace-scoped) separate from project-root .cdidxignore
- Modify LoadIgnoreRulesForDirectory to check for this workspace-root file once at initialization
- Create a new IgnoreRulesForWorkspace class that merges workspace-root, ancestor, and directory-level rules in the correct precedence
- Pass the workspace ignore root to FileIndexer via constructor (already supports ignoreRuleRoot parameter)
- Document the new
.codeindex/.cdidxignore in USER_GUIDE with examples for multi-workspace setups
- Store the resolved workspace ignore ruleset in indexing metadata for future audits
Summary
Currently, .cdidxignore patterns are only recognized in the indexed project root and inherited down to child directories (FileIndexer line 67, IgnoreFileNames = [".gitignore", ".cdidxignore"]). Monorepo and multi-workspace setups have no way to define workspace-local ignore rules in a central
.codeindex/config/directory without modifying the root .cdidxignore or .gitignore. This blocks scenarios like: "Index /workspace/repo1 AND /workspace/repo2 from a shared.codeindex/workspaces/config manifest."Where
src/CodeIndex/Indexer/Scanning/FileIndexer.cs:67(IgnoreFileNames hardcoded, no config-dir variant)src/CodeIndex/Indexer/Scanning/FileIndexer.cs:1526(LoadIgnoreRulesForDirectory iterates IgnoreFileNames; no config-dir lookup)src/CodeIndex/Cli/IndexCommandRunner.cs:95(no per-workspace config loading before FileIndexer construction)Suggested approach
.codeindex/.cdidxignorefile (workspace-scoped) separate from project-root.cdidxignore.codeindex/.cdidxignorein USER_GUIDE with examples for multi-workspace setups