This is a submission for the Hacktoberfest Open-Source AI Challenge Week 4: Ghost in the Machine
What I Built
Split-Git is an atmospheric, local Git pre-commit hook that turns the routine code commit process into a theatrical interaction.
Inspired by iconic dissociative identity disorder (DID) and split-personality horror tropes in classic Indian cinema—specifically channeling legendary characters like Manjulika (Bhool Bhulaiyaa) and Chandramukhi (Rajmahal) — the system operates with dual states:
🟢 Normal State: Under typical conditions, your terminal remains a calm, functional developer workspace.
🔴 Haunted State: The moment sub-par, sloppy, or placeholder code is staged, an immediate identity switch occurs. The local AI shifts into an intense, theatrical spirit that takes over the terminal execution flow and refuses to let the commit pass until the code meets its standards.
📸 Demo & Screenshots
Here is how Split-Git behaves in action across both identity states inside the terminal:
🟢 Clean Commit (Allowed)
The spirit remains serene, approving your elegant refactor and permitting the Git flow to complete seamlessly.
🔴 Lazy Commit (Blocked)
A chaotic diff triggers a sudden persona shift. The spirit unleashes a dramatic monologue and exits with status code 1 to block the push.
💻 Code Repository
infiver11
/
split-git
A local Git pre-commit hook powered by Ollama and Gemma that traps an ancient theatrical spirit in your terminal to judge and block lazy code.
👻 Split-Git: The Haunted Terminal Guardian
Split-Git is a local Git pre-commit hook that traps an ancient theatrical spirit inside your .git folder. Whenever you stage code and try to commit, the hook intercepts your code diff, fires up a local open-weight model via Ollama, and judges your code with classic dramatic flair.
If your code is messy or lazy, the spirit wakes up, delivers a fierce theatrical monologue complaining about being trapped, and blocks your commit. If it's clean, you get a nod of approval.
🎃 The Theme: Ghost in the Machine & Cinematic Split Personalities
Built for the Hacktoberfest Open-Source AI Challenge, this project leans into the spooky season by treating your terminal as a haunted stage.
Inspired by iconic dissociative identity disorder and split-personality horror tropes in classic Indian cinema—like the dramatic shifts seen in Manjulika (Bhool Bhulaiyaa) or Chandramukhi (Rajmahal…
🛠️ How I Built It
- 🧠 Local Inference Engine: Powered by Google's Gemma 2B running entirely offline via Ollama.
- 🪝 Git Hook Infrastructure: A lightweight executable shell script located at .git/hooks/pre-commit that intercepts every local git commit invocation.
- 🌉 Python Bridge (ghost_judge.py): Uses standard library calls to read staged diffs via git diff --cached, streams the code context into Ollama's local HTTP endpoint (http://localhost:11434/api/generate), evaluates Gemma's decision, and enforces an exit status code (0 for approval, 1 for rejection).
🌐 Why Does Open Innovation Matter?
🔒 100% Privacy & Local Sovereignty: Staged code diffs never leave your machine. No sensitive enterprise logic or private APIs are ever transmitted to external cloud endpoints.
💰 Zero Ingress & API Costs: Running open-weight models locally means endless commit checks without incurring per-token cloud costs.
🎭 Unfiltered Persona Control: Proprietary cloud APIs often neutralize or refuse custom theatrical prompts. Running open-weight Gemma locally gives full creative freedom to construct intense persona guardrails without artificial cloud interference.
🔮 The Spirit of It
Anyone who has pulled a late-night debugging session knows the silence of a dark terminal screen. Split-Git breathes life into that blank space.
🏆 Prize Categories
- 🥇 Best Use of Gemma


Top comments (0)