DEV Community

Cover image for # ๐Ÿ‘ป The Code Remembers. Now You Can Ask Who Wrote It. ๐Ÿ’ปโœจ
Yashika Kumari Vishwakarma
Yashika Kumari Vishwakarma

Posted on

# ๐Ÿ‘ป The Code Remembers. Now You Can Ask Who Wrote It. ๐Ÿ’ปโœจ

Hacktoberfest Open-Source AI Challenge: Ghost in the Machine Submission ๐Ÿ‘ป๐ŸŒผ

What if you could have a conversation with the developer who wrote a piece of code five years ago โ€” even if they've long since left the project?

Every codebase has ghosts. ๐Ÿ‘ป

Not the scary kind.

I'm talking about developers who once spent nights fixing bugs, designing systems, writing clever workarounds, and leaving behind thousands of lines of code.

Eventually, they move on. ๐Ÿšถโ€โ™‚๏ธ

Their commits remain. Their reasoning gets buried. And someone new inherits a codebase full of decisions nobody remembers making.

Then I started thinking...

๐Ÿ’ก What if we could ask those developers about their work?

That question became LastWords.

Welcome to my submission for Hacktoberfest Open-Source AI Challenge โ€” Week 4: Ghost in the Machine! ๐ŸŽƒ
(https://dev.to/challenges/hacktoberfest-week4-2026-10-26)*


๐Ÿš€ What I Built

๐Ÿ‘ป LastWords

Talk to the contributors who built your codebase.

LastWords is a local-first AI tool that brings a codebase's contributor history into a conversation.

It identifies inactive contributors, retrieves their real Git commits, and uses an open-weight AI model to generate evidence-grounded answers in their first-person voice.

It has three main capabilities:

๐Ÿ”ฎ 1. Summon the Contributors

Point LastWords at a Git repository.

It analyzes the commit history, identifies inactive contributors, and calculates how many source-code lines they still maintain.

๐Ÿ’ฌ 2. Ask the Ghosts

Ever wondered why a developer implemented something in a particular way?

Now you can ask!

For example:

"Why was this function implemented this way?"

LastWords uses Git blame to identify the contributor responsible for the line, retrieves relevant commits, and asks Gemma to generate an answer based on that evidence.

Every response can include commit-hash references, allowing you to trace the answer back to the actual project history.

๐Ÿ•ฏ๏ธ 3. Build an Ofrenda

LastWords generates a Dรญa de los Muertos-inspired tribute website for contributors.

It displays their names, actual commit messages, and surviving source-line counts.

It's a digital tribute to the people whose work continues to live inside open-source software. ๐ŸŒผ

One important clarification: a "ghost" simply means a contributor who has not committed in a long time. It never implies that the person has passed away.


๐ŸŽฌ Demo Time!

๐ŸŒ Live Website (Vercel): https://lastwords-chi.vercel.app/

๐Ÿ’ป GitHub Repository:

https://github.com/Vishwakarma-Yashika/lastwords

The live website showcases the generated contributor ofrenda.

The interactive AI conversation runs locally through Python and Ollama.

โšก Try It Yourself

# ๐Ÿ”ฎ Summon contributors
python -m lastwords.cli summon ./path/to/repository

# ๐Ÿ’ฌ Ask a contributor about a particular line
python -m lastwords.cli ask ./path/to/repository \
  "Why was this implementation chosen?" \
  --file app.py --line 120

# ๐Ÿ•ฏ๏ธ Generate the ofrenda website
python -m lastwords.cli ofrenda ./path/to/repository \
  --top 6 --out site
Enter fullscreen mode Exit fullscreen mode

๐Ÿ› ๏ธ How I Built It

I wanted the AI to do more than imitate a developer's personality.

It needed to have actual evidence from the repository.

๐Ÿงฐ Technology Stack

Technology Purpose
๐Ÿ Python Core application and CLI
๐Ÿ”— GitPython Git history and blame analysis
๐Ÿง  Gemma 2B (gemma2:2b) Open-weight AI model
๐Ÿฆ™ Ollama Local model inference
๐ŸŽจ Jinja2 HTML template generation
๐Ÿ“Š Sentry Optional tracing and observability
โ–ฒ Vercel Public static website hosting

๐Ÿง  How the AI Works

When someone asks about a particular line of code, LastWords:

  1. ๐Ÿ” Uses Git blame to identify the contributor responsible for that line.
  2. ๐Ÿ“œ Retrieves the commit that introduced the line.
  3. ๐Ÿงฉ Searches the contributor's history for additional relevant commits.
  4. ๐Ÿ“ Constructs a context-grounded prompt from the retrieved evidence.
  5. ๐Ÿง  Sends that context to Gemma running locally through Ollama.
  6. โœ… Validates commit citations against the retrieved commit history.

The most important design decision:

Git history is the source of evidence. Gemma is the conversational layer.

If the available history doesn't contain an answer, LastWords can acknowledge that it doesn't remember rather than inventing a technical explanation.

๐ŸŒผ The Ofrenda

The ofrenda is deterministic by default.

Its contributor notes come from real commit messages, not fabricated AI biographies. This means the tribute website can be generated without requiring an AI model.

๐Ÿงช Testing and Reliability

I didn't want this to remain just a concept or a pretty interface.

The project includes automated tests covering:

  • Git history and contributor analysis
  • Commit retrieval and citation validation
  • Unicode contributor names
  • Error handling
  • Tracing and privacy safeguards
  • HTML escaping
  • Reproducible website generation

๐ŸŽฏ Final test result: 68 tests passed!


๐ŸŒ Why Does Open Innovation Matter?

For LastWords, open innovation is not just about choosing an open model. It directly shapes the architecture.

A Git repository can contain private source code, internal implementation details, and sensitive development history.

I wanted developers to explore that history without sending repository context to a hosted AI inference API.

That's why LastWords uses Gemma through Ollama.

๐Ÿ–ฅ๏ธ The model runs locally, and the repository context used for inference stays on the developer's machine.

Open-weight AI makes this possible:

  • ๐Ÿ” Privacy: Repository context is not sent to a hosted AI inference API.
  • ๐ŸŽ›๏ธ Control: Developers can choose and run their own local model.
  • ๐Ÿ’ธ Accessibility: The core workflow does not require a paid AI API subscription.
  • ๐Ÿ”„ Flexibility: Developers can experiment with different models.
  • ๐ŸŒฑ Independence: The application isn't dependent on a single closed AI provider.

Open innovation gave me the freedom to build something privacy-conscious, customizable, and accessible.


๐Ÿค– My Agent Session

I used Claude Code as my development assistant throughout the project.

My workflow included:

  • ๐Ÿ” Architecture auditing
  • ๐Ÿ—๏ธ Incremental implementation
  • ๐Ÿงช Automated testing
  • ๐Ÿ›ก๏ธ Security and privacy reviews
  • ๐Ÿ“ฆ Release preparation

The important part wasn't simply generating code. It was repeatedly reviewing the implementation, testing edge cases, improving retrieval quality, and ensuring AI-generated responses remained grounded in actual commits.


๐Ÿ•ฏ๏ธ The Spirit of It

There is something strangely beautiful about an old Git repository.

You might find a commit from 2015 that fixed a tiny bug. A refactor that nobody remembers. A developer who spent hours solving a problem that would otherwise have disappeared into history.

Years later, another developer opens that file and wonders:

"Why did they do it this way?"

The code cannot answer everything.

But it can preserve traces of the person who wrote it.

I built LastWords because I believe open-source software is more than code.

It is a collection of human decisions, experiments, mistakes, ideas, and contributions.

The developers may move on.

Their code remains.

And now, you can ask it a question. ๐Ÿ‘ปโค๏ธ


๐Ÿ† Prize Category

๐Ÿง  Best Use of Gemma

Gemma 2B powers LastWords' evidence-grounded contributor conversations through local Ollama inference.


โœจ Built with curiosity, open-source technology, and a little bit of ghostly inspiration.

Hacktoberfest Open-Source AI Challenge โ€” Week 4: Ghost in the Machine

hf26challenge #hacktoberfest #opensource #AI #Gemma #Ollama #Python #DevChallenge #OpenSourceAI

Top comments (0)