whatisgithub

What is backstory?

arpitkath/backstory — explained in plain English

Analysis updated 2026-05-18

10PythonAudience · developerComplexity · 2/5LicenseSetup · easy

In one sentence

A local command line tool that records why an AI coding assistant made its decisions, linking that reasoning to Git commits so you can look up the story behind any commit, file, or line later.

Mindmap

mindmap
  root((backstory))
    What it does
      Records AI reasoning
      Links to Git commits
      Warns on contradictions
    Tech stack
      Python
      Git
      Claude Code hook
    Use cases
      Explain past commits
      Catch reversed decisions
      Local private history
    Audience
      Developers using AI agents
    Setup
      pip install
      backstory init
      Works with Claude Code

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Look up why an AI coding assistant made a specific change days or weeks after the commit.

USE CASE 2

Get warned before merging a change that contradicts an earlier recorded decision.

USE CASE 3

Keep a local, private record of AI coding session reasoning without sending data to the cloud.

What is it built with?

PythonGitClaude CodePyPI

How does it compare?

arpitkath/backstoryaarav90-cpu/fetchitadammartinez271828/x4-analysis
Stars101010
LanguagePythonPythonPython
Setup difficultyeasyeasyeasy
Complexity2/52/52/5
Audiencedeveloperdevelopergeneral

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min

Install with pip install backstory-cli, then run backstory init inside your repo, works automatically with Claude Code.

MIT license: free to use, modify, and distribute for any purpose, including commercial use, as long as you keep the copyright notice.

So what is it?

Backstory is a command line tool that keeps a record of why an AI coding assistant made the decisions it made, not just what code it changed. Regular version control like Git shows you the final code and a short commit message, but it does not explain what alternatives the AI considered or rejected, or which past decision a new change might undo. The tool connects to Claude Code, a coding assistant, through a hook that runs automatically when a coding session ends. It copies the conversation transcript, then extracts the lasting decisions, risks, and files that were touched, and throws away the raw conversation itself. That extracted information is linked to the specific Git commit it relates to, so later you can ask why a particular commit, file, or even a single line of code exists, and get back the reasoning that led to it. One of its stronger features is contradiction detection. When a new code change looks like it reverses an earlier recorded decision, Backstory warns you before the change is merged, turning the stored history into something closer to a safety check rather than just an archive nobody reads. Everything runs locally on your own machine. Nothing is sent to a cloud service, no usage data is collected, and the raw AI conversation is never kept, only the extracted summary. It also scans for and removes API keys or other secrets before saving anything. Installing it takes one command through Python's package installer, then a setup command inside the project you want to track. Right now it works automatically with Claude Code, with support for other coding assistants like Cursor and Codex listed as planned. The stored information is saved as readable markdown files inside a hidden folder in your project, so it stays with your codebase and is easy to inspect. The project is released under the MIT license.

Copy-paste prompts

Prompt 1
Walk me through running backstory init and backstory test to set this up in my existing Git repo.
Prompt 2
Explain how backstory's SessionEnd hook captures and then discards raw Claude Code transcripts.
Prompt 3
Show me how to use backstory why HEAD and backstory line to find the reasoning behind a specific line of code.
Prompt 4
Help me understand backstory's contradiction detection and how it decides a change conflicts with a past decision.

Frequently asked questions

What is backstory?

A local command line tool that records why an AI coding assistant made its decisions, linking that reasoning to Git commits so you can look up the story behind any commit, file, or line later.

What language is backstory written in?

Mainly Python. The stack also includes Python, Git, Claude Code.

What license does backstory use?

MIT license: free to use, modify, and distribute for any purpose, including commercial use, as long as you keep the copyright notice.

How hard is backstory to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is backstory for?

Mainly developer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.