You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
post-edit hook silently does nothing on Claude Code: tool_input.file_path is not parsed #110
The PostToolUse hook parses the wrong payload shape for Claude Code, so both features it drives have been silently inert: agent-edit provenance records nothing, and the post-edit blast-radius warning never fires.
The second is what Claude Code actually sends for Edit/Write. It produces no output and no record.
Corroborating: across a four-day session in this repo where I made a dozen-plus Edit/Write tool calls and shipped four merged PRs, .codemap/agent_edits.jsonl was never created. Every UserPromptSubmit hook that session printed no agent edits recorded this session — accurately reporting its own failure.
Root cause
parseHookFilePathsErr (cmd/hooks.go:1798) handles exactly two structured shapes:
iffilePath, ok:=data["file_path"].(string); ok { ... } // top-leveliftoolInput, ok:=data["tool_input"].(map[string]any); ok {
ifcommand, ok:=toolInput["command"].(string); ok { ... } // Codex apply_patch
}
tool_input.file_path matches neither. The regex fallback that would have caught it only runs when json.Unmarshal fails — and a well-formed payload parses fine, so it never executes. Valid JSON in the unhandled shape is the one case that silently returns nothing.
Impact
Edit provenance (fix: make codemap's model of agent sessions truthful #84) — agent_edits.jsonl is never written on Claude Code. showWorkingSetSummary and showSessionProgress therefore always fall back to disk-churn counts, which is the exact conflation that feature was built to remove.
Post-edit blast radius — the "you just edited a file that N others import" warning never fires. This is the behavior CLAUDE.md instructs agents to rely on before editing.
Fix
Accept tool_input.file_path (and, for symmetry, tool_input.notebook_path) alongside the existing shapes. Worth also handling tool_response.filePath, which some tools echo back.
Regression tests should cover each payload shape end-to-end rather than only the parser, since the parser was arguably "working" — it just never saw the shape it needed.
Cross-reference
Same class as #109: a feature reporting success (or in this case, honestly reporting emptiness) while doing nothing. Both are cases where the check and the reality diverged silently.
Activity
fix(hooks): Parse Claude Code's nested tool_input payload (JordanCoin…