Never Lose an AI Coding Session Again - Introducing JJ AI Workflow
The Problem Every AI Developer Faces
Picture this: You're deep in a coding session with Claude, GitHub Copilot, or another AI assistant. The AI suggests a refactoring. You apply it. Then another suggestion. And another. Suddenly, something breaks.
"Wait, which change caused this? What was the code like three iterations ago?"
Sound familiar?
When working with AI coding assistants, we often make rapid iterationsβtrying different approaches, experimenting with suggestions, and evolving our code quickly. But this speed comes with a cost: we lose track of what worked and what didn't.
Enter SnapJJ
SnapJJ is a dead-simple automation toolkit that solves this problem. Built on top of Jujutsu (jj)βa powerful Git-compatible version control systemβit gives you one-command snapshots of every AI iteration.
Why This Matters
Traditional Git workflows are too heavy for AI pair programming:
git add
,git commit
for every AI suggestion? Too slow.- Forgetting to commit? You lose valuable iterations.
- Complex Git commands? They break your flow.
SnapJJ reduces this to a single command: snap
How It Works
The Two-Command Workflow
- Let AI make changes in your editor
- Type
snap
to save that iteration
That's it. Every AI suggestion is now safely tracked.
Real-World Example
# Start working on a new feature
$ ai_start "building user authentication"
π Started AI session: building user authentication
# AI suggests adding a login form
# You implement it, then:
$ snap "added login form"
β
Snapshotted: added login form
# AI suggests improving validation
# You apply the changes:
$ snap "improved validation logic"
β
Snapshotted: improved validation logic
# Something breaks! No problem:
$ oops
β‘ Undid last operation
# Want to see your history?
$ back
π Recent history:
@ abc123 π€ AI: improved validation logic
β def456 π€ AI: added login form
β ghi789 π Session: building user authentication
Key Features That Make a Difference
π€ One-Command Snapshots
No more git add -A && git commit -m "..."
Just snap "what changed"
and continue coding.
β‘ Instant Undo
Made a mistake? oops
instantly reverts it.
No googling "how to undo last git commit."
π Time Travel
Jump to any previous iteration with ai_goto
.
Compare different approaches side-by-side.
π AI-Focused History
ai_history
shows only your AI sessions.
No clutter, just the iterations that matter.
π Zero Learning Curve
Commands are designed to be memorable:
snap
- snapshot changesoops
- undo last actionback
- see recent historyai_what
- see current changes
Installation: 3 Minutes to Safety
Step 1: Install Jujutsu
# macOS
brew install jj
# Linux/Windows
cargo install --locked --bin jj jj-cli
Step 2: Run the Setup Script
git clone https://github.com/dimitrimissoh/snapjj
cd snapjj
./setup-jj-ai.sh
Step 3: Start Using It
cd your-project
jj init --git # Initialize jj (works with existing Git repos!)
ai_start "working with AI"
Why Jujutsu?
You might wonder: why not just use Git aliases?
Jujutsu offers unique advantages:
- Automatic tracking: No need to stage files
- Powerful undo: Can undo ANY operation, even merges
- First-class snapshots: Designed for frequent commits
- Git compatible: Works with all your existing tools
Real Developer, Real Benefits
After using SnapJJ for months, I've found it transforms how I work with AI:
- More Experimental: I'm not afraid to try wild AI suggestions
- Better Learning: I can review what worked and what didn't
- Faster Development: No mental overhead about version control
- Peace of Mind: Every state is saved automatically
Beyond Basic Usage
The toolkit grows with you:
# Compare two different AI approaches
ai_compare abc123 def456
# Start a new experimental branch
ai_start "trying reactive approach"
# View changes before snapshotting
ai_what
# See only AI-related commits
ai_history
Visual History with GUI Tools
Want to see your AI iterations visually? These tools provide graphical interfaces for Jujutsu:
- LazyJJ - A terminal UI similar to lazygit, perfect for keyboard warriors
- GG - A full GUI application that beautifully visualizes your branching AI experiments
With these tools, you can see your entire AI collaboration history as a visual graph, making it even easier to jump between different approaches and understand how your code evolved.
Who Is This For?
- AI Power Users: If you're using Claude, Copilot, or Cursor daily
- Experimenters: Love trying different approaches? This is for you
- Safety-First Developers: Never lose working code again
- Teams: Share and review AI-assisted development sessions
Getting Started Today
The beauty of SnapJJ is its simplicity. You don't need to change how you workβjust add snap
to your muscle memory.
Ready to never lose an AI coding session again?
Quick Reference
Command | What it does | When to use it |
---|---|---|
snap |
Save current state | After each AI change |
oops |
Undo last action | When something breaks |
back |
View recent history | To see what you've done |
ai_goto |
Jump to specific state | To try a different approach |
ai_what |
Show current changes | Before snapshotting |
SnapJJ is open source and available under the MIT license. Contributions welcome!