Show HN: I cut my Claude API bill by 66% with Git-based context
I built ShadowGit a while back to automatically commit code every minute to a hidden git repo (.shadowgit.git). Original goal was to easily rollback when AI tools break things.
But I discovered something interesting: this minute-by-minute history is perfect context for AI assistants.
So I built an MCP server that lets Claude/Cursor query this history using native git commands. The results surprised me:
Before: Claude would read my entire codebase repeatedly, burning 15,000+ tokens to debug issues. After: Claude runs `git log --grep="drag"` finds when drag-and-drop worked, applies that fix. 5,000 tokens.
How it works technically:
1. ShadowGit watches your project and commits every save to .shadowgit.git (parallel to your main repo)
2. MCP server exposes git operations to AI: - `git diff HEAD~10 -- component.tsx` to see recent changes - `git log -S "functionName"` to find when code was added - `git show COMMIT:file.js` to retrieve working versions
3. AI naturally understands git, so instead of dumping context, it surgically queries what it needs
It's free while I am testing and improving it. I am looking for feedback on the project and maybe some integration ideas beyond MCP.
Thanks! Alessandro
No comments yet