Tombstone stops a Kiro agent when a task goes over its budget. In a live run on 24 November the cap was 0.10 credits: the breaker tripped at an estimate of 0.114, the agent's next tool call was refused, and the turn ended at 0.126 credits actual.

Who it's for: a developer on a paid Kiro plan who starts a spec and walks away.

Try it with no Kiro and no credits: tombstone demo replays a recorded Kiro session against a 0.30 cap, writes the STOP file and the receipt, and shows the real hook answering with exit code 2.

Inspiration

Someone wrote "HARD STOP: 40 credits OR 40 minutes" into a Kiro prompt. The agent ran for 2 hours 3 minutes anyway (kirodotdev/Kiro#10999). Other people report a stuck spec task passing 800 credits (#7485), and the Kiro team has said there is no external circuit breaker (#11477).

I had 4,000 hackathon credits and no way to buy more from Ukraine. In my own first test, before the watcher could see V3 sessions, one looping task burned about 22 credits in 7 minutes. A prompt is a request. I wanted something the agent can't argue with.

What it does

Tombstone gives every spec task a credit cap and enforces it from outside the model.

  • Prices every task. Kiro CLI already writes session files to disk. Tombstone reads them and turns them into a cost per turn, per task and per spec. Nothing leaves the machine.
  • Stops a runaway turn in two steps. Past the cap it writes a STOP file. The PreToolUse hook sees it and exits with code 2, so Kiro refuses the next tool call and shows the agent why: TOMBSTONE: this turn over budget (est. 0.11 of 0.10). Stop. If the agent keeps going anyway, the watcher ends the kiro-cli process for that project. We saw it happen live: with the hook removed on purpose, the watcher wrote STOP 8 s into a looping task and ended the kiro-cli tree 7 s later.
  • Catches a stall. The agent keeps calling the model while no project file changes. That trips the breaker too.
  • Leaves a receipt. Every stop writes autopsy.md: task, model, estimate at the stop, the refusal text, the last 10 tool calls, and the real price once Kiro reports it.
  • Tells the agent its budget. One MCP tool, get_budget, returns what a similar task cost and what is left in the spec and the plan.
  • Buries the result. tombstone graveyard draws a night graveyard. One stone per task, its height is the price, plots group the spec, unpriced turns get unmarked graves, stopped tasks get a cracked stone. Click a stone and you get the card: actual, estimate, requests, minutes, and how far off the estimate was.

The breaker spends zero credits. It never calls a model and never changes yours. We checked: /usage read 222.86 before and after five balance probes, a hook call, a cost report and a get_budget call.

How this differs from /usage

Kiro CLI 3.1.0 (5 Nov 2026) shows what the current session has spent, in /usage and in an optional status line segment. That tells you the bill. Tombstone ties the spend to a spec task, compares it with a cap, refuses the next tool call when the cap is passed, and writes a receipt. Seeing the meter and having a breaker are different things.

Neighbors in this hackathon

umwayi-os puts one gate in front of Claude Code, Kiro and OpenCode, with rules and a budget per run. It is far broader than Tombstone. For Kiro, though, its own budget doc says "Kiro sends umwayi nothing", so a Kiro run counts at a declared rate and can't be stopped on its real price while it runs. Tombstone does only that one thing: it reads the session files Kiro already writes, prices the running task and refuses the next tool call past the cap. Exorcist 98 guards an agent against poisoned instructions. Sleuth checks that a demo video shows what its script claims. Séance runs Kiro agents as IRC users, with an optional credit cap per channel and a /kick for the human. Different questions. If you want one gate for every agent, pick umwayi-os. If you use Kiro specs and want each task to have a price and a hard stop, that's this.

Why a graveyard (Costume Contest)

Most graveyards in Kiroween bury code or tasks. This one buries money: every stone is what one Kiro spec task really cost, and every cracked stone is a task the breaker stopped. The costume carries the data. A tall stone is an expensive task, so you see where the money went before you read a number. A crack means the breaker fired. Red shows up in one place only, when something went wrong. Click a cracked stone and its card shows the stop receipt: why it stopped, the refusal the agent read and its last tool calls. The page is a single static HTML file with no external requests, so it opens years from now without a server.

How we built it

Kiro CLI wrote every line of product code from a spec in .kiro/specs/tombstone/. I wrote requirements.md in EARS notation, Kiro generated design.md and tasks.md, and then ran the tasks one by one with kiro-cli chat --no-interactive. A human picked the next task, read the diff and ran the checks.

Tombstone priced its own build while it was being built, with its own hooks installed in the repo. The graveyard is that build: 73 stones, 195.44 credits of priced turns (the video shows it at 49 stones, before the last tasks). 51 stones belong to spec tasks. The other 22 are turns that ticked no checkbox (fixes, reviews, measurements), and Tombstone files them as unknown instead of guessing. The page also carries the 25 turns the breaker stopped in our live tests, as cracked stones with a red glow, kept in live_stops.json. Together that is the 207.81 credits on the page headline (the killed turn counts at its estimate, 0.32, because Kiro writes no price for a killed turn). The most expensive task was the session parser at 15.15 credits, and the page says the estimate for it was 70 percent low.

The full build log, with credits per task, is in KIRO_LOG.md.

How we used Kiro

  • Kiro CLI, 3.0.0 and later 3.1.0, V3 engine, model auto. All product code.
  • Spec-driven development. Requirements in EARS, design and tasks generated by Kiro. Twenty-two top-level tasks with subtasks. When CLI 3.0.0 shipped mid-build and moved the session format, we rewrote the requirements for V3 and Kiro regenerated the design and tasks.
  • Hooks. Seven shell command hooks, no agent hooks, so the breaker itself costs nothing: PreToolUse (the actual brake), PostToolUse, Stop, UserPromptSubmit, SessionStart and two task hooks. All seven run in the repo's own /.kiro/hooks/ during its build.
  • Steering. project.md holds the stack and the dogfood rules. The tombstone.md that init writes asks the agent to check get_budget before a task and to stop and ask a human when the budget is short.
  • MCP. get_budget, a stdio server on the standard library, answers initialize in about 45 ms.
  • Powers. power/ packages the skill, the MCP server and the hook templates. Hooks are not a documented Power component yet, so the Power alone does not arm the cap; tombstone init does.
  • Not used: property-based testing (it needs the IDE, and this build was CLI only), Kiro Crew.

From spec to hook

One line of the spec, followed to the refusal the agent reads:

  1. Requirement R6.2 in requirements.md: "WHILE the STOP file exists THE SYSTEM SHALL make every pre-tool hook (V2 preToolUse, V3 PreToolUse) exit with code 2 and print a one-line reason to stderr".
  2. Task 7.1 in tasks.md: the STOP check as the first step of tombstone hook pre-tool. Kiro wrote it and its tests.
  3. Hook .kiro/hooks/tombstone-pre-tool.json: trigger PreToolUse, a shell command, no agent prompt, so it costs nothing.
  4. Refusal: Kiro gets exit code 2, refuses the tool and hands the agent TOMBSTONE: this turn over budget (est. 0.11 of 0.10). Stop.

What surprised us about Kiro

  • The agent obeys a hook it was told to ignore. We wrote in the prompt: "If any tool call is refused or blocked, do not stop." It stopped at the first refusal and quoted the rule back, also with the steering file removed. On 24 November it answered: "The hook comes from your own .kiro/hooks setup, so I'm treating it as an instruction and not working around it."
  • It refuses an endless loop by itself. A prompt that ordered a never-ending read-only audit was meant to trip the stall detector. Kiro did one pass and then declined to repeat it.
  • Smart models read the cap. The agent finds the limit in tombstone.toml and often stops before the breaker has to. We kept the cap public.
  • The CLI changed under us. Kiro CLI 3.0.0 shipped two days into the build. We rewrote the requirements and Kiro regenerated design.md and tasks.md from them.

Challenges we ran into

Kiro CLI 3.0.0 shipped two days into the build. Session files moved, hooks changed and the price format changed. Most of the plan had been written for 2.37.1.

Kiro writes the exact price of a turn only when the turn ends, and the Stop hook fires before that line is written. So the breaker has to work on a live estimate, and a small background step fills in the real price a few seconds later. Both numbers stay on the stone so you can see the gap.

Pinning a turn to a task without guessing took three rounds. The rule that survived: the task whose checkbox the turn ticked, or unknown.

Three rounds of security review found ways a planted symlink in the state folder (now .tombstone/) could make Tombstone overwrite a file elsewhere. Every file it writes now opens with O_NOFOLLOW and is replaced atomically.

Accomplishments that we're proud of

  • 25 live stops with the hook in place, and the agent stopped every time. On 24 November, in a project with one earlier turn to learn the price, a 0.10 cap tripped at an estimate of 0.114 and the turn ended at 0.126 actual: a 9 percent gap.
  • On a normal 12-step task with a cap of 0.30 credits, the breaker wrote STOP 9 seconds in, the next tool call was refused and the agent stopped. The run cost 0.33 credits.
  • The stall detector stopped a read-only loop at step 9, for 0.93 credits.
  • The last test pass found that, with the watcher off, the estimate was never calibrated and came out about twice the real price. After the fix the median error on 33 real turns, each estimated only from the turns before it, is 26 percent (it was about 65). We measured it, and the number is in the repo.
  • 594 tests run in about 8 seconds and need no Kiro install. CI runs them on Linux and macOS with Python 3.11 and 3.12.

What we learned

A feature that only the background service feeds is off when the service is off. Test with the watcher stopped too.

A Kiro run that ends without a summary has failed, even if a checkbox moved. Read the tail of the log before you trust the tick.

The agent reads everything in the project, including the cap in tombstone.toml, and smart models often stop before the breaker has to. We kept the cap public on purpose.

What's next for Tombstone

The Kiro IDE as a second source of session data, a watcher for agents running on a server, and a published false positive rate once the stall detector has fired on real work.

Known limits, said plainly

  • The breaker acts on an estimate. The exact price exists only after the turn.
  • In a fresh project with no closed turns the estimate uses a default price that runs high, so the first stops come early: in eight such runs with caps of 0.20 to 0.40 the actual was 0.16 to 0.19.
  • With the hook in place the agent always stopped at the first refused tool, so the kill never had to fire. We ran the kill alone on 23 Nov with the hook removed in a scratch project: STOP, then SIGTERM to 3 kiro-cli processes 7 s later, and the receipt records it. The live runs of 23 and 24 Nov were on Kiro CLI 3.5.0; the rest of the testing was on 3.0.0 and 3.1.0.
  • Installing from GitHub was checked on a fresh clone once the repo went public (19 Nov), and on 24 Nov a clean pip install into a fresh Python 3.12 venv ran tombstone demo. Installing the Power by URL was not checked.

Built With

Share this project:

Updates

Submission history