๐ชจ why use many token when few token do trick โ Claude Code skill that cuts 65% of tokens by talking like caveman
CLI session manager for AI coding agents
CCManager manages multiple AI assistant sessions across Git worktrees and projects from one terminal app. It tracks session state, lets you switch between sessions, creates and merges worktrees, restores previous sessions, and can run hooks or auto-approval workflows around those sessions.
Builders who use terminal coding agents across multiple worktrees and want one interface to manage them.
You can keep several agent sessions organized, see which ones need attention, and reopen your last session setup after a restart.
What it does
Parallel session management
Runs multiple AI assistant sessions at the same time across separate Git worktrees.
Multi-project view
Lets you manage more than one git repository from a single interface.
Session state tracking
Shows whether each session is busy, waiting, or idle.
Worktree creation and cleanup
Creates, merges, and deletes worktrees from inside the app.
Session restore on restart
Stores open sessions and offers to launch them again after CCManager restarts or crashes.
Session data copying
Copies Claude Code session files into new worktrees so conversation context can carry over.
.worktreeinclude support
Copies gitignored project files like `.env` into new worktrees when a `.worktreeinclude` file is present.
Status change hooks
Runs custom commands when session status changes, which can drive notifications or automation.
How to get it
- 1Run
npm install -g ccmanager
- 2Run
npm install bun run build npm start
- 3Run
ccmanager
- 4Or run without installing
npx ccmanager
- 5Run
# Start CCManager with devcontainer support npx ccmanager --devc-up-command "<your devcontainer up command>" \ --devc-exec-command "<your devcontainer exec command>" - 6Run
# Set the root directory containing your git projects export CCMANAGER_MULTI_PROJECT_ROOT="/path/to/your/projects" # Run CCManager in multi-project mode npx ccmanager --multi-project
README
CCManager - AI Code Agent Session Manager
CCManager is a CLI application for managing multiple AI coding assistant sessions (Claude Code, Gemini CLI, Codex CLI, Cursor Agent, Copilot CLI, Cline CLI, OpenCode, Kimi CLI) across Git worktrees and projects.
https://github.com/user-attachments/assets/15914a88-e288-4ac9-94d5-8127f2e19dbf
Features
- Run multiple AI assistant sessions in parallel across different Git worktrees
- Multi-project support: Manage multiple git repositories from a single interface
- Support for multiple AI coding assistants (Claude Code, Gemini CLI, Codex CLI, Cursor Agent, Copilot CLI, Cline CLI, OpenCode, Kimi CLI)
- Switch between sessions seamlessly
- Visual status indicators for session states (busy, waiting, idle)
- Create, merge, and delete worktrees from within the app
- Restore sessions after a restart: reopen the sessions that were running when CCManager last exited or crashed
- Copy Claude Code session data between worktrees to maintain conversation context
.worktreeincludesupport: carry gitignored project files (.env, local certs) into newly created worktrees- Configurable keyboard shortcuts
- Command presets with automatic fallback support
- Configurable state detection strategies for different CLI tools
- Status change hooks for automation and notifications
- Devcontainer integration
- Auto Approval (experimental): Automatically approve safe prompts using AI verification
Why CCManager over Claude Squad?
Both tools solve the same problem - managing multiple Claude Code sessions - but take different approaches.
If you love tmux-based workflows, stick with Claude Squad! It's a great tool that leverages tmux's power for session management.
CCManager is for developers who want:
๐ No tmux dependency
CCManager is completely self-contained. No need to install or configure tmux - it works out of the box. Perfect if you don't use tmux or want to keep your tmux setup separate from Claude Code management.
๐๏ธ Real-time session monitoring
CCManager shows the actual state of each Claude Code session directly in the menu:
- Waiting: Claude is asking for user input
- Busy: Claude is processing
- Idle: Ready for new tasks
Claude Squad doesn't show session states in its menu, making it hard to know which sessions need attention. While Claude Squad offers an AutoYes feature, this bypasses Claude Code's built-in security confirmations - not recommended for safe operation.
๐ฏ Simple and intuitive interface
Following Claude Code's philosophy, CCManager keeps things minimal and intuitive. The interface is so simple you'll understand it in seconds - no manual needed.
Install
npm install -g ccmanager
Local Development
npm install
bun run build
npm start
Usage
ccmanager
Or run without installing:
npx ccmanager
Keyboard Shortcuts
Default Shortcuts
- Ctrl+E: Return to menu from active session
- Escape: Cancel/Go back in dialogs
Customizing Shortcuts
You can customize keyboard shortcuts in two ways:
- Through the UI: Select Global Configuration โ Configure Shortcuts from the main menu
- Configuration file: Edit
~/.config/ccmanager/config.jsonor.ccmanager.jsonfor per-project settings (see Per-Project Configuration)
Example configuration:
// config.json (new format)
{
"shortcuts": {
"returnToMenu": {
"ctrl": true,
"key": "r"
},
"cancel": {
"key": "escape"
}
}
}
Note: Shortcuts from shortcuts.json will be automatically migrated to config.json on first use.
Restrictions
- Shortcuts must use a modifier key (Ctrl) except for special keys like Escape
- The following key combinations are reserved and cannot be used:
- Ctrl+C
- Ctrl+D
- Ctrl+[ (equivalent to Escape)
Per-Project Configuration
CCManager supports per-project configuration by placing a .ccmanager.json file in your git repository root. Project settings are merged with the global config (~/.config/ccmanager/config.json), with project settings always taking priority.
For detailed configuration options and examples, see docs/project-config.md.
Configuring with an AI coding agent
This repository doubles as a plugin marketplace providing the ccmanager-config skill, which teaches Claude Code or Codex the whole configuration schema and ships a validator for it:
# Claude Code
claude plugin marketplace add kbwo/ccmanager
claude plugin install ccmanager-config@ccmanager
# Codex CLI
codex plugin marketplace add kbwo/ccmanager
codex plugin add ccmanager-config@ccmanager
Then just ask โ "set this repo up to run codex in ccmanager", "notify me when a session is waiting for input", "why is my .ccmanager.json being ignored?". See plugins/ccmanager-config/README.md.
Supported AI Assistants
CCManager supports multiple AI coding assistants with tailored state detection for each:
| Assistant | Command | Installation |
|---|---|---|
| Claude Code (Default) | claude | code.claude.com |
| Gemini CLI | gemini | github.com/google-gemini/gemini-cli |
| Codex CLI | codex | github.com/openai/codex |
| Cursor Agent | cursor-agent | cursor.com/cli |
| Copilot CLI | copilot | github.com/github/copilot-cli |
| Cline CLI | cline | github.com/cline/cline |
| OpenCode | opencode | opencode.ai/docs |
| Kimi CLI | kimi | kimi-cli.com |
| MiniMax Code (MCode) | mcode | npmjs.com/package/@minimax-ai/code |
Each assistant has its own state detection strategy to properly track:
- Idle: Ready for new input
- Busy: Processing a request
- Waiting: Awaiting user confirmation
See Gemini Support Documentation for CCManager-specific configuration.
Command Configuration
CCManager supports configuring the command and arguments used to run Claude Code sessions, with automatic fallback options for reliability.
Features
- Configure the main command (default:
claude) - Set primary arguments (e.g.,
--resume) - Define fallback arguments if the primary configuration fails
- Automatic retry with no arguments as final fallback
Quick Start
- Navigate to Global Configuration โ Configure Command Presets
- Set your desired arguments (e.g.,
--resumefor resuming sessions) - Optionally set fallback arguments
- Save changes
For detailed configuration options and examples, see docs/command-config.md.
Claude Code Teammate Mode
When running the claude command with the default (claude) detection strategy, CCManager automatically appends --teammate-mode in-process to the CLI arguments. This prevents conflicts between Claude Code's agent teams feature and ccmanager's PTY-based session management.
- Automatic: No configuration needed. CCManager injects the flag for all
claudecommand sessions. - Override: If you explicitly specify
--teammate-modein your preset args, your value takes priority. - Non-claude commands: Other AI assistants (Gemini, Codex, etc.) are not affected.
Setting "teammateMode": "in-process" in Claude Code's settings.json alone is not sufficient when running inside a tmux-like environment, which is why CCManager controls this via the CLI argument.
Session Data Copying
CCManager can copy Claude Code session data (conversation history, context, and project state) when creating new worktrees, allowing you to maintain context across different branches.
Features
- Seamless Context Transfer: Continue conversations in new worktrees without losing context
- Configurable Default: Set whether to copy session data by default
- Per-Creation Choice: Decide on each worktree creation whether to copy data
- Safe Operation: Copying is non-fatal - worktree creation succeeds even if copying fails
How It Works
When creating a new worktree, CCManager:
- Asks whether to copy session data from the current worktree
- Copies all session files from
~/.claude/projects/[source-path]to~/.claude/projects/[target-path] - Preserves conversation history, project context, and Claude Code state
- Allows immediate continuation of conversations in the new worktree
Configuration
- Navigate to Global Configuration โ Configure Worktree
- Toggle Copy Session Data to set the default behavior
- Save changes
The default choice (copy or start fresh) will be pre-selected when creating new worktrees.
Use Cases
- Feature Development: Copy session data when creating feature branches to maintain project context
- Experimentation: Start fresh when testing unrelated changes
- Collaboration: Share session state across team worktrees
- Context Preservation: Maintain long conversations across multiple development branches
Copying Gitignored Files into New Worktrees
A new Git worktree contains only tracked files, so gitignored files a project needs in order to run โ .env, local certificates, generated local config โ do not come along. If the repository root has a .worktreeinclude file (gitignore syntax) listing those files, CCManager copies them into every worktree it creates.
- Shared convention: same file name and semantics as Claude Code, Conductor, OpenAI Codex, and
git-worktreeinclude, so an existing.worktreeincludeworks with CCManager unchanged - No configuration: the copy runs whenever a
.worktreeincludefile exists - Safe by construction: a file is copied only if it both matches a pattern and is actually gitignored, so tracked files are never duplicated
- Hook-friendly: files are copied before the post-creation worktree hook runs, so hook commands can rely on them
For pattern syntax, the exact selection rule, and troubleshooting, see docs/worktree-include.md.
Restoring Sessions After a Restart
Closing CCManager kills the AI assistant processes it started, so reopening it normally means finding each worktree again and starting each session by hand. To avoid that, CCManager keeps a record of the sessions it currently has open, and on the next start offers to launch them again:
Restore previous sessions
Found 2 sessions from the last time ccmanager ran. Start them again?
feature-login โ Main
fix-timeout (review) โ Codex
> Restore
Don't restore
- What is restored: each session's command preset is run again in its worktree, under the name you had given it. The previous terminal output and the conversation held inside the assistant are not restored โ restoring means starting the same command again, not resuming where it left off. (To carry conversation context into a new worktree, see Session Data Copying.)
- Survives a crash: the record is written as sessions come and go, not on exit, so a crash, a
kill -9, or a closed terminal leaves it intact. - Only sessions that were still open: a session you killed, or one whose command exited on its own, is dropped from the record and is not offered.
- Declining is remembered: choosing "Don't restore" forgets those sessions, so the offer does not come back on the next start.
- Scope: normally only the repository you are opening is considered. In Multi-Project Mode the sessions of every recorded project are offered together at startup.
- Other running instances: sessions belonging to another CCManager that is still open are left alone, so they are not started a second time.
The record lives in ~/.config/ccmanager/sessions.json (%APPDATA%\ccmanager\sessions.json on Windows).
Status Change Hooks
CCManager can execute custom commands when Claude Code session status changes. This enables powerful automation workflows like desktop notifications, logging, or integration with other tools.
Overview
Status hooks allow you to:
- Get notified when Claude needs your input
- Track time spent in different states
- Trigger automations based on session activity
- Integrate with notification systems like noti
For detailed setup instructions, see docs/state-hooks.md.
Worktree Hooks
Worktree hooks execute custom commands when worktrees are created, enabling automation of development environment setup.
Features
- Post-creation hook: Run commands after a worktree is created
- Environment variables: Access worktree path, branch name, and git root
- Non-blocking execution: Hooks run asynchronously without delaying operations
- Error resilience: Hook failures don't prevent worktree creation
Use Cases
- Set up development dependencies (
npm install,bundle install) - Configure IDE settings per branch
- Send notifications when worktrees are created
- Initialize branch-specific configurations
For configuration and examples, see docs/worktree-hooks.md.
Automatic Worktree Directory Generation
CCManager can automatically generate worktree directory paths based on branch names, streamlining the worktree creation process.
- Auto-generate paths: No need to manually specify directories
- Customizable patterns: Use placeholders like
{branch}in your pattern - Smart sanitization: Branch names are automatically made filesystem-safe
For detailed configuration and examples, see docs/worktree-auto-directory.md.
Auto Approval (Experimental)
CCManager can automatically approve Claude Code prompts that don't require user permission, reducing manual intervention while maintaining safety for sensitive operations.
Features
- Automatic decision: Uses Claude (Haiku) to analyze prompts and determine if they need manual approval
- Custom commands: Replace the default verifier with your own script or different AI model
- Safe fallback: Always defaults to manual approval on errors or timeouts
- Interruptible: Press any key to cancel auto-approval and review manually
Quick Start
- Navigate to Global Configuration โ Other & Experimental
- Enable Auto Approval (experimental)
- (Optional) Configure a custom command for verification
For detailed configuration and usage, see docs/auto-approval.md.
Devcontainer Integration
CCManager supports running AI assistant sessions inside devcontainers while keeping the manager itself on the host machine. This enables sandboxed development environments with restricted network access while maintaining host-level notifications and automation.
Features
- Host-based management: CCManager runs on your host machine, managing sessions inside containers
- Seamless integration: All existing features (presets, status hooks, etc.) work with devcontainers
- Security-focused: Compatible with Anthropic's recommended devcontainer configurations
- Persistent state: Configuration and history persist across container recreations
Usage
# Start CCManager with devcontainer support
npx ccmanager --devc-up-command "<your devcontainer up command>" \
--devc-exec-command "<your devcontainer exec command>"
The devcontainer integration requires both commands:
--devc-up-command: Any command to start the devcontainer--devc-exec-command: Any command to execute inside the container
Benefits
- Safe experimentation: Run commands like
claude --dangerously-skip-permissionswithout risk
For detailed setup and configuration, see docs/devcontainer.md.
Multi-Project Mode
CCManager can manage multiple git repositories from a single interface, allowing you to organize and navigate between different projects and their worktrees efficiently.
Quick Start
# Set the root directory containing your git projects
export CCMANAGER_MULTI_PROJECT_ROOT="/path/to/your/projects"
# Run CCManager in multi-project mode
npx ccmanager --multi-project
Features
- Automatic project discovery: Recursively finds all git repositories
- Recent projects: Frequently used projects appear at the top
- Vi-like search: Press
/to filter projects or worktrees - Session persistence: Sessions remain active when switching projects
- Visual indicators: See session counts
[active/busy/waiting]for each project
Navigation
- Project List: Select from all discovered git repositories
- Worktree Menu: Manage worktrees for the selected project
- Session View: Interact with your AI assistant
Use B key to navigate back from worktrees to project list.
For detailed configuration and usage, see docs/multi-project.md.
Git Worktree Configuration
CCManager can display enhanced git status information for each worktree when Git's worktree configuration extension is enabled.
# Enable enhanced status tracking
git config extensions.worktreeConfig true
With this enabled, you'll see:
- File changes:
+10 -5(additions/deletions) - Commit tracking:
โ3 โ1(ahead/behind parent branch) - Parent branch context: Shows which branch the worktree was created from
For complete setup instructions and troubleshooting, see docs/git-worktree-config.md.
Development
# Install dependencies
npm install
# Run in development mode
bun run dev
# Build
bun run build
# Run tests
npm test
# Run linter
bun run lint
# Run type checker
bun run typecheck
Files in the repo
- .claude
- .claude-plugin
- .devcontainer
- .github
- .kiro
- bin
- docs
- npm
- plugins
- scripts
- src
- .editorconfig
- .gitattributes
- .gitignore
- .mise.toml
- .npmignore
- .prettierignore
- AGENTS.md
- bun.lock
- CLAUDE.md
- eslint.config.js
- LICENSE
- package.json
- README.md
- shortcuts.example.json
- tsconfig.json
- vitest.config.ts
Discussion (0)
Ask about usage, or say what you built with itSign in to join the discussion.
No comments yet. Be the first to say what this is good for.
More tools
The best-benchmarked open-source AI memory system. And it's free.
Orca is the ADE for working with a fleet of parallel agents. Run any coding agent with your own subscription. Available on desktop, mobile and remote runtime.

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io
Never stop coding. Free MIT AI gateway: one endpoint, 352 providers (150+ free), 1200+ models Kimi, Claude, GPT, Gemini, GLM, DeepSeek, MiniMax. Works with Claude Code, Codex, Cursor, OpenCode, Cline & Copilot. Quota-aware auto-fallback, RTK+Caveman compression saves 15-95% tokens, MCP/A2A, Desktop/PWA. Built by 550+ contributors
Compress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.