A CLI tool that fixes your code by making AI agents argue with each other until they agree on a solution. It's like an automated Senior Engineer in your terminal.
This is a pure vibe coded project. I didn't write a spec document or draw UML diagrams. I just started typing because the current state of "AI Code Repair" tools didn't sit right with me.
Most tools right now fall into two buckets:
- Too Simple: They take an error, pass it to GPT-4, and apply the first
try/exceptblock it spits out. This is "lazy coding" and usually breaks the logic. - Too Complex: Full-blown autonomous agents that take 5 minutes to run, cost $2 per execution, and require a Docker container.
I wanted the sweet spot. Fast & context-aware.
This project is actually a fusion of three previous projects I built, which were all cool but isolated:
- Orion: An SRE "Detective" that analyzed stack traces. It was great at finding what broke, but bad at fixing it.
- Maven: A git analytics tool. It knew who wrote the code and if the file was "high risk" (high churn), but it couldn't actually read or fix bugs.
- LLM Court: A fun experiment inspired by Andrej Karpathy's LLM Council where I made several LLMs debate code changes.
The problem was I was the middleware. I found myself running a script, copying the error to Orion, checking Maven for context, and then pasting it all into LLM Court. It was manual and annoying.
So I smashed them together into a single binary called Ghost.
When you run ghost run python app.py, Ghost sits in the background. If your app crashes, Ghost wakes up and runs a pipeline:
- Orion parses the traceback. It doesn't just read the error; it uses a "Tree of Thoughts" approach to hypothesize why it happened.
- Maven checks the git history. It tells the repair agent: "Hey, Rudra wrote this 3 months ago, and this file changes constantly. Be careful."
- The Court Council convenes.
- Defense: Proposes a fix.
- Prosecutor: Critiques the fix against The Ghost Laws (e.g., "You can't just delete the code to fix the error!").(P.S, I spent a lot of time on this issue)
- Judge: Synthesizes the arguments, takes the final judgement & writes the final code.
This is the cool part. I noticed LLMs are very lazy if you give them the same error again. If they see a ZeroDivisionError, they just delete the math and return 0. To stop this, I wrote a strict "Constitution" (prompt) that the agents must follow.
- Law of Preservation: You must preserve the original intent. Fixing the crash is not enough; the logic must survive.
- Law of Integrity: No
passblocks. No placeholders.
Install it directly from GitHub:
uv tool install git+https://github.com/rudra-swnt-12/ghost-cli.gitThen, just wrap your command:
ghost run python broken_code.pyIf it crashes, Ghost fixes it, shows you a diff, and applies it. Then you can even let it write the commit message:
ghost commitBuilt with Python, Typer (CLI), Rich (pretty logs), and powered by Groq (because I need the debate to happen fast).
Feel free to add new features to this project
Enjoy.