Automatic conversation capture for Claude Code - Track your AI-assisted coding sessions with zero manual effort.
Automatically captures your Claude Code conversations and links them to git commits, giving you a complete history of how your code evolved with AI assistance.
- 🤖 Zero-Effort Capture - Conversations automatically saved as you code
- 💬 Full Conversations - Captures your prompts AND Claude's responses
- 📋 Pasted Content - Preserves screenshots, code snippets, error messages you paste
- 🔗 Git Integration - Links conversations to commits automatically
- 👤 Git Author Tracking - Records who had the conversation
- 🚀 Real-Time Sync - Sessions saved immediately, not on exit
- 🔄 Multi-Session Support - Run multiple Claude instances, capture all of them
- 🛠️ Any Commit Tool - Works with GitHub Desktop, VS Code, Terminal, or even Claude itself
- 📊 CLI Dashboard - List, search, and filter prompts from terminal
- 🌐 Web Dashboard - Beautiful static HTML dashboard with search and filters
- 🌿 Branch Tracking - See which branch each conversation happened on
npm install -g gitify-prompt
# Add to ~/.zshrc or ~/.bashrc:
echo 'alias claude="/path/to/gitify-prompt/dist/bin/claude-wrapper.sh"' >> ~/.zshrc
source ~/.zshrc
Or run without alias:
/path/to/claude-wrapper.sh "your prompt"
cd your-project
gitify-prompt init
This creates:
.prompts/
directory- Git hooks (automatically detects Husky!)
claude "add error handling to src/api.ts"
# Conversation captured automatically ✓
git add .
git commit -m "Add error handling"
# ✓ Conversation linked to commit automatically!
┌────────────────────────────────────────┐
│ Your Shell: claude "add feature" │
└────────────────┬───────────────────────┘
↓
┌────────────────────────────────────────┐
│ claude-wrapper.sh │
│ Sets: NODE_OPTIONS=--import hook.js │
└────────────────┬───────────────────────┘
↓
┌────────────────────────────────────────┐
│ Claude Code (with hook loaded) │
│ - Intercepts file writes │
│ - Reads ~/.claude/projects/*.jsonl │
│ - Saves to .prompts/.meta/session-*.json │
└────────────────┬───────────────────────┘
↓
┌────────────────────────────────────────┐
│ git commit │
│ Pre-commit: Add prompts to commit │
│ Post-commit: Link to commit SHA │
└────────────────────────────────────────┘
The hook reads from ~/.claude/projects/
where Claude Code stores conversations:
~/.claude/projects/
└── -Users-you-dev-project/
├── abc123-xyz.jsonl ← Your conversations
├── def456-uvw.jsonl
└── ...
Each JSONL file contains:
- User messages (your prompts)
- Assistant messages (Claude's responses)
- Tool uses (code executions)
- Timestamps
- Pasted content (inline)
Sessions are matched to conversations using:
- Timestamp - Only messages after session start
- Project path - Only conversations from this repo
- Best fit - Picks conversation with most matching messages
{
"id": "session-abc123",
"tool": "claude-code",
"startTime": "2025-01-15T10:30:00Z",
"author": {
"name": "Your Name",
"email": "you@example.com"
},
"messages": [
{
"role": "user",
"content": "add error handling to src/api.ts",
"timestamp": "2025-01-15T10:30:00Z"
},
{
"role": "assistant",
"content": "I'll add comprehensive error handling...",
"timestamp": "2025-01-15T10:30:05Z"
}
],
"filesModified": [
{
"file": "/path/to/project/src/api.ts",
"timestamp": "2025-01-15T10:30:10Z"
}
],
"metadata": {
"commitSha": "abc123def",
"branch": "feature-auth",
"parentBranch": "main",
"fileCount": 1,
"messageCount": 2
}
}
Sessions are saved immediately when files are modified, not when Claude exits. This means:
- ✅ Works even if Claude is still running when you commit
- ✅ Captures sessions even if Claude crashes
- ✅ No dependency on process lifecycle
When you paste error messages, screenshots, or code into Claude:
You: [Pasted text #1 +150 lines] fix this error
The full 150 lines are captured, not just the summary.
Run Claude in 3 terminal tabs:
# Tab 1: claude "fix bug A"
# Tab 2: claude "add feature B"
# Tab 3: claude "refactor C"
Commit once → All 3 conversations captured!
- ✅ Terminal:
git commit
- ✅ GitHub Desktop
- ✅ VS Code Source Control
- ✅ Claude itself:
claude "commit these changes"
All trigger the same hooks → consistent behavior.
Automatically detects if your project uses Husky:
Standard Git:
.git/hooks/
├── pre-commit ← Created by gitify-prompt
└── post-commit ← Created by gitify-prompt
Husky Project:
.husky/
├── pre-commit ← Appended (preserves lint-staged!)
└── post-commit ← Created by gitify-prompt
your-project/
├── .prompts/
│ ├── config.json
│ ├── prompts/
│ │ ├── 1705315800000-abc123.json ← Captured session
│ │ ├── 1705402200000-def456.json
│ │ └── ...
│ └── .meta/
│ └── (temporary session files)
└── .git/
└── hooks/
├── pre-commit
└── post-commit
Initialize .prompts/
directory and install git hooks.
cd your-project
gitify-prompt init
Options:
- Detects Husky automatically
- Preserves existing hooks
- Safe to run multiple times
List all captured prompts with metadata.
gitify-prompt list
gitify-prompt list --branch feature-auth
gitify-prompt list --author "Your Name"
gitify-prompt list --since "2 days ago"
gitify-prompt list --limit 10
Output:
┌──────────┬────────────────┬───────────────┬──────────┬────────┬──────────────────┐
│ SHA │ Branch │ Author │ Messages │ Files │ Date │
├──────────┼────────────────┼───────────────┼──────────┼────────┼──────────────────┤
│ abc123d │ feature-auth │ @Your Name │ 3 │ 5 │ 2 hours ago │
│ def456g │ main │ @Your Name │ 7 │ 2 │ 5 hours ago │
└──────────┴────────────────┴───────────────┴──────────┴────────┴──────────────────┘
View full conversation and changes for a specific commit.
gitify-prompt show abc123
gitify-prompt show abc123 --json
gitify-prompt show abc123 --files
Output:
Commit: abc123def456
Branch: feature-auth ← main
Author: Your Name <you@example.com>
Date: Jan 15, 2025, 10:30:00 AM (2 hours ago)
Messages: 3 • Files: 5
💬 Conversation
[10:30:00] 👤 You:
add error handling to src/api.ts
[10:30:05] 🤖 Claude:
I'll add comprehensive error handling...
📝 Files Modified (5)
✏️ src/api.ts
✏️ src/types.ts
...
Generate a static HTML dashboard to visualize your prompts.
gitify-prompt web
gitify-prompt web --open # Open in browser after generation
Features:
- 🔍 Search prompts
- 🔄 Filter by branch/author
- 💬 View full conversations
- 📱 Responsive design
- 🌐 Works offline (no backend needed)
- 📦 Commit to git for GitHub Pages
Output:
.prompts/web/
├── index.html # Prompt list dashboard
├── prompts/ # Individual prompt pages
├── assets/ # CSS and JavaScript
└── data.json # All prompts as JSON
Edit .prompts/config.yaml
:
autoCapture:
enabled: true
tools:
claudeCode: true
# cursor: false (future)
# chatgpt: false (future)
privacy:
maskSensitiveData: true
excludePatterns:
- "*.env"
- "*secret*"
- "*password*"
- "*api*key*"
1. Check hook is loaded:
claude --version
# Look for: [gitify-prompt] Capturing session ...
2. Check wrapper alias:
which claude
# Should show: ...claude-wrapper.sh
3. Check git hooks installed:
cat .git/hooks/pre-commit | grep gitify-prompt
# or for Husky:
cat .husky/pre-commit | grep gitify-prompt
4. Check session files exist:
ls -la .prompts/.meta/
# Should show session-*.json when Claude is running
5. Re-initialize:
gitify-prompt init
Check if Claude Code is storing conversations:
ls -la ~/.claude/projects/
# Should see directory for your project
If not, Claude Code might not be saving conversations. This is a Claude Code issue, not gitify-prompt.
- Local Only - All data stays on your machine
- No Network - No remote connections
- No Telemetry - No tracking or analytics
- Git Control - You decide what gets committed
- Sensitive Data Masking - Auto-filters passwords, API keys (config)
- Node.js 18.19+ (for
--import
flag) - Git
- Claude Code
- macOS or Linux (Windows untested)
- Claude Code only (Cursor, ChatGPT not supported yet)
- Requires wrapper setup (alias configuration)
- No retroactive capture (only active sessions)
- Windows untested (path encoding might differ)
# Clone and install
git clone https://github.com/gauravkrp/git-for-prompts.git
cd git-prompts
npm install
# Build
npm run build
# Link globally
npm link
# Test
cd /path/to/test/project
gitify-prompt init
claude "test prompt"
Before (Manual):
claude "add feature"
# ... work ...
gitify-prompt annotate -m "I asked Claude to add feature X"
git commit -m "Add feature"
Now (Automatic):
claude "add feature" # ← Conversation captured automatically
git commit -m "Add feature" # ← Linked automatically
Zero extra steps!
This package uses automated publishing via GitHub Actions. When you push a version change to main
, it automatically publishes to npm.
Quick version bump:
npm version patch # 0.1.0 → 0.1.1
npm version minor # 0.1.0 → 0.2.0
npm version major # 0.1.0 → 1.0.0
git push && git push --tags
This triggers the GitHub Actions workflow which:
- Detects version change
- Runs build and tests
- Publishes to npm
- Creates GitHub release
See AUTO-PUBLISH.md for setup instructions.
# Clone the repo
git clone https://github.com/gauravkrp/git-for-prompts.git
cd git-for-prompts
# Install dependencies
npm install
# Build
npm run build
# Watch mode
npm run dev
# Test locally
./dist/cli/index.js --help
Contributions welcome! Please see CONTRIBUTING.md (coming soon).
Areas needing help:
- Windows support
- Cursor IDE integration
- ChatGPT integration
- Automated tests
- Performance optimization
- Claude Code - The AI coding assistant
- Cursor - AI-first code editor
- Aider - AI pair programming
MIT
Start capturing your Claude conversations today!
npm install -g gitify-prompt
cd your-project
gitify-prompt init
# Add wrapper alias (see Quick Start)
claude "your first prompt"
git add . && git commit -m "First captured session!"