How do I stop claude-context from applying .dockerignore when indexing?
The claude-context MCP server automatically applies .dockerignore patterns when indexing a codebase, so container projects whose Docker ignore file excludes source code (e.g. Rust/Go images that only ship a binary) get zero indexed files. In my VS Code setup I also see
indexedFiles: 0with no error when indexing a second project. Is there a way to prevent claude-context from ignoring files based on .dockerignore or other ignore files?Originally asked on GitHub: https://github.com/zilliztech/claude-context/issues/222
3 answers
Status: still open — there is no built-in config option to stop claude-context from reading
.dockerignoreor to override its default ignore rules.Two separate issues are reported in the thread:
- The tool deliberately applies
.dockerignorepatterns to indexing. For single-binary containers this is too eager — a.dockerignorelike*plus!out/excludes all code files and "kills all indexing." - A bug in
loadIgnorePatterns()incontext.js:addCustomIgnorePatterns()is append-only and never resets, so patterns from one project's ignore file accumulate in memory and apply to every subsequentindexCodebase()call in the same process. Minimal repro: index project A with*.mdin its.dockerignore, then index project B containing only.mdfiles — project B returnsindexedFiles: 0with no error.
The workaround confirmed in the thread is to run claude-context in a Docker container and mount
/dev/nullover the project's.dockerignore. VS Code MCP config from the thread:json{ "servers": { "claude-context": { "command": "docker", "args": [ "run", "--rm", "-i", "-v", "${workspaceFolder}:${workspaceFolder}", "-v", "/dev/null:${workspaceFolder}/.dockerignore", "-e", "OPENAI_API_KEY=${input:claude-context-openai-api-key}", "-e", "MILVUS_TOKEN=${input:claude-context-zillis-milvus-token}", "-e", "CUSTOM_EXTENSIONS='.vue,.svelte,.astro'", "node:22", "npx", "-y", "@zilliz/claude-context-mcp@latest" ] } } }The thread's original config also defines an
inputsblock whereclaude-context-openai-api-keyandclaude-context-zillis-milvus-tokenare VS CodepromptStringinputs withpassword: true.For the cross-project accumulation bug, the suggested workarounds: remove the problematic patterns from the other project's ignore files, or restart the MCP server and index the target directory immediately, before the ~5-minute background re-sync runs again.
General advice: mount an empty ignore file only if you are sure no ignore rules are needed; otherwise the tool will index everything including node_modules and build output. General advice: an OpenAI API key and Milvus token appear in this config; the thread keeps them out of the config file by using VS Code input prompts.
Did this work for you?- The tool deliberately applies
What @ivan-aksamentov tried on GitHub (Worked)
Ran claude-context inside a Docker container and mounted
/dev/nullover the project's.dockerignore, using a VS Code MCP config withdocker runandnode:22runningnpx @zilliz/claude-context-mcp@latest. This made the tool see an empty ignore file and restored indexing.Did this work for you?What @JaSei tried on GitHub (Outcome unclear)
Reproduced the cross-project bug: indexing project A with
*.mdin.dockerignore, then project B with only.mdfiles, givesindexedFiles: 0. Suggested removing the problematic pattern from the other project's ignore file or restarting the MCP server before the ~5-minute background re-sync runs again.Did this work for you?
Related questions
- claude-context: "Error validating collection creation: [object Object]" when indexing codebase
- claude-context: indexing succeeds but Milvus/Zilliz DB stays empty
- claude-context on Windows: 'Failed to open file' path has no slashes
- Can I use claude-context without an OpenAI key (OpenRouter, Mistral, or local LM Studio)?
- claude-context search_code: 'codebase is not indexed' after successful indexing?