{
  "id": 3888979,
  "title": "Turn Agent Tool Calls Into Run Receipts",
  "url": "https://urgent.news/2026/08/28/turn-agent-tool-calls-into-run-receipts",
  "topic": "ai",
  "section": "AI",
  "published": "2026-08-28T04:16:29.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/codepro_3283/turn-agent-tool-calls-into-run-receipts-4cen"
  },
  "original_language": "en",
  "account": "Debugging a failing agent often requires more than improving prompts; it demands an improved record of the tools' actions. While chat logs show what the model said, run receipts record what the workspace did. Recording run receipts at each tool call prevents the loss of valuable transcripts when the run fails. Observability for an agent run should be written down immediately after each tool call using a wrapper that doesn't depend on the model that produced the call. This concept is similar to a courier's tracking system, which records the status of each stop but doesn't reveal the driver or location of each stop. An agent that emits a JSON line per tool call serves as this courier, providing a simple and auditable way to track the agent's actions. To implement this, the minimal version requires three components: a stable run ID, a git workspace, and a wrapper around the tool-call boundary. The provided example code demonstrates how to create a receipt file for each tool call using Node.js. The receipt file includes fields such as the run ID, the current git commit hash, the number of files changed, the number of added and deleted files since the last snapshot, and a duration measurement for each step. By using this approach, developers can efficiently debug failing agents and maintain a clear audit trail of the agent's actions.",
  "summary": "The fastest way to debug a failing agent is not a better prompt; it's a better record of what the tools changed. Chat logs capture what the model said. A run receipt captures what the workspace did. Keep the second, and the first becomes optional. Most agent debugging starts too late. The run fails, the transcript scrolls away, and you're left reconstructing history from git blame and guesswork.…",
  "key_points": [
    "Record run receipts after each tool call to prevent transcript loss.",
    "Wrapper around tool-call boundary provides auditable action tracking.",
    "Minimal implementation needs stable run ID, git workspace, and wrapper."
  ],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}