Reading the Agent Log Like a Detective An engineer investigating a broken migration caused by an AI coding agent found that the agent followed a stale rule in its harness rather than the live schema file. The incident highlights five common failure modes in agent behavior that are visible in transcripts, where the root cause lies not in the model but in the rules, skills, and tools wrapped around it. The engineer advocates treating agent transcripts as forensic evidence to identify harness gaps before attempting fixes. The agent shipped a broken migration last month. The PR was clean, the tests passed locally, the reviewer signed off in twelve minutes, and the deploy to staging green-lit on the first try. Production started erroring within four minutes of the merge because the migration assumed a column existed that had been renamed two weeks earlier. The first instinct was to blame the model. Bad agent, didn’t read the docs. The second instinct was to add a rule. Always check the current schema before writing migrations. Both instincts felt productive. Neither would have fixed it. What fixed it was reading the transcript. The agent had, in fact, looked at the schema file. The schema file in the repo was correct. It had been updated when the column was renamed. But the agent had also loaded a database/CLAUDE.md rule that described the column under its old name as the canonical reference. The rule was stale. The agent followed the rule, but the rule was wrong. You could call this a model problem — the agent trusted a stale rule over the live schema file sitting right next to it. But that’s not the lever you can pull. The fixable cause was in the harness the rules, skills, hooks, and tools wrapped around the model and here it was a rule that lied . It was visible in the log if you read it forensically. That’s what this post is about. Reading agent transcripts as evidence, not as narrative. The five failure modes that show up over and over. And the habit of treating every wrong commit as a case to investigate before reaching for a fix. The first move when an agent ships bad code is to resist the urge to fix and move on. The fix is downstream. The question worth asking is how did the agent decide to do that . The answer lives in the transcript. Most modern agent harnesses save full transcripts somewhere. Claude Code stores them in ~/.claude/projects/