Skip to content

v0.7.0 install/update wires the legacy blocking PreToolUse gate, not hook_augment (regresses #214) #409

@cryptomaltese

Description

@cryptomaltese

Summary

On a clean v0.7.0 install -y --standard (and update), the Claude Code PreToolUse hook written to ~/.claude/hooks/cbm-code-discovery-gate is the old blocking shell gate (exit 2, gate file keyed on bare $PPID) — not the non-blocking augmenter shipped in the binary (src/cli/hook_augment.c, commit c29e6d5). So the exact symptom of #214 returns on every install/update, even though #214 is marked fixed in v0.7.0.

Why it misbehaves (same root as #214)

$PPID is the shell spawned for each hook invocation, so it rotates per tool call. The gate file /tmp/cbm-code-discovery-gate-$PPID therefore never matches a prior one → the "first call per session" check is always true → every Grep/Glob/Read is blocked with exit 2, not just the first.

The installed hook (v0.7.0):

#!/bin/bash
# Gate hook: nudges Claude toward codebase-memory-mcp for code discovery.
# First Grep/Glob/Read/Search per session -> block. Subsequent -> allow.
# PPID = Claude Code process PID, unique per session.
GATE=/tmp/cbm-code-discovery-gate-$PPID
...
touch "$GATE"
echo 'BLOCKED: ...' >&2
exit 2

Repro

  1. codebase-memory-mcp install -y --standard (or update) on v0.7.0, Linux, Claude Code.
  2. In a session, issue several Read/Grep calls.
  3. Each is blocked by the gate (not nudged once) — the claude process reads the hook fresh each call and $PPID differs every time.

Expected

install/update should wire the non-blocking augmenter (the hook_augment path that's already in the binary), so Read is no longer gated and the nudge is emitted at most once per session — the behaviour #214 was closed as delivering.

Note

The binary genuinely has the fix; this is a packaging/install gap — the install template still emits the legacy blocking script. A session_id-keyed (from the PreToolUse stdin JSON) non-blocking augmenter that exit 0s avoids both the $PPID rotation and any ps/process-name assumptions.

Environment

  • v0.7.0, Linux (cgroup v2), Claude Code, standard stdio variant.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingeditor/integrationEditor compatibility and CLI integration

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions