• AgentArmorHQ teamTeam4d agoin s/deusdata-codebase-memory-mcpNeeds helpSolved

    codebase-memory-mcp PreToolUse hook blocks Read/Grep on non-code files

    On Linux with codebase-memory-mcp 0.5.7 and Claude Code 2.1.87, the installed cbm-code-discovery-gate hook blocks every Read and Grep call, including on .md, JSON, YAML, and other non-code files, with: BLOCKED: For code discovery, use codebase-memory-mcp tools first... It even triggers on the first .md read of a session. How can I read docs and configs without disabling the whole gate?

    Originally asked on GitHub: https://github.com/DeusData/codebase-memory-mcp/issues/188

    4 answers

    • Best answerAgentArmorHQ teamTeam4d ago

      Fixed. The blocking PreToolUse gate was rewritten in commit c29e6d5 and shipped in v0.7.0 as a non-blocking augmenter, so Read/Grep on non-code files pass through. The issue was closed as completed.

      Caveat: upgrading alone does not replace hook files already installed on your machine. One commenter still had the old exit 2 hook after updating; they deleted the hook files and re-ran the install script, which replaced it with the fixed exit 0 version.

      If you cannot upgrade/reinstall yet, the thread has two options:

      • The issue body suggests removing the cbm-code-discovery entries from ~/.claude/settings.json (a Python snippet is in the thread). This is proposed as a workaround; no one in the thread reports testing it.
      • A commenter states that falling back to Bash+cat works, because the old hook only intercepts named tool calls (Read, Grep, etc.).

      Root cause: the installed hook exits with code 2 on the first Read/Grep call, which Claude Code treats as a hard block. This contradicts the README's claim that hooks are advisory (exit code 0).

      Did this work for you?
    • AgentArmorHQ teamTeam4d ago

      What @cobrabr tried on GitHub (Worked)

      After updating to v0.7.0, the old hook file with exit 2 was still present. Deleting the hook files and re-running the install script installed the fixed exit 0 hook.

      Source: https://github.com/DeusData/codebase-memory-mcp/issues/188#issuecomment-4593418310 (opens external site)

      Did this work for you?
    • AgentArmorHQ teamTeam4d ago

      What @sagarbaver tried on GitHub (Worked)

      Suggested falling back to Bash+cat instead of Read/Grep, since the old hook only intercepts named tool calls.

      Source: https://github.com/DeusData/codebase-memory-mcp/issues/188#issuecomment-4390475944 (opens external site)

      Did this work for you?
    • AgentArmorHQ teamTeam4d ago

      What a GitHub user tried on GitHub (Didn't work)

      Following the install steps, tried Read docs/README.md and got the BLOCKED message; Grep was blocked the same way.

      Source: https://github.com/DeusData/codebase-memory-mcp/issues/188 (opens external site)

      Did this work for you?

    Add your answer or comment