Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
132 changes: 124 additions & 8 deletions docs/llms.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@

> Lightning-fast tmux workspace manager for multi-repo development

Crabcode creates isolated development workspaces using git worktrees and tmux. Each workspace gets its own branch, ports, and tmux layout. Switch between tasks instantly without losing context.
Crabcode creates isolated development workspaces using git worktrees and tmux. Each workspace gets its own branch, ports, and tmux layout. Manage multiple projects from a single install. Switch between tasks instantly without losing context.

## Installation

```bash
# Prerequisites
brew install tmux yq zip # macOS
# apt install tmux yq zip # Linux
brew install tmux yq zip gh # macOS
# apt install tmux yq zip gh # Linux

# Install crabcode
curl -fsSL https://raw.githubusercontent.com/promptfoo/crabcode/main/install.sh | bash
Expand All @@ -26,8 +26,9 @@ curl -fsSL https://raw.githubusercontent.com/promptfoo/crabcode/main/install.sh

```bash
cd ~/Dev/my-project
crab init # 2 questions: repo path + workspace dir
crab init # 3 questions: repo path, alias, workspace dir
crab config scan # auto-detect .env files and ports
crab ws 1 # start first workspace
```

## Usage
Expand All @@ -42,14 +43,76 @@ crab restart # Reset git + restart panes
crab cleanup # Full teardown, reset to origin/main
```

### Multi-Project

Manage multiple repos from a single crabcode install. Each project gets an alias.

```bash
crab @pf ws 1 # Open workspace 1 for project "pf"
crab @cb config # Show config for project "cb"
crab ws 1 # Uses default project (or detects from cwd)
crab projects # List all registered projects
crab projects rm <alias> # Remove a project registration
crab default pf # Set default project
```

Project configs live in `~/.crabcode/projects/<alias>.yaml`. Commands auto-detect which project you're in based on cwd.

### Save & Restore Work

```bash
crab wip save # Save current changes
crab wip save --restart # Save then restart workspace
crab wip --continue # Restore most recent saved state
crab wip --resume # Interactive selection of saved states
crab wip ls # List all saved states
crab wip ls # List all saved states globally
```

### PR Review & Court

Two modes for reviewing pull requests:

```bash
# Quick single-agent review
crab review 3230 # PR number
crab review promptfoo#456 # Submodule PR
crab review https://github.com/... # Full URL

# Court review - multi-agent tribunal with judge pattern
crab court 3230 # Judge + 2 reviewers
```

Court review uses the judge pattern: a Judge (Claude) orchestrates two independent reviewers (Claude teammate + Codex), verifies every finding against actual code, resolves disagreements, and delivers a verdict with zero false positives.

```bash
crab review ls # List review sessions
crab review show <PR> # View saved review output
crab review resume <PR> # Resume a review
crab review delete <PR> # Delete a review session
crab review delete --all # Delete all review sessions
```

### Ticket Integration

Create workspaces from Linear ticket identifiers with automatic context injection:

```bash
crab ticket ENG-123 # Provision workspace from ticket
crab ws 3 ticket ENG-123 # Bind ticket to specific workspace
```

### P2P Messaging

Peer-to-peer messaging via self-hosted relay server:

```bash
crab msg start # Start relay server
crab msg @user "message" # Send message to peer
crab msg read # View inbox
crab msg listen # Real-time message stream
crab msg say on/off # Toggle text-to-speech for incoming messages
crab msg history # View message history
crab msg stop # Stop relay server
```

### Share Files
Expand All @@ -58,6 +121,7 @@ crab wip ls # List all saved states
crab tk share <path> # Upload → temp URL
crab tk share <path> --to slack:#channel # Share to Slack
crab tk share <path> --to ssh:user@host # SSH transfer
crab tk share <path> --to email:addr # Email attachment
crab tk share <path> --serve # Local HTTP + QR code
```

Expand All @@ -69,14 +133,38 @@ crab slack #channel "message" # Post to channel
crab slack read @user # View recent messages
crab slack chat @user # Interactive terminal chat
crab slack sent # View sent messages log
crab slack users # List workspace users
```

Requires `slack.bot_token` in `~/.crabcode/config.yaml`.
Requires `slack.bot_token` in project config.

### Command Aliases

Define custom shorthand for frequently-used workflows:

```bash
crab alias set rr restart # Set alias
crab alias set d "ws 1" # Multi-word commands
crab alias # List all aliases
crab alias rm rr # Remove alias
```

### Session Management

Track and resume named Claude conversations:

```bash
crab session ls # List sessions
crab session start "name" # Start named session
crab session resume "name" # Resume existing session
crab session delete "name" # Delete a session
```

### Other Commands

```bash
crab config # Show current configuration
crab config scan # Auto-detect .env files and ports
crab ports # Show port usage across workspaces
crab shared # Show shared volume info
crab doctor # Diagnose issues
Expand All @@ -85,13 +173,30 @@ crab cheat # Show cheat sheet

## Configuration

Config file: `~/.crabcode/config.yaml`
```
~/.crabcode/
config.yaml # global prefs (default_project, aliases)
projects/
pf.yaml # per-project config
cb.yaml # per-project config
wip/
pf/ # per-project WIP isolation
cb/
sessions/
pf/ # per-project session storage
```

Per-project config (`~/.crabcode/projects/<alias>.yaml`):

```yaml
session_name: crab
session_name: pf
workspace_base: ~/Dev/my-project-workspaces
main_repo: ~/Dev/my-project

workspaces:
prefix: ws
branch_pattern: workspace-{N}

# Port isolation (auto-detected by 'crab config scan')
env_sync:
files:
Expand Down Expand Up @@ -128,6 +233,9 @@ slack:
- **WIP**: Save/restore your uncommitted changes across workspace resets
- **Shared Volume**: A `.local/` folder that persists across resets for experiments
- **Port Isolation**: Each workspace gets offset ports (ws1: 3001, ws2: 3002, etc.)
- **Court Review**: Multi-agent PR review using the judge pattern (judge + 2 reviewers)
- **P2P Messaging**: Self-hosted relay for developer-to-developer messaging with TTS
- **Command Aliases**: User-defined shorthand stored in global config

## Tmux Layout

Expand All @@ -147,6 +255,14 @@ Keybindings (prefix: `Ctrl+a`):
- `Ctrl+a z` - Toggle zoom
- `Option+arrows` - Navigate panes

## Requirements

**Core:** bash, tmux, git, [yq](https://github.com/mikefarah/yq), zip

**For PR reviews:** [gh](https://cli.github.com/) (GitHub CLI), [Claude Code](https://claude.ai/code) (`claude` CLI)

**Optional:** [Codex CLI](https://github.com/openai/codex) (for court review with Codex reviewer)

## Links

- Website: https://crabcode.dev
Expand Down