DEV Community

Cover image for RepoSeance: Resurrecting Dead Code with Local Open-Weight AI
Samar Shetye
Samar Shetye

Posted on

RepoSeance: Resurrecting Dead Code with Local Open-Weight AI

Hacktoberfest Open-Source AI Challenge: Ghost in the Machine Submission 👻🌼

This is a submission for the Hacktoberfest Open-Source AI Challenge Week 4: Ghost in the Machine

What I Built

Every software engineer inherits a codebase that feels haunted.

You clone an archived repository or checkout an unfamiliar branch, and you are immediately greeted by the restless spirits of past developers: cryptic // TODO: fix this before Friday comments written five years ago, half-implemented refactors abandoned mid-stride, and git commit messages like "wip: it works on my machine".

Usually, the institutional knowledge died when the original authors left the company or archived the repository.

RepoSeance is an open-source, local-first software archaeology tool. Rather than treating legacy or abandoned repositories as landfill, RepoSeance conducts a digital séance over your git history. It reconstructs project chronology, indexes unmerged branch inflection points, scans for orphaned TODO/FIXME markers, and summons an interactive, evidence-grounded AI assistant powered completely offline by Google's open-weight Gemma 2 model.

Ask RepoSeance why a module was rewritten, what features were abandoned, or where the riskiest architectural debt lies—and it will answer you with verified citations linking to exact commit SHAs, line numbers, and author timestamps.


Demo

Youtube Demo Video:

Screenshots Walkthrough

1. Minimalist Landing Page

2. Repository Overview & Health Telemetry

3. Grounded Chat & Side Evidence Drawer

4. Ghost Timeline & Milestone Inflection Points

5. Issues & Marker Archaeology

6. Automated Resurrection Report & Feasibility Codex


Code

Github Repository

GitHub logo Samar-365 / RepoSeance

The RepoSeance is an AI-powered software archaeology tool designed to help developers understand abandoned, archived, or unfamiliar GitHub repositories.

RepoSeance Banner

RepoSeance

AI-Powered Software Archaeology & Codebase Resurrection

Hackathon: Hacktoberfest 2026 — Ghost in the Machine
Oracle AI: Google Gemma 2 (Local Inference via Ollama)
Tech Stack: Python, Flask, React, Vite, SQLite (FTS5), GitPython


Overview

RepoSeance is an AI-powered software archaeology tool designed to explore, understand, and revive abandoned, archived, or unfamiliar codebases.

Rather than treating legacy code as disposable, RepoSeance reconstructs a project's development history from its Git commits, source code markers (TODO, FIXME, HACK), unresolved issues, and pull requests. Users interact with a conversational AI assistant that adopts the persona of the Repository Ghost — providing evidence-grounded answers about past architectural decisions, recurring bugs, and unfinished ambitions without hallucinating.


Key Capabilities

  • 100% Local Inference & Privacy: In local mode, source code and Git metadata never leave your computer. Queries are answered locally using open-weight Gemma 2 models.
  • Strict Evidence Grounding: Every claim made…

How I Built It

RepoSeance is built around a 100% open-source, offline AI stack:

Frontend: React 19 + Vite (Minimalist Dark Theme & Bespoke SVG Visuals)
        │
        â–¼ (REST API)
Backend: Flask Application (Python 3.11)
        │
        ├── Ingestion: GitPython (commit churn, reflog & branch analysis)
        ├── AST Parser: Source scanner for TODO / FIXME / HACK markers
        ├── Storage: SQLite with FTS5 (BM25 full-text search index)
        └── Local AI Engine: Ollama running open-weight Gemma 2:2b
Enter fullscreen mode Exit fullscreen mode

The Grounding Pipeline

When a user asks: "What was the last major change?", RepoSeance does not blindly prompt an LLM:

  1. Local Retrieval: It executes a BM25 ranked search across SQLite FTS5 commit tables, commit messages, file diffs, and issue logs.
  2. Context Assembly: The top surviving records are injected into a structured grounding prompt.
  3. Local Inference: Gemma 2 (gemma2:2b) processes the grounded context via Ollama with strict system instructions to cite only surviving artifacts.
  4. Citation Extraction: The backend parses commit SHAs and file paths from Gemma's output and renders clickable inspector pills in the frontend.

Why Does Open Innovation Matter?

Open-source and open-weight AI weren't just nice-to-haves for this project—they were the foundational prerequisite. Here is why open innovation made RepoSeance possible where closed APIs fall short:

