Who it is forA developer debugging a multi-step agent whose latency and token totals changed after an update.
The problemOverlapping child spans make parent execution time and token usage look larger than the work actually done.
The outcomeAn input trace, an HTML timeline, and a JSON regression report that keep per-span token counts exclusive.
What you need first
- Node.js, npx, and python3 installed for the coding agent tutor
- A skill-capable coding agent such as Claude Code or Codex, with a writable skills scope
- Python 3.10 or newer for the retrieval and firewall projects
- Node.js 22.18 or newer for the agent trace debugger
- A clone of the repository so the project_test.py grader is available
Steps
- Run
node --versionand confirm it reports 22.18 or newer. (inferred, check the README) - Run
python3 scripts/project_test.py agent-trace-debugger --init learning-artifacts/agent-trace-debuggerfrom the repository root. (inferred, check the README) - Implement JSONL parsing, parent validation, and interval arithmetic in the starter.
- Run
python3 scripts/project_test.py agent-trace-debugger --all --path learning-artifacts/agent-trace-debugger --strictuntil every stage passes. (inferred, check the README) - Keep the input trace, the HTML timeline, and the JSON regression report from the output folder.
Prompt for your agent
In the repo rohitg00/ai-engineering-from-scratch, run the agent-trace-debugger project with --init into learning-artifacts/agent-trace-debugger, then implement the stages until the --all --strict grader passes. Expected output: an HTML timeline and a JSON regression report for the supplied trace. Verify that per-span token counts are not double counted between parent and child spans.
Caveat. The project uses Node.js for the debugger and Python 3 for the grader, so both runtimes must be installed.
Use this in your AI agent
Ask your agent
Using the Deduped MCP, get the setup steps for rohitg00/ai-engineering-from-scratch and "Separate child work from parent time in an agent trace"
Add Deduped to Claude Code once
claude mcp add --transport http deduped https://dedupedai.com/mcp
Every Monday: the 5 hottest repos and exactly how to use them. Free, one email a week, unsubscribe anytime.
Get them freeShare: X LinkedIn Hacker News Email Copy link
Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer