{"slug": "repo-seance-summoning-the-ghosts-of-git-history-with-local-ai", "title": "Repo Séance: Summoning the Ghosts of Git History with Local AI 👻", "summary": "A developer built Repo Séance, an open-source command-line tool that mines a Git repository's forgotten history—deleted files, stale branches, unfinished TODOs and suspicious commit messages—and narrates it through locally running open-weight models via Ollama. The tool runs Qwen 2.5 3B or Llama 3.2 3B in three modes (haunt, ofrenda, exorcise) and adds a rule-based grounding verifier that checks generated claims about dates, commit hashes and merge status against extracted Git facts, regenerating flagged responses or falling back to a predefined fact-consistent output. The project has no third-party Python runtime dependencies and requires only Python 3.9+, Git and Ollama.", "body_md": "*This is a submission for the [Hacktoberfest Open-Source AI Challenge Week 4: Ghost in the Machine](https://dev.to/challenges/hacktoberfest-week4-2026-10-26)*\n\nWhat happens to all the code we leave behind?\n\nThe branches nobody merges. The files we delete. The TODOs we promise to revisit. The commits whose messages make us question our past decisions.\n\nThey disappear from our daily workflow, but their history remains.\n\nFor this challenge, I built **Repo Séance** 👻 — a local AI-powered command-line tool that summons the ghosts of your Git repository and gives them a voice.\n\nIt explores forgotten Git history and identifies:\n\nInstead of simply displaying Git metadata, Repo Séance uses locally running open-weight models to turn these findings into contextual narratives.\n\nIt has three modes:\n\n`DELETE`, `KEEP` or `INVESTIGATE` recommendations for stale branches and old TODOs, with optional grounding verification.\nThe idea was to make repository archaeology feel a little more human.\n\nHere's Repo Séance in action!\n\n*A sped-up preview of all three modes, running locally through Ollama with Qwen 2.5 3B.*\n\n**Full video demonstration:** [Watch Repo Séance](https://drive.google.com/file/d/1rpNZSJbMA6R2OspKVyAzC9m_SgnKWGBa/view?usp=sharing)\n\nBoth repositories are public:\n\n**Main project:** [Aarya0706/repo-seance](https://github.com/Aarya0706/repo-seance)\n\n**Supporting experiments:** [Aarya0706/seance-local-llm-benchmark](https://github.com/Aarya0706/seance-local-llm-benchmark)\n\nThe benchmark repository includes the experiment methodology, preliminary results and all four saved model outputs.\n\nYou only need Python 3.9+, Git and [Ollama](https://ollama.com).\n\n```\ngit clone https://github.com/Aarya0706/repo-seance.git\ncd repo-seance\nollama pull qwen2.5:3b\n\n# generate a deliberately haunted sample repo, then summon its ghosts\npython -m seance.demo ./haunted\npython -m seance ./haunted\n```\n\nSwitch modes with `--mode haunt`, `--mode ofrenda` or `--mode exorcise`, and add `--verify` to enable grounding checks.\n\nI wanted the open-source AI component to be central to the application, rather than an optional feature added on top.\n\nThe architecture follows a lightweight pipeline:\n\n**1. Git History Extraction**\n\nPython invokes Git commands such as `git log`, `git for-each-ref`, `git grep` and `git blame` to identify deleted files, stale branches, unfinished TODOs and suspicious commit messages.\n\n**2. Structured Ghost Records**\n\nEach finding is converted into a structured `Ghost` record containing information such as its type, name, author, date, last-known commit message and relevant Git details.\n\n**3. Local AI Narration**\n\nThe structured findings are passed to a locally running open-weight language model through Ollama's `/api/generate` endpoint.\n\nI experimented with two models:\n\n`qwen2.5:3b`)` llama3.2:3b`)\nThe selected mode determines the prompt and storytelling style.\n\n**4. Grounding Verification**\n\nOne challenge I encountered was that small language models can generate convincing but incorrect historical details.\n\nThey might invent dates, durations, commit hashes or even incorrectly describe a branch's merge status.\n\nTo address this, I implemented a separate Python-based grounding verification layer.\n\nIt checks generated descriptions against the facts extracted from Git, including numerical claims, dates, commit hashes, merge status and unsupported contributor references.\n\nWith `--verify`, flagged responses can be regenerated up to a configurable retry limit. If contradictions remain, the application falls back to a predefined, fact-consistent whisper.\n\nThe verifier is rule-based and uses regular expressions. It catches specific, checkable contradictions but cannot guarantee complete factual correctness.\n\n**5. Terminal Rendering**\n\nFinally, the findings and generated narratives are displayed through a themed terminal interface, with different visual styles for each mode.\n\nThe application has no third-party Python runtime dependencies and uses Python's standard library alongside Git and Ollama.\n\nThis is probably the most important part of the project for me.\n\nI didn't want repository analysis to require sending someone's development history to an external AI service.\n\nUsing locally running open-weight models made several things possible.\n\n**1. Privacy**\n\nGit history can contain internal implementation details, contributor activity and development decisions.\n\nWith the default local Ollama endpoint, repository findings and prompts stay on the developer's machine instead of being sent to a third-party inference server.\n\n**2. Offline Inference**\n\nOnce Ollama and the required model weights are installed, Repo Séance can run without an internet connection.\n\nThe initial installation and model download require internet access, but normal local inference does not.\n\n**3. Model Freedom**\n\nI can switch between models using a single command-line argument, without redesigning the application.\n\n```\npython -m seance . --model qwen2.5:3b\n\npython -m seance . --model llama3.2:3b\n```\n\nThis allowed me to experiment with different models, compare their storytelling styles and investigate their factual consistency.\n\n**4. Cost Control**\n\nLocal inference eliminates per-request cloud API charges, making repeated experiments and benchmarking possible without paying for every generation.\n\n**5. More Control Over Experimentation**\n\nI could inspect model outputs, experiment with prompts, compare generations and build a separate verification mechanism around the model's responses.\n\nI also created a separate benchmark repository to compare Qwen 2.5 3B and Llama 3.2 3B.\n\nIn three runs on a synthetic haunted repository:\n\n| Model | Mean total runtime | \n|---|---|\n| Qwen 2.5 3B | 50.93 seconds | \n| Llama 3.2 3B | 78.50 seconds | \n\nQwen had approximately **35.1% lower mean wall-clock runtime** in this experiment.\n\nA second comparison on MediAgent AI showed approximately 34.3% lower runtime for Qwen, but that experiment used only one run per model.\n\nThese are preliminary total application runtimes, not isolated model-inference measurements.\n\nInterestingly, both models also produced factual inconsistencies in selected examples. Faster generation did not necessarily mean more reliable storytelling.\n\nThat reinforced one of my biggest learnings: **a convincing AI-generated story is not necessarily an accurate one.**\n\nThe complete methodology, observations and saved outputs are available in the [benchmark repository](https://github.com/Aarya0706/seance-local-llm-benchmark).\n\nOpen-weight models made it possible to build something private by default, adaptable and independently testable.\n\nThere is something interesting about a Git repository.\n\nEvery deleted file was once considered useful.\n\nEvery abandoned branch started with an idea.\n\nEvery TODO was a promise someone made to their future self.\n\nWe usually look at the current state of a codebase and forget the experiments, mistakes and decisions that brought it there.\n\nRepo Séance is my little attempt to bring that forgotten history back to life.\n\nI started this as a spooky interpretation of the challenge, but it became an interesting exploration of local AI, open-weight models, privacy and factual grounding.\n\nAnd perhaps, when you run it on your own repository, one of those ghosts will sound a little too familiar.\n\n**Some code never really rests. It just waits to be summoned.** 👻\n\nBuilt with Python, Git, Ollama, Qwen 2.5 3B and Llama 3.2 3B.\n\nThanks for checking out Repo Séance!", "url": "https://wpnews.pro/news/repo-seance-summoning-the-ghosts-of-git-history-with-local-ai", "canonical_source": "https://dev.to/aarya0706/repo-seance-summoning-the-ghosts-of-git-history-with-local-ai-58ki", "published_at": "2026-10-30 09:48:04+00:00", "updated_at": "2026-10-30 09:49:30.064331+00:00", "lang": "en", "topics": ["ai-tools", "large-language-models", "developer-tools", "ai-agents"], "entities": ["Repo Séance", "Ollama", "Qwen 2.5 3B", "Llama 3.2 3B", "Git", "Aarya0706", "GitHub"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/repo-seance-summoning-the-ghosts-of-git-history-with-local-ai", "markdown": "https://wpnews.pro/news/repo-seance-summoning-the-ghosts-of-git-history-with-local-ai.md", "text": "https://wpnews.pro/news/repo-seance-summoning-the-ghosts-of-git-history-with-local-ai.txt", "jsonld": "https://wpnews.pro/news/repo-seance-summoning-the-ghosts-of-git-history-with-local-ai.jsonld"}}