How many times has your coding agent compacted on you?
You're an hour into a session. The agent knows the codebase, knows what you asked for, and knows the handful of rules you set along the way: no new dependencies, don't touch the public API, that sort of thing. Then the chat gets too long, it gets squashed into a summary, and something quietly changes. A while later it installs the one package you said not to.
Nobody tells you the rule was gone. The summary just didn't have room for it.
That's what I built Blackout for, in Kiro.
What it does
Blackout is an MCP server and a Kiro power. It keeps what the agent knows outside the chat, where a compaction can't reach it:
- It maps your repo into a graph: every folder, its files, every import between them. A read-only audit writes down what each folder does, so after a compaction the agent can ask instead of re-reading everything.
- It files your rules on the folder they govern, in your exact words.
- It checks every compaction. When Kiro writes its summary, Blackout holds it up against the ledger and calls each rule kept, weak or lost.
- It puts back only what was lost, word for word, labelled by who set it.
Then it draws all of it as a haunted toon city: folders are buildings, rules are lit rooms, imports are wires, and a compaction is midnight, when the lights go out street by street.
Every rule is a paper notice pinned to a wall in the folder it governs, word for word:
And the same codebase as a graph, or as a map:
A real session
I installed Blackout from npm into a fresh Kiro, opened the Blackout repo itself, gave it three rules, and kept working until Kiro hit 79% of its context and compacted on its own.
Blackout's PostCompact hook checked the real summary. All three of my rules came through, but ten facts about the code had been blurred or dropped, things like which function guards the folder paths. It put all ten back.
Then I tried to break it and asked Kiro to add chalk. That's a new dependency.
Kiro said no and quoted my rule back at me.
How I built it in Kiro
Everything except the 3D city assets was built in the Kiro IDE.
- Spec first. I started with a Kiro spec: requirements, then design, then a task list I worked through. It forced me to decide what "kept" and "lost" actually mean before writing any code.
- Steering kept the agent on my conventions across a long build: how the backend is laid out, how the viewer works, the camera rules for the film.
- Hooks are the heart of it. Six of them: UserPromptSubmit files rules from what you type, PostToolUse tracks which files are in context, PreCompact and PostCompact wrap Kiro's compaction, PostFileSave flags stale audits, and Stop checks the turn against your rules.
- MCP gives Kiro 22 tools to map, audit, file, check and restore.
- A power packages all of it, so setting it up is one npm install and a copy into
.kiro.
The meta part I liked most: I was building a tool about agents losing context while my own agent was losing context. Blackout ended up guarding its own build.
Does the check actually work?
Marking a rule kept, weak or lost is a text comparison, so I measured it on 143 hand-built compaction cases. It caught 96% of the rules a summary dropped or blurred, and on the cases I held back from tuning it never re-sent a rule that was still intact.
Try it
- Live city: blackout.aaryanparveen.com (the Runs tab has the real session)
- Code: github.com/aaryanparveen/blackout
- Install:
npx -y blackout-ledger mcp
Your codebase is next.









