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
fix(hook): claude-code-hook reads Claude Code's new stdin JSON API
The Claude Code hook contract moved from CLAUDE_TOOL_* env vars to a
single JSON object delivered on stdin. This hook still expected the old
env vars — so every fire silently `exit 0`'d after the tool-name check
without sending anything. Every project pairing RedLog with a Claude
Code hook has been logging zero Bash tool calls for months.
Also fixes a lurking bash bug: `TOOL_INPUT="${CLAUDE_TOOL_INPUT:-{}}"`
appended a stray `}` to any JSON containing a closing brace, so even if
Claude had still been setting the env var, the JSON parse would have
failed. Rewritten to slurp stdin, hand the JSON to a single python3
step for parse + redaction + payload build, and stay quiet on any error
(a hook must never break Claude Code's UX).
New event fields:
- `session_id` — Claude Code session that ran the tool
- `transcript_path` — pointer to the full conversation .jsonl on disk
- `cwd` — working directory the tool ran under
Deliberately NOT copying conversation content into the chain: it's
Anthropic-owned, it would inflate the chain by orders of magnitude, and
`transcript_path` gives auditors on-demand access without any of those
downsides.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>