You vibe coded it. Now own it.
Ghost Run runs your wrong idea beside your real code. When your wrong idea is what you meant, it files the bug.
- Built in Kiro in under 23 hours: 5 specs, 161 requirements, 984 acceptance criteria, 352 finished tasks and 842 passing tests.
- No AI model grades anything. Every grade comes from running the real code in a sandbox in your browser tab.
- Resurrection: it brings back BUGGY's 1978 idea: a student's wrong answers come from a small program you can run.
Inspiration and the problem
I started vibe coding a lot for my personal projects. The code worked. I couldn't always tell you why. That gap followed me into hackathons. At MadHacks in November, an hour before judging, I was still asking some of my teammates what parts of my own demo did. We placed 4th. Now I want to learn the core and know what every part of my code does.
I'm not the only one. "Vibe coding" was Collins Dictionary's Word of the Year for 2025 (Euronews). By September 2026, more than 40 percent of pull requests on GitHub started with an agent's first draft, up from 17 percent in March (GitHub Octoverse). Writing code isn't understanding it. In one course, 27 percent of 291 students missed at least one simple question about code they had just written (ITiCSE 2023).
Then someone asks what one function returns. An interviewer, a professor, your team lead or a judge. That's the moment vibe coding can't help you with.
The usual fixes miss it. Some quiz tools ask a model for the answer key and never run the code. A red X tells you that you were wrong. It never tells you which idea in your head was wrong.
In 1978 John Seely Brown and Richard Burton built BUGGY and showed the idea this project stands on: a student's wrong answers aren't random. They come from a procedure, a small program you can run. A child who subtracts the smaller digit from the larger in every column gets 125 for 143 minus 28. Every time.
A wrong idea about code works the same way. "sort() compares numbers" is one changed line. Write the wrong idea as code and you can run it, race it and prove it. BUGGY stayed in research papers for 48 years. Ghost Run brings it back for the code AI writes for us.
What it does

You pick a function from a TypeScript project and predict what it returns for a real input. Ghost Run runs the function in a sandbox inside your browser tab and grades you against what the code really returns.
When two of your wrong answers share one wrong idea, that idea becomes your ghost: the same function with one changed line. Like the ghost car in a racing game, it races the real code, drawn faint beside it. A badge marks the line where they split. Every ghost is proven before you see it: two inputs where it and the real code both return and disagree.
Then one question: Which one did you mean?
- "The code's answer." You held a wrong idea. Beat your ghost on two new inputs and the banner says "Ghost beaten".
- "My ghost's answer." The code holds your wrong idea too. That happens more than you'd think: code models wrote known one-line bugs up to twice as often as the correct line (MSR 2023). Ghost Run writes a failing test from your answers plus a bug report in Kiro's own Bugfix format. That's the flip.
The flip on the demo's planted leaderboard. topScores runs scores.sort().reverse(). My ghost and I both said [10, 9, 2]. The code said [9, 2, 10], because JavaScript sorts numbers as text. I meant highest first. I picked "My ghost's answer". Two lines from the handoff:
WHEN topScores gets [10, 9, 2] THEN the system returns [9, 2, 10].
WHEN topScores gets [10, 9, 2] THEN the system SHALL return [10, 9, 2].
It has the same two lines for [100, 25, 3] and a "SHALL CONTINUE TO" line for every input the fix must leave alone. My ghost's one line change already passes every row. The file is ready for a Kiro bugfix spec.
Two more pieces:
- Expose a planted bug. A copy of a function hides one change. Find the input that exposes it. In one run the planter turned
< 2into<= 2insidelistJoin. Two items catch it: the code says "a and b" and the copy says "ab". - The brief. What you got right, each line linked to the run that proves it. No score.
Two rooms to try

