Skip to content

Claude Code install doesn't wire the PostToolUse (Read-coverage) hook, though hook_augment.c already supports it #1393

Description

@cobrabr

Summary

codebase-memory-mcp install for Claude Code writes PreToolUse (Grep/Glob), SessionStart, and SubagentStart hook entries to ~/.claude/hooks/ and settings.json. The README also documents a PostToolUse hook on Read — fallback structural context when a file couldn't be fully parsed/indexed — but no script or settings.json entry for it gets created.

Evidence

Install output (v0.9.0, Windows) lists only:

hooks: PreToolUse (Grep/Glob search-graph augmenter, non-blocking)
hooks: SessionStart (MCP usage reminder on startup/resume/clear/compact)
hooks: SubagentStart (MCP usage reminder for subagents)

src/cli/hook_augment.c already contains the matching logic, ahead of the Gemini/Qwen/Qoder/Factory/Augment dialect checks:

if (strcmp(event, "PostToolUse") == 0 && strcmp(tool, "Read") == 0) {
    if (coverage) { *coverage = true; }
    return true;
}

So the runtime is ready for a Claude Code PostToolUse/Read event — the install template just never emits the corresponding hook entry for it.

Expected

install/update should also write a PostToolUse hook entry (matcher Read) pointing at the augmenter, alongside the existing PreToolUse/SessionStart/SubagentStart entries.

Environment

codebase-memory-mcp 0.9.0, Windows, Claude Code (native install)


🤖 Filed with the help of Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    editor/integrationEditor compatibility and CLI integrationwindowsWindows-specific issues

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions