I'm Rocha, and I manage coding agents. In practical terms, I'm a tmux-based session manager for Claude Code CLI.
- tmux
- Claude Code CLI (
claude) - git (optional, for worktree support)
- Download the latest binary from the Releases page
- Run
rocha setupto configure PATH and tmux integration - Source your shell config:
source ~/.zshrc(or~/.bashrc) - Launch with
rocha
Press n to create your first session, Enter to attach, Ctrl+Q to return to the list. Press ? for all key bindings.
Rocha is also a CLI tool with several commands. Run rocha --help to see all available options.
Set ROCHA_HOME to customize where rocha stores data:
export ROCHA_HOME=~/my-custom-rochaDefault: ~/.rocha
This directory contains:
state.db- Session databaseworktrees/- Git worktrees for sessionssettings.json- Configuration settings
- Command palette - Quick searchable access to all actions with Shift+O
- Switch between Claude sessions - Keep multiple conversations organized
- Shell sessions - Open a separate shell (⌨) for each Claude session
- Rename sessions - Give your sessions meaningful names
- Manual ordering - Organize sessions by moving them up/down
- Quick attach - Jump to sessions 1-7 with alt+number keys
- Editor integration - Open sessions directly in your editor
- Filter sessions - Search sessions by name or git branch
- Get sound alerts - Hear when Claude finishes and needs your input
- See status in tmux - Show active/waiting sessions in your status bar
- Session states - Track which sessions are working, idle, waiting, or exited
- Git worktree support - Each session can have its own isolated branch and workspace
- Git stats - See PR info, ahead/behind commits, and changes at a glance
- Token usage chart - View hourly input/output token usage across all sessions
- Per-session Claude config - Give each session its own Claude configuration directory
- Create sessions from any repo - Clone and start sessions from GitHub/GitLab URLs with specific branches
- Initial prompts - Start sessions with a predefined prompt that's automatically sent to Claude
Rocha automatically tracks the state of each Claude session using hooks:
- ● (green) - Working: Claude is actively processing a task
- ○ (yellow) - Idle: Claude finished its turn, ready for your next prompt
- ◐ (red) - Waiting: Claude is blocked on a UI interaction (form, permission dialog)
- ■ (gray) - Exited: Claude has exited the session
User submits prompt → working (●)
Claude finishes task → idle (○)
Claude shows AskUserQuestion form → waiting (◐)
User answers form → working (●)
Claude needs permission → waiting (◐)
Claude exits → exited (■)
idle (○) vs waiting (◐):
- idle: Claude finished, you type your next message in chat
- waiting: Claude is blocked on a UI element (form with buttons, permission dialog)
For example:
- Claude asks "What color?" in text → idle (○) (normal chat)
- Claude shows
[○ Red] [○ Blue]form → waiting (◐) (blocking UI)
?- show all key bindingsShift+O- open command palette for quick action accessn- new sessionCtrl+Q- return to session list (when inside a session)
Rocha allows customizing all keyboard shortcuts via settings.json or the CLI.
List all key bindings:
rocha settings keys list # Table format
rocha settings keys list --format json # JSON formatSet a custom binding:
rocha settings keys set archive A # Single key
rocha settings keys set up up,k,w # Multiple keysIn settings.json:
{
"keys": {
"archive": "A",
"up": ["up", "k", "w"]
}
}Conflicts are automatically detected and prevented.
When running in a git repository, rocha offers to create isolated worktrees for each session:
- Automatic detection - Detects git repos and prompts for worktree creation
- Isolated branches - Each session gets its own branch and working directory
- No conflicts - Work on multiple branches simultaneously without switching
- Auto cleanup - Worktrees are removed when you kill the session
Worktrees are stored in $ROCHA_HOME/worktrees/ (default: ~/.rocha/worktrees/).
You can create sessions from any git repository (GitHub, GitLab, etc.) without needing to clone it first:
# Create a session from a specific branch
# In the session form, enter:
https://github.com/owner/repo#branch-name
# Or use the default branch
https://github.com/owner/repo
# You can also use SSH URLs
git@github.com:owner/repo.git#developHow it works:
- Rocha clones the repository to
$ROCHA_HOME/worktrees/owner/repo/.main/(default:~/.rocha/worktrees/owner/repo/.main/) - Creates a worktree for your session from the specified branch
- Multiple sessions from the same repo share the
.maindirectory - Each session automatically switches
.mainto the correct branch before creating its worktree
Benefits:
- Start working on any project instantly without manual cloning
- Work on multiple branches from the same repo simultaneously
- Each session gets the correct base branch automatically
- No branch conflicts between sessions
Example workflow:
# Session 1: Work on the main branch
Repository: https://github.com/myorg/myapp#main
# Session 2: Work on a feature branch (same repo)
Repository: https://github.com/myorg/myapp#feature/new-ui
# Both sessions work independently with correct branches!Each session can have its own Claude configuration directory, allowing you to:
- Use different Claude accounts or API keys per session
- Isolate conversation history between projects
- Test different Claude settings without affecting other sessions
- Share Claude config with team members (stored in project directory)
Default behavior:
- All sessions use
~/.claudeby default - Sessions from the same repository automatically share the same Claude directory
Custom configuration: When creating a session, you can specify a custom Claude directory:
# In the session form, edit the "Claude directory" field:
/path/to/project/.claude
# Or use a shared team config
~/team-configs/project-a/.claudeEnvironment variable:
Rocha sets CLAUDE_CONFIG_DIR for each session, which Claude Code reads to determine where to store its configuration, history, and cache.
Use cases:
- Per-project isolation - Keep each project's Claude conversations separate
- Testing - Use a separate config for experimental sessions
- Team collaboration - Share Claude config files in your git repository
- Multiple accounts - Switch between different Claude accounts easily
Example:
# Work session using work Claude account
Claude directory: ~/.claude-work
# Personal project using personal account
Claude directory: ~/.claude-personal
# Project-specific (committed to git)
Claude directory: /path/to/project/.claudeThe rocha setup command adds session counts to your tmux status bar.
You'll see W:2 A:1 meaning 2 sessions waiting for input, 1 actively working.
Or add manually to ~/.tmux.conf:
set -g status-right "Claude: #(rocha status) | %H:%M"
set -g status-interval 1rocha --debug # Enable logging
rocha --help # More optionsLogs go to:
- Linux:
~/.local/state/rocha/ - macOS:
~/Library/Logs/rocha/ - Windows:
%LOCALAPPDATA%\rocha\logs\
- Go 1.23+
make install # Build and install to ~/.local/bin
make build # Build only
go build -o rocha . # Build with Go directlyCheck your installation:
rocha --versionmake test # Run all tests
make test-integration # Run integration tests
make test-integration-verbose # Run with no cache
make test-integration-run TEST=TestName # Run specific testCreate and push a version tag to trigger automated release:
git tag -a v1.0.0 -m "Release v1.0.0"
git push origin v1.0.0Test locally first:
make snapshot
./dist/rocha_linux_amd64_v1/rocha --versionGPL v3