| The 1978 room | CrossCheck |
|---|---|
| Two old subtraction mistakes compete to be your ghost. For 143 minus 28 both say 125. For 52 minus 17 both say 45. So Ghost Run asks 400 minus 1, where they split: 401 or 409. | An app I built in October, used as the example repo: a ghost on each Start here function, a race on its planted leaderboard and a planted bug to expose. |
What you get
- A real sandbox in your tab. QuickJS compiled to WebAssembly, inside a Web Worker. Each run gets a fresh context, a 2 second deadline, 64 MB of memory and a 96 KB stack. No network, files, timers or DOM. The clock is frozen and Math.random is seeded: the same answer grades the same way every time.
- An analyzer for real repos. The TypeScript compiler API parses every file, follows calls across files and marks each function "run" or "read" with a plain reason. esbuild packs each runnable function with a stand-in for every package that throws only if called. On CrossCheck it found 424 top level functions. 155 of them can run.
- Ghosts that are proven, not guessed. Six rules for common wrong ideas, such as "sort() compares numbers", plus two for the 1978 room. Each ghost must earn two witnesses. When the usual inputs fall short, fast-check draws 200 more. On CrossCheck 11 ghosts earned their witnesses and 28 were dropped.
- A fit and a picker. A ghost is named only when it matches two of your wrong answers, with one slip allowed. The next question is the input that splits the ideas still in play most evenly, the same split measure decision trees use.
- Local mode for your own project.
npm run local -- <your project folder>serves it at localhost:4317, on your machine only. Writes need the X-Ghost-Run header and land only in tests/ghost-run and .ghost-run. - Proof you can run. 842 passing tests, including 61 fast-check property checks in 22 test files.
How I used Kiro
Kiro wrote Ghost Run's code. I drove it with five specs, four steering files and one hook. Every number below comes from the repo.
| Kiro feature | How I used it | Why it mattered |
|---|---|---|
| Spec-driven development | Five Requirements-First specs, one per slice: run-and-grade, ghosts-and-mirror, local-mode-and-flip, mock-defense-and-brief and website-and-deploy. Together: 161 requirements, 984 acceptance criteria and 352 finished tasks | Every grader rule (NaN, -0, key order, array holes) became a requirement with its own test before any code existed |
| Analyze Requirements | Run before design on the first three specs. On the first it raised 12 questions, each answered in requirements.md | Gaps surfaced while they were still cheap to fix |
| Run all Tasks | Four of the five specs each ran as one Run all Tasks: 280 tasks in about 400 minutes | Kiro built one slice while I wrote the next spec in a second window |
| Steering | product, tech, structure and quality, always on. product.md opens its rules with "No model grades anything." | The one rule that never bends reached every request |
| Agent hook: engine guard | A PreToolUse hook on writes runs node tools/engine-guard.ts. It blocks any network call, web address or outside package in src/engine with exit code 2 |
The grader can't call out. It blocked 2 of 2 tries in my first test |
| Property-based testing | Property tasks made required: 61 fast-check checks in 22 test files | One found a real bug in Node 24's JSON.parse, already reported as nodejs/node#66916. decode now reads JSON itself |
| Bugfix specs | "My ghost's answer" writes its handoff in the three sections of Kiro's Bugfix form: Current, Expected and Unchanged Behavior | Your answer becomes the requirement a fix must meet |
| Sandbox settings | .kiro/settings/sandbox.json | Kiro's own commands reach only the hosts installs need |
| Vibe coding | Kiro chat for the setup, the guard script and small fixes | Fast where a spec would be overkill |
Tested before claimed. My first hook never ran. The folder wasn't trusted yet and Kiro had made its edits with sed in the terminal, which hooks can't see. Before claiming any hook I checked two things on a real install. File hooks fire only on Kiro's own edits. A PreToolUse hook blocks with exit code 2. The lesson went into tech.md: edit files only with file tools, because hooks see only file tool edits.
Instant setup
Needs Node 24 or later and a browser. No accounts and no API keys.
git clone https://github.com/anandindukuri-hub/ghost-run.git
cd ghost-run
npm install
# The website with both rooms, then open http://localhost:5173
npm run dev
# Your own TypeScript project, then open http://localhost:4317
npm run local -- ../your-project
# Check the claims yourself
npm test # 842 tests
npm run demo:network # fetch inside the sandbox gets a ReferenceError
npm run demo:loop # an endless loop stops after 2 seconds
On the home page press Race this ghost yourself or start with the 1978 room. The specs, the steering files and the hook all live in the repo's .kiro folder. The README pairs every claim with a way to check it.
Challenges I ran into
- My first hook never ran. The cause is above. The fix became a steering rule.
- Run all Tasks skipped my checkpoint once. It marked task 11 done without stopping for my hand check. I ran those checks in the app afterward and they passed.
- Kiro's sandbox can't open a port. 17 server tests fail inside Kiro and 16 skip. I run them in Terminal instead: 842 of 842 pass on my Mac.
- A test that failed at random. The server answered a 1 MB upload with 413 and closed the connection while the test was still sending. Sometimes the reset won the race. Kiro changed the test to send only the size header: 10 of 10 runs passed.
- A fault no test caught. In the 1978 room one button was a 44 px pill holding two lines. The second line was grey on white at 2.4:1 contrast. I found it by eye. Kiro's fix took it to 8.4:1 and a test now checks the height and the color.
- I cut to ship. I planned a full mock defense, a set of questions about your own code. It became one planted bug screen. It's smaller and it's real.
What I learned
- The spec is where the thinking happens. One rule from spec 2 shaped the whole product: a ghost is named only when it fits at least two of the student's wrong answers. One wrong answer is a slip. Two that a single wrong rule explains are an idea.
- Properties find what examples miss. I'd never have written a test for an escaped one character key. A round trip property found that bug in Node itself.
- Test the tool before you trust it. Hooks, Run all Tasks and Kiro's sandbox each surprised me once. That's why the README pairs every claim with a way to check it.
- My own eyes still count. The contrast fault passed every layout test.
Why it matters
More of us will explain code we didn't type: students learning with AI, juniors in their first code review, anyone in an interview. Ghost Run trains the one skill AI can't do for you, knowing what your own code does. And when the code is wrong instead of you, you leave with a failing test, not a hunch.
It's built on study methods with strong evidence. In a review of 10 study techniques, practice testing was one of only two rated high (Dunlosky et al. 2013). In a physics class, students who predicted first understood more, while just watching added nothing (Crouch et al. 2004). Across 44 comparisons, texts that named a wrong idea and corrected it taught more than the same facts alone (Schroeder and Kucera 2022).
One honest limit: in high school algebra, teaching aimed at a diagnosed wrong rule was not clearly better than plain reteaching (Sleeman et al. 1989). That's why Ghost Run doesn't stop at naming your ghost. You race it, beat it or turn it into a test.
What's next
Today Ghost Run runs pure TypeScript and JavaScript functions with number, string, boolean and array inputs. Next:
- a box to type your own input
- stand-ins for network and AI calls, to let more functions run
- more ghost rules plus a ghost writer agent for wrong ideas no rule covers
- any public repo on the website, not only the two rooms
- a Kiro power whose MCP server answers by running code
- Python
Credit. BUGGY: Brown and Burton (1978). The 1978 room's second ghost, "borrow without decrement", comes from Brown and VanLehn's 1980 bug catalogue. CrossCheck is an app I built in October. Its leaderboard and guest counter are planted for the demo and labeled everywhere they show.
Built With
- css
- esbuild
- fast-check
- git
- github
- html
- javascript
- kiro
- node.js
- oxlint
- property-based-testing
- quickjs
- quickjs-emscripten
- react
- typescript
- typescript-compiler-api
- vite
- vitest
- web-workers
- webassembly