Trace multi-agent hand-offs in your code
A free kit that you give to your AI coding agent. It finds every place where one agent hands work to another, and proposes the smallest change that lets you follow one run from start to end by a single trace id.
Hard case or no time?
Write to me. Free consultation: I tell you the fastest safe way to export, secure or fix your app.
What it does
- The add-trace-ids skill reads your multi-agent code and finds every hand-off: function calls, queue messages, HTTP calls and framework hand-offs.
- It makes one table: file and line, and how the run id passes today.
- It then proposes one trace_id per run and a parent_id on every hand-off. It shows the change file by file.
- The event-schema skill gives the fields of one event: trace_id, id, parent_id, agent, status, cost, latency and time. It maps them to the OpenTelemetry attributes for AI agents.
- The dashboard-checklist skill lists what a multi-agent dashboard must show and which of it your code can already feed. It only reads.
What it writes, and when it asks
- Nothing is written before you say yes.
- Your agent code, if it is not on your computer yet: the agent copies your repository, after its own yes.
- Three small skill files in your project folder, after your yes.
- Code edits that add-trace-ids proposes later. You see the change for each file and say yes or no to each one. It never commits or pushes.
- A TRACE-EVENTS.md file that event-schema proposes later, after its own yes.
- The kit counts downloads of its files as daily totals, with nothing about you.
What you need
- Your multi-agent code, on your computer or in a repository.
- An AI coding agent: Claude Code or Codex.
- A few minutes to say what starts one run in your system.
How the install goes
- Press a button on this page. Your agent opens with the install request ready.
- The agent looks for your agent code and asks before it copies anything.
- It shows the three files it will write. You say yes or no.
- It fetches the skills. If one fetch fails, it stops and writes nothing.
- It runs add-trace-ids and reports every hand-off before it proposes any change.
Limits to know
- The kit reads code. It does not read your logs or your running system.
- It lists the hand-offs it can see in the files. A call built at run time or a closed service may be missed, and the report says so.
- The OpenTelemetry conventions for AI agents have the status Development, so attribute names can change.
- OpenTelemetry defines no attribute for cost. The kit uses a custom attribute for it.
- The kit does not build or host a dashboard. It prepares the events that one needs.
How do I trace hand-offs between AI agents?
Create one trace_id where a run starts, give every step its own id, and pass the id of the calling step as parent_id on every hand-off. Then log one event per step. This kit finds the hand-offs in your code and proposes that change file by file.
Can I use OpenTelemetry for AI agents?
Yes. OpenTelemetry has GenAI conventions for agent spans, such as gen_ai.agent.name and gen_ai.operation.name. They have the status Development, so names can change. The kit maps each event field to them and says where there is no standard name.
Does the kit change my code?
Only if you say yes, one file at a time. It first reports every hand-off it found and shows the change as a diff. It never commits or pushes, and it never prints a secret value.
What does a multi-agent dashboard need?
A run trail by trace id, failed hand-offs, retries and escalations, latency per agent, cost per agent and per run against a cap, stuck runs and a human-review queue. The checklist skill names the fields each one needs and which your code can already feed.
Files
Free to use and copy under the MIT license.
Related articles
Have a more complex idea? Free consultation — write to me