1. Proprietary Codebases Never Leave Your Machine

Most production repositories contain proprietary business logic, sensitive internal architecture, or compliance-restricted code. Sending your entire git log and diff history to third-party cloud APIs is an immediate security dealbreaker for most engineering teams. Because Gemma 2 runs entirely locally via Ollama, zero bytes of code or prompt context ever leave your laptop.

2. Works With the Lights (and the Internet) Off

Software archaeology often happens on airplanes, in server rooms with air-gapped networks, or during outages. RepoSeance has zero external cloud dependencies. You can clone an archived repo into a cabin in the woods with no Wi-Fi, run reposeance, and interrogate years of engineering history seamlessly.

3. Longevity & Zero Marginal Cost

Closed AI services deprecate endpoints, change rate limits, and charge per million tokens. Running a deep audit over a 10,000-commit repository on a metered cloud API could cost tens of dollars per run. With local open-weight Gemma, you can re-index and query codebases indefinitely for $0.00.


My Agent Session

Building RepoSeance: Local Software Archaeology with Gemma 2
You

I want to build an open-source AI project for the Hacktoberfest 'Ghost in the Machine' challenge called RepoSeance. It should be a software archaeology tool that resuscitates abandoned or legacy codebases by interrogating Git commit history, code markers (TODO/FIXME), and unmerged branches using local open-weight AI (Google Gemma 2) with strict evidence citations.

Agent

Architecting RepoSeance with local-first, privacy-preserving software archaeology:
1. Backend: Flask with GitPython to traverse commit graphs, detect high-churn inflection points, and unmerged branch divergences.
2. Code Scanner: AST & regex parser for TODO, FIXME, HACK, and DEPRECATED markers categorized by severity.
3. Storage: SQLite with FTS5 BM25 full-text search indexing commit messages and file diffs.
4. AI Inference: Local Ollama runtime with Google's open-weight Gemma 2 (gemma2:2b) model.
5. Evidence Grounding: Cross-referencing queries with SQLite FTS5 search to cite exact commit SHAs and line numbers without hallucinating.

You

Build the frontend with React 19 and Vite. Make it minimalist, clean, non-gothic with subtle theme line-art visuals, an interactive commit timeline, TODO audit vault, grounded chat with citation drawer, and resurrection report exporter.

Agent

Created modern minimalist interface:
1. Landing View: Hero with minimalist ghost vector and quick repository presets.
2. Grounded Chat: Interactive chat with Gemma 2 citing verified commit SHAs, author timestamps, and diff excerpts.
3. Ghost Timeline: Chronological graph tracking major refactors, milestones, and abandoned branches.
4. Issues & Markers: Excavation audit cataloging TODO/FIXME markers by severity and commit age.
5. Resurrection Report: Automated Markdown report synthesis with feasibility score and revival checklist.

You

Run end-to-end integration tests to verify the SQLite FTS5 search, Ollama Gemma 2 citation grounding, and repository analysis pipeline.

Agent

Executed 10-step end-to-end integration test suite:
- Health check: OK (Ollama connected with gemma2:2b)
- Repository ingestion: OK (Analyzed commits, authors, and file markers)
- FTS5 BM25 search: OK (Matched historical terms and commit SHAs)
- Chat grounding: OK (Responses cite surviving records without hallucinating)
- Resurrection report: OK (Markdown audit and feasibility metrics generated)

Full session transcript published with DevRelay: View Agent Session


The Spirit of It

In Mexican tradition, Día de los Muertos is not a day of mourning, but an act of remembrance—a belief that someone only truly disappears when their stories are no longer told.

Software development has an unfortunate habit of treating past code with cynicism. We scoff at legacy systems, call older code "spaghetti", and rewrite systems from scratch without understanding the hard-learned lessons that shaped them.

RepoSeance was built to honor the past. It gives voice to the developers who wrote code at 2 AM five years ago to keep a service alive, preserves their context, and treats their unfinished ambitions with respect. It turns a graveyard of dead commits into an ofrenda of engineering wisdom.


Prize Categories

  • Featured Category: Best Use of Gemma ($200): Powered locally by Google's open-weight gemma2:2b model for grounding, architectural Q&A, and resurrection report synthesis.
  • Partner Category: Best Use of Entire ($100): Full agent session transcript published and embedded via DevRelay ({% agent_session 1320 %}).
  • Top Prize: Complete submission for Hacktoberfest Week 4 Ghost in the Machine.

Top comments (0)