← Madiyar Zhunussov

TraceBack

Shows what a Claude Code session changed in your code, and whether each change was checked.

How it came together

1. Getting the data with no setup

Problem: I wanted to see every tool call Claude Code makes, without asking anyone to add an SDK or an API key.

Choice: TraceBack installs Claude Code hooks that send each event to a small server on the user’s own machine. I chose this over a cloud dashboard, which would need accounts and keys and would send code off the laptop.

Result: It works right after install, and nothing leaves the machine. The server also refuses requests from browsers, so a website can’t read the trace.

2. Pausing an agent by not answering

Problem: Watching wasn’t enough. I wanted to stop the agent before a risky call ran.

Choice: Claude Code waits for each hook’s reply before it runs the tool. TraceBack pauses an agent by holding that reply open, for up to 600 seconds, and redirects it by replying “deny” with a reason.

Result: Pause and redirect needed no changes to Claude Code. The same path later became guards: rules that block calls such as deleting files or pushing to main.

Fig. 1. A guard blocks a push to main, and repeated calls collapse into one row with a count. Illustrative session.

3. Cutting false alarms

Problem: The first detector flagged any call repeated 4 times and any 60 seconds of silence. Most of those silences were the agent waiting for the user to approve a permission, because the hook fires before that prompt appears.

Choice: I narrowed loops to clearly stuck cases: the same failing command 3 times, or the same file read 5 times with no edit. I stopped flagging the normal read-then-edit cycle, raised the stall limit to 120 seconds, and show “waiting for you” instead of an alarm when the agent needs the user.

Result: The detector is a pure function over the last 64 events, so it behaves the same way every time and is easy to test. An optional LLM writes summaries but never decides what gets flagged.

4. A view that fits a sidebar

Problem: The first interface was a node graph. In the narrow VS Code sidebar, layouts spread off-screen and edges lost their nodes.

Choice: I replaced the graph with a timeline, grouped it by prompt into chapters, and removed the graph library.

Result: One view instead of three. Every view is computed from the list of events, so replaying a past session needed no extra code.

5. Reviewing what changed

Problem: A timeline shows activity, but after a run you want to know what each file looks like now and whether it was checked.

Choice: TraceBack saves a file’s contents before the agent first edits it, then shows one diff per file from that point to the end. It skips files over 512 KB and never copies folders such as .ssh or .aws.

Result: A per-file review with the agent’s stated reasoning and a badge for whether the change was verified.

What broke

Early on, every agent appeared in one timeline, and the view for running several agents at once never showed up. The cause was that the event store ignored each event’s session ID. Routing events by session fixed both problems.

Next

Support for Codex CLI, and review for archived sessions, which don’t keep their file baselines yet.