claude-cc simplifies workflow by automatically resuming Claude Code sessions for each git branch. This tool ensures that switching branches retains your coding context without requiring complex configurations or server dependencies. Install with npm and improve your coding efficiency effortlessly.
claude-cc is a powerful tool designed to streamline the workflow with Claude Code by automatically resuming sessions based on the current Git branch. This functionality ensures that switching branches does not disrupt your coding context, enhancing productivity and focus.
Key Features
- Seamless Integration: The
cccommand acts as a wrapper for the Claude Code CLI, facilitating an effortless transition between different branches by remembering previous sessions. - Branch-Specific Sessions: Each Git branch maintains its own session, allowing users to quickly pick up where they left off. For example:
$ git checkout feature/a $ cc Resuming session for branch: feature/a $ git checkout feature/b $ cc Resuming session for branch: feature/b - Easy to Use: Just replace
claudewithccin your commands, and let the tool manage session continuity without any additional configuration.
How It Works
claude-cc performs the following steps to provide a smooth experience:
- It determines the current branch using
git branch --show-current. - The tool scans the session history stored in
~/.claude/projects/<project>/. - It identifies the most recent session that began on that branch.
- If a session is found, it executes
claude --resume <session-id>. Otherwise, it initiates a fresh session.
Dependencies: Requires the installation of claude and Python 3, ensuring minimal setup while leveraging the standard library for basic functionality.
Conclusion
For developers who frequently switch between branches in Git, claude-cc is an essential tool that preserves context and enhances workflow efficiency. Say goodbye to the hassle of losing progress when navigating through different tasks.
No comments yet.
Sign in to be the first to comment.