Ccgs shares Claude Code sessions via Git orphan branches
Ccgs is an open-source tool by scrollaway that stores and shares Claude Code sessions in orphan Git branches, letting teammates resume each other's sessions from any machine.
Score breakdown
Teams using Claude Code can now share and resume each other's sessions across machines without manual file copying or path-rewriting, keeping collaborative AI coding workflows inside existing Git infrastructure.
- 01Claude Code sessions are stored locally in `~/.claude/projects/` with no built-in way to share or hand off to teammates.
- 02Ccgs stores sessions in orphan Git branches prefixed `@ccgs/<name>` in an existing repo's remote.
- 03On pull, ccgs rewrites only the structural `cwd` field in session files to match the recipient's path — not a blind find-and-replace.
Scrollaway built ccgs to address a gap in collaborative Claude Code workflows: sessions accumulate as valuable artifacts but are locked to `~/.claude/projects/` on whichever machine they were created on. There was no supported way to hand a colleague a specific session — such as "the session where I untangled the migration" — so they could `claude --resume` it and continue the work. Ccgs solves this by pushing session files into orphan branches named `@ccgs/<name>` in the team's existing remote repository.
A key technical challenge is that session files embed the author's absolute paths.
A key technical challenge is that session files embed the author's absolute paths. On pull, ccgs surgically rewrites only the structural `cwd` field to match the recipient's working directory, deliberately avoiding a blind find-and-replace that could corrupt the session transcript. All Git operations use low-level plumbing commands (`hash-object`, `commit-tree`, `update-ref`) against a throwaway index, meaning the tool never modifies the working tree, the index, or the current branch — and it works fine with a dirty tree. As a side effect, the approach also lets users move a directory while preserving its Claude Code transcripts by pushing before the move and pulling after.
The tool is available via `npx claude-git-sessions` without installation. Scrollaway includes an important security warning: Claude Code sessions frequently contain sensitive information such as environment secrets, so users should exercise caution and avoid pushing to public repositories. The `@ccgs/` branch prefix makes it easy to filter these branches out. The project itself was written with Claude Code, though the Show HN post was not.
Key facts
- 01Claude Code sessions are stored locally in `~/.claude/projects/` with no built-in way to share or hand off to teammates.
- 02Ccgs stores sessions in orphan Git branches prefixed `@ccgs/<name>` in an existing repo's remote.
- 03On pull, ccgs rewrites only the structural `cwd` field in session files to match the recipient's path — not a blind find-and-replace.
- 04All Git operations use plumbing commands (`hash-object`/`commit-tree`/`update-ref`) against a throwaway index, never touching the working tree or current branch.
- 05The tool works with a dirty tree and will not run a `git checkout` behind the user's back.
- 06A security warning notes sessions likely contain sensitive data like environment secrets; public repo use is discouraged.
- 07Available to try without installing via `npx claude-git-sessions`.
Topics
Summary and scoring are generated automatically from the original article. We always link back to the publisher and never republish images or paywalled content. Last processed Jun 7, 2026 · 12:45 UTC. How this works →