Inspiration I have audited unfamiliar codebases under deadline pressure, and the experience is always the same: you open a repository you did not write, the logs point in one direction, the data flow points in another, and your attention becomes the bottleneck. You cannot hold every thread at once. One agent helps, but a single conversation forces you to be the switchboard between research, investigation, and writing—every handoff waits for you.
That is the problem I wanted to attack. Not “generate code faster,” but delegate parallel investigation without losing the thread. Kiro Crew’s subagent model is built for exactly this: short-lived background agents that run in parallel, each with isolated context, and results injected back into the main session as they complete. The Halloween framing came naturally: if an unfamiliar codebase is a haunted house, then the audit is the exorcism—and every ghost needs a name, a location, and a citation.
What I learned The biggest lesson was that agentic engineering is not about autonomy. It is about accountability.
A subagent can investigate for thirty minutes and return a summary, but a summary is not evidence. If the audit report says “the anomaly originates in the payment-retry path,” that claim is worthless unless it cites the exact file, the exact line, and the exact log entry that supports it. So the core design rule became: every finding must carry a verifiable citation, or it does not leave the agent’s session. This is a small constraint with large consequences—it turns the audit from a pile of plausible assertions into a reviewable artifact.
I also learned how much Kiro’s Hooks matter for this kind of work. A hook can intercept a subagent’s output before it reaches the final report and reject any claim that lacks a citation or violates a schema. That is the difference between “trust the AI” and “the AI produces something you can trust without trusting it”. Specs played a similar role on the orchestration layer: each subagent’s responsibilities, inputs, outputs, and evidence requirements were written as a spec before any agent ran, so the workflow itself was spec-driven rather than improvised.
How I built it The system has four specialized subagents coordinated through Kiro Crew:
Log Whisperer — scans log streams for anomalies and clusters them by signature.
Data-flow Tracker — follows the code paths around each anomaly and produces a call-chain trace.
Citation Auditor — receives findings from the first two and attaches evidence (file, line, log timestamp) to every claim; findings without evidence are returned to the sender, not forwarded.
Exorcist — the coordinating agent that decomposes the audit goal, spawns subagents in parallel where the work is independent, and assembles the final report only after the Citation Auditor signs off.
The orchestration is declared as a Kiro Crew workflow. Subagents run with isolated context but full project memory injection, so they know the repository conventions without seeing each other’s in-progress work—which is exactly what prevents cross-contamination between investigation threads. A Kiro Hook fires on every subagent completion to validate the output against the citation schema. The UI is a “haunted audit room”: each subagent is a spirit, anomalies are poltergeists, and the final report is an exorcism record—but the report itself is deliberately unspooky and technical, because the tool has to be usable after Halloween.
Challenges I faced Concurrency without chaos. Kiro Crew auto-sizes concurrency based on machine resources (typically 3–32 subagents), and each has a 30-minute hard timeout with stall detection. Early on, I over-spawned and the Activity panel became a wall of running rows. The fix was workflow-level: only fan out when the work is independent, and let the coordinating agent decide when parallel work actually makes sense rather than spawning everything at once.
Evidence granularity. A subagent can return “the anomaly is in the retry handler,” but that is not a citation. I had to define an evidence format tight enough to be machine-validated by a hook—path:line-range plus a log timestamp—and loose enough that the subagent could still express uncertainty honestly. The Citation Auditor exists because this turned out to be harder than expected.
Making the Halloween skin not hurt the tool. The haunted-room metaphor is fun for a demo, but a review artifact cannot be a costume. The design rule I kept returning to was: when the costume and the tool conflict, the tool wins. The spirit icons live in the activity feed; the report stays plain, cited, and reviewable.
What’s next The natural next step is turning the exorcism report into a CI gate: a hook that rejects a merge if the audit finds an uncited high-severity anomaly in the changed paths. That would move the project from “audit after the fact” to “the audit is part of the gate”—the same shift from generation to accountability that made Kiro interesting to me in the first place.
Built With
- crew
- hooks
- kiro
- mcp
- mulit-agent
- specs