claude-code-collab
v0.2.1
Published
Share Claude Code sessions via git. Conversation branching, privacy scrubbing, fuzzy search.
Maintainers
Readme
claude-code-collab
Share Claude Code sessions via git. Treat Claude as the "third collaborator" in your team.
Why?
Claude Code stores conversations locally in ~/.claude/projects/. When working on a team, you often want to:
- Share context from a debugging session with a teammate
- Continue someone else's conversation with Claude
- Branch a conversation to explore different approaches
- Keep a shared history of AI-assisted decisions
claude-code-collab syncs sessions to your git repo so they travel with your code.
Features
- Git-native sync — Sessions live in
.claude-sessions/and sync on push/pull via git hooks - Conversation branching — Fork from any message to explore alternatives (DAG structure, not just git branches)
- Privacy scrubbing — Auto-redacts AWS keys, GitHub tokens, JWTs, secrets, and env vars on export
- Fuzzy search — Find sessions by ID, title, or author
- Conflict detection — Warns when local and remote sessions have diverged
- Path portability — Absolute paths are rewritten so sessions work across machines
Installation
npm install -g claude-code-collabThis gives you two commands:
claude-code-collab— full nameccc— short alias
Or clone and link:
git clone https://github.com/54yyyu/claude-code-collab.git
cd claude-code-collab
npm install
npm run build
npm linkQuick Start
# In your git repo
ccc init # Creates .claude-sessions/, installs git hooks
# Work with Claude Code as normal...
ccc sync # Export your sessions (auto-scrubs secrets)
git add .claude-sessions
git commit -m "Share Claude sessions"
git push
# Collaborators pull and their sessions sync automatically via git hooksCommands
| Command | Description |
|---------|-------------|
| init | Initialize claude-code-collab in the current repo |
| sync | Bidirectional sync between local Claude and repo |
| export / e | Export specific sessions (interactive picker or by ID) |
| list / ls | List all shared sessions |
| tree | Show conversation DAG as ASCII tree |
| view <query> | View a session (fuzzy search by ID/title/author) |
| continue <session> | Branch from an existing session |
| conflicts | Check for diverged sessions |
Sync Options
ccc sync # Bidirectional sync (default)
ccc sync --import # Only import from repo
ccc sync --export # Only export to repo
ccc sync --no-scrub # Disable secret scrubbing (not recommended)Exporting Specific Sessions
# Interactive picker - select which sessions to export
ccc export
# Export specific sessions by ID (fuzzy search supported)
ccc export abc123 def456
# Export without secret scrubbing
ccc export --no-scrub abc123Continuing Conversations
# Continue from the last message of a session
ccc continue abc123
# Continue from a specific message
ccc continue abc123:def456
# Fuzzy search works too
ccc continue "debug"How It Works
Session Storage
your-repo/
├── .claude-sessions/
│ ├── sessions/ # Shared JSONL files
│ │ ├── abc123.jsonl
│ │ └── def456.jsonl # May reference abc123 as parent
│ └── index.json # Metadata: titles, authors, relationships
└── .git/hooks/
├── post-merge # Auto-imports on pull
└── post-checkout # Auto-imports on branch switchConversation Branching
Sessions form a DAG (directed acyclic graph) via parentUuid links:
abc123 (original session)
├── def456 (Alice continues from message 5)
└── ghi789 (Bob continues from message 3)
└── jkl012 (Carol continues Bob's thread)This is different from git branches — you're branching the conversation, not the code.
Privacy Scrubbing
On export, the following are automatically redacted:
- AWS access keys and secret keys
- GitHub tokens (
ghp_,gho_, etc.) - Slack tokens, npm tokens
- JWTs and Bearer tokens
- Generic patterns matching
api_key,secret,password - Environment variables (except safe ones like
PATH,HOME)
Disable with --no-scrub if needed (e.g., for private repos).
Path Rewriting
Local paths like /Users/alice/project/src/foo.ts are rewritten to {{REPO_ROOT}}/src/foo.ts on export, and restored to the collaborator's actual path on import.
Comparison with Other Tools
| Feature | claude-code-collab | claude-code-sync | Enclaude | claude-session-share | |---------|---------------|------------------|----------|---------------------| | Git sync | ✓ | ✓ | ✓ | ✗ (Gist only) | | Conversation branching | ✓ | ✗ | ✗ | ✗ | | Privacy scrubbing | ✓ | ✗ | ✗ | ✓ | | Fuzzy search | ✓ | ✗ | ✗ | ✗ | | Conflict detection | ✓ | ✓ | ✗ | ✗ |
Contributing
PRs welcome! Some ideas:
- [ ] Interactive TUI for browsing sessions (using
ink) - [ ] Session search by content
- [ ] Configurable scrubbing patterns
- [ ] Export to markdown for documentation
- [ ] VS Code extension integration
License
MIT
