Skip to main content
Claude Code keeps every session on disk, so you can ask questions of your own work. This recipe finds the messages where you were frustrated with the agent, then sums up what caused it in each session.
tp.read.claude_code() reads ~/.claude/projects by default. project keeps sessions whose working directory contains it, and limit keeps the most recently active ones. The plain-Python filter drops agent and tool steps before any LLM call, so you only pay for your own messages. To watch for this live instead, register the same lm_map on a server: see Live pipelines.

Next steps

Load traces

Codex sessions and the other sources.

Optimization

Label a few messages and tune the detector.