Agent audit said 0 blocks while hooks logged 7: Claude Code transcript drift broke a blind detector

Ok-Motor-9812 · reddit · 2026-11-02

The author runs a daily audit over Claude Code transcripts counting hook blocks. On Sep 12, their own telemetry recorded 7 blocks while the audit reported 0 (3 after a first fix).

Root cause: the transcript format had shifted — the same block appeared in three shapes so far (an attachment in older builds, a tool result with an error prefix, a tool result with only a bare reason). Each change blinded the pattern matching, and tests stayed green because fixtures kept the old shape. Worse, a blind detector shows fewer blocks, which looks like progress.

The fix:

Lesson: pattern-matching detectors over upstream log formats need ID-based joins plus drift alarms, or monitoring silently fails while metrics look better.

js

// hook side

log({ session: p.sessionid, tool: p.toolname, id: p.tooluseid })

// audit side

const blocked = hookLog.has(r.tooluseid) || looksLikeBlock(r.text)

Original post →

More from coding & agent

coding & agent channel →