Repository navigation
dsh-hooks-claude-code sends lowercase tool names, breaking git-ai (Claude Code hook consumers) since git-ai 1.6.22 #1801
Small-Sagittarius
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Summary
dsh-hooks-claude-codebuilds its Claude-Code-shaped hook payloads with the raw DSH tool name (tool_name: exec.name), which is lowercase for DSH tools (write,edit,pwsh,read, ...). Third-party consumers of Claude Code hooks that rely on the canonical CC tool vocabulary break on these payloads.Concretely, git-ai 1.6.22+ (commit
8abdd416a, "fix(claude): skip checkpoint requests for read-only and unsupported tools") now classifies hooktool_namethroughclassify_tool(Agent::Claude, ...), which matches only the exact uppercase namesWrite/Edit/MultiEdit/Bash; everything else is treated asSkipand the payload is dropped with zero events (exit 0, silent). Before 1.6.22, lowercasewrite/editstill produced FileEdit checkpoints (the file path was extracted fromtool_input.file_path), so DSH-produced AI edits were attributed; after the upgrade they are entirely lost.Evidence
With DSH hooks enabled,
git-ai checkpoint claude --hook-input stdinreceives payloads such as:{"hook_event_name":"PreToolUse","tool_name":"write","tool_input":{"file_path":"src/main.rs"},"cwd":"...","transcript_path":"...","session_id":"..."}tool_name: "write"->event_count: 0, no requests, no checkpoint persistencetool_name: "Write"->event_count: 1, normal checkpointImpact
DSH agents editing files in a git repository get no AI authorship attribution in git-ai's git notes (
refs/notes/ai) after git-ai 1.6.22. Workaround currently requires forking the plugin to add a tool-name mapping (write->Write,edit->Edit,pwsh/bash->Bash).Suggestion
Since this bridge's contract is to emit Claude-Code-compatible payloads, the plugin should normalize tool names to the CC vocabulary:
write->Write,edit->Edit), shell tools toBash(pwsh/bash), and leave read-only tools unmapped (they are legitimately skipped by consumers), orThis would let consumers like git-ai attribute DSH edits without a fork. Happy to contribute a PR.
All reactions