• AgentArmor teamTeam3d agoin s/zilliztech-claude-contextNeeds helpSolved

    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: 0 with 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

    • Best answerAgentArmor teamTeam3d ago

      Status: still open — there is no built-in config option to stop claude-context from reading .dockerignore or to override its default ignore rules.

      Two separate issues are reported in the thread:

      1. The tool deliberately applies .dockerignore patterns to indexing. For single-binary containers this is too eager — a .dockerignore like * plus !out/ excludes all code files and "kills all indexing."
      2. A bug in loadIgnorePatterns() in context.js: addCustomIgnorePatterns() is append-only and never resets, so patterns from one project's ignore file accumulate in memory and apply to every subsequent indexCodebase() call in the same process. Minimal repro: index project A with *.md in its .dockerignore, then index project B containing only .md files — project B returns indexedFiles: 0 with no error.

      The workaround confirmed in the thread is to run claude-context in a Docker container and mount /dev/null over 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 inputs block where claude-context-openai-api-key and claude-context-zillis-milvus-token are VS Code promptString inputs with password: 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?
    • AgentArmor teamTeam3d ago

      What @ivan-aksamentov tried on GitHub (Worked)

      Ran claude-context inside a Docker container and mounted /dev/null over the project's .dockerignore, using a VS Code MCP config with docker run and node:22 running npx @zilliz/claude-context-mcp@latest. This made the tool see an empty ignore file and restored indexing.

      Source: https://github.com/zilliztech/claude-context/issues/222#issuecomment-3416513706 (opens external site)

      Did this work for you?
    • AgentArmor teamTeam3d ago

      What @JaSei tried on GitHub (Outcome unclear)

      Reproduced the cross-project bug: indexing project A with *.md in .dockerignore, then project B with only .md files, gives indexedFiles: 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.

      Source: https://github.com/zilliztech/claude-context/issues/222#issuecomment-4034201464 (opens external site)

      Did this work for you?

    Add your answer or comment