"Every commit is a confession. Every repo is a crime scene. codeStory is the detective."
codeStory reads your git history and turns it into a cinematic noir crime thriller β commit by commit, act by act.
Powered by LLMs and rendered in a PyQt6 dark UI, each git commit becomes a 3-act case file narrated by MAX THE DESTROY
ER. Ten confessions become an episode. The repo becomes a story.
haiku_001_main_f4096af.mp4
git commit β 3-act noir haiku β DB β cinematic PyQt viewer
(WHEN/WHERE)
(WHO/WHOM)
(WHAT/WHY)
(VERDICT)
10 haikus β episode act β DB β episode viewer
(TITLE)
(DECADE SUMMARY)
(BRANCH NOTE)
(MAX'S RULING)
haiku_depth |
What the LLM sees | Drama level |
|---|---|---|
git_commit |
Commit message only | π₯ Good |
git_diff |
Full diff β function names, class names, changed lines | π₯π₯π₯ Visceral |
Same dial applies to episodes: episode_depth: git_commit or git_diff.
At git_diff depth, haikus reference actual code: "He extracted _build_llm_client() from the void β the accomplice had a name now."
A full-screen PyQt6 dark cinema experience.
Each haiku is revealed progressively via typewriter effect for act titles, instant reveal for body text:
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β CASE FILE β "App Grew Eyes" β typewriter β
β Midnight on main, he taught it to see... β subtitle β
β β
β [SPACE] βββββββββββββββββββββββββββββββββββββββββββββββΆβ
β ACT I β WHEN/WHERE β typewriter β
β Full body text appears at once β
β β
β [SPACE] βββββββββββββββββββββββββββββββββββββββββββββββΆβ
β ACT II β WHO/WHOM β typewriter β
β Body appears at once β
β β
β [SPACE] βββββββββββββββββββββββββββββββββββββββββββββββΆβ
β ACT III β WHAT/WHY β typewriter β
β Body appears at once β
β β
β [SPACE] βββββββββββββββββββββββββββββββββββββββββββββββΆβ
β ββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β π VERDICT β typewriter β β
β β "He didn't build an app..." β instant β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β
β [SPACE] β Next haiku β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Scrollable noir case-file layout showing episodic acts: title, decade summary, branch note, and MAX'S RULING.
| Key | Action |
|---|---|
SPACE |
Advance (next act β next haiku) |
β / β |
Navigate between haikus |
H |
Switch to Haiku mode |
E |
Switch to Episode mode |
G |
Generate new haikus (triggers pipeline) |
P |
Generate new episode |
R |
Refresh from DB |
F |
Toggle fullscreen |
Q / ESC |
Quit |
# Generate haikus for current repo
python codestory.py --generate-haikus
# Generate haikus with git diff depth (more dramatic)
python codestory.py --generate-haikus --depth git_diff
# Generate an episode (needs 10+ uncompiled haikus)
python codestory.py --generate-episodes
# Launch the PyQt viewer
python codestory.py --play
# Point at any repo
python codestory.py --repo /path/to/other/repo --generate-haikus
# Reset the database (fresh start)
python codestory.py --reset-db
# Full pipeline: generate + play
python codestory.py --generate-haikus --generate-episodes --playDelete a haiku (removes from DB + cleans up JSON files):
python git_commit_haiku.py --delete f4096afRegenerate a haiku (delete + re-LLM-generate after failed attempt):
python git_commit_haiku.py --regenerate f4096afCheck consistency (orphaned/missing JSON files, duplicate filenames):
python git_commit_haiku.py --validateRebuild chronological indices (after git history rebase/force-push):
python git_commit_haiku.py --rebuild-indicesDelete an episode (removes from DB + un-marks its haikus as compiled):
python changelog_episodes.py --delete 1Regenerate an episode (delete + re-synthesize from fresh haikus):
python changelog_episodes.py --regenerate 1Check episode consistency (orphaned JSONs, missing files, broken commit references):
python changelog_episodes.py --validateAuto-generate a haiku on every commit. Add to .git/hooks/post-commit:
#!/bin/bash
conda run -n macenv python /path/to/codestory.py --generate-haikus --max 1Make it executable:
chmod +x .git/hooks/post-commit- Python 3.10+
macenvconda environment with PyQt6- Anthropic API key
# Clone the repo
git clone https://github.com/omkarh25/codestory.git
cd codestory
# Activate macenv
conda activate macenv
# Install dependencies
pip install anthropic python-dotenv PyQt6
# Set up your API key
cp llm.env.example llm.env
# Edit llm.env and add your ANTHROPIC_API_KEY
# Point at a repo and generate
python codestory.py --repo /path/to/your/repo --generate-haikus --play{
"tmChronicles": {
"repo_path": ".",
"max_haiku_per_run": 12,
"batch_size": 3,
"haiku_per_episode": 10,
"db_path": "tmChron.db",
"output_dir": "Assets/haikuJSON",
"haiku_provider": "anthropic",
"haiku_model": "claude-haiku-4-5-20251001",
"haiku_depth": "git_commit",
"episode_provider": "anthropic",
"episode_model": "claude-haiku-4-5-20251001",
"episode_depth": "git_commit",
"oldest_first": true
}
}The LLM narrator persona lives in Director/:
| File | Purpose |
|---|---|
Director/HaikuDirector.md |
MAX THE DESTROYER's brief for haiku generation |
Director/EpisodeDirector.md |
MAX's brief for episodic act writing |
Director/RepoStory.md |
Origin story preface β the baseline context for all episodes |
Edit these files to tune tone, lexicon, or output format without touching code.
codestory.py β CLI entry point
βββ git_commit_haiku.py β Haiku pipeline (git log β LLM β DB)
βββ changelog_episodes.py β Episode pipeline (DB haikus β LLM β DB)
βββ codeQT.py β PyQt6 viewer
βββ config.json β All settings
βββ llm.env β API keys (gitignored)
βββ tmChron.db β SQLite (gitignored)
βββ Director/
βββ HaikuDirector.md β Haiku LLM system prompt
βββ EpisodeDirector.mdβ Episode LLM system prompt
βββ RepoStory.md β Origin story preface
| Git Term | Crime Equivalent |
|---|---|
bug |
thug / hired muscle |
branch |
parallel operation / side racket |
merge |
the conspiracy comes together |
commit |
confession / signing the deed |
push |
going public / point of no return |
revert |
burning the evidence |
stash |
contraband / hidden assets |
diff |
the forensic report |
.gitignore |
witness protection |
- DB diff depth: haikus from database schema changes (table names, column names, data diffs)
- YouTube Shorts pipeline:
ytpipeline.pyβ render haiku slides to video via ffmpeg - Git hooks: auto-generate on every commit
- Multi-repo: track multiple repos in one DB
"He didn't build a productivity app. He built a confessional booth β and called it codeStory." test change