businessman
A CLI tool that spawns a tmux session with Claude Code and Ralph, designed for interactive AI-assisted development workflows.
Overview
businessman creates a dedicated tmux session with two panes:
- Pane 0: Runs Claude Code with the Businessman skill initialized
- Pane 1: A bash shell ready to run Ralph for autonomous coding tasks
The tool fetches available models from a llama-swap API endpoint, lets you select a model, and configures Claude Code with appropriate context window settings based on the model's capabilities.
Requirements
- Claude Code CLI (
claudecommand) - Open Ralph Wiggum (
ralphcommand) - for autonomous coding - tmux (for terminal multiplexing)
- jq (for JSON parsing)
- curl (for API requests)
Installation
- Clone this repository
- Run the installation script:
./install-businessman.sh - The script will:
- Prompt for your llama-swap API endpoint
- Install
businessmanto/usr/local/bin/businessman - Install the Businessman skill to
~/.claude/skills/businessman/SKILL.md
Usage
businessman [project-directory]
If no directory is specified, the current directory is used.
What happens when you run businessman:
- Connects to your llama-swap API endpoint to fetch available models
- Displays a list of models with their context lengths
- Prompts you to select a model
- Starts a new tmux session named
businessman-<timestamp> - Configures Claude Code with the selected model and context settings
- Attaches you to the session with Pane 0 ready for Claude interaction
API Endpoint Requirements
The businessman tool expects your llama-swap API endpoint to:
- Respond to
GET /v1/modelswith a JSON response containing:data[].id- The model identifierdata[].meta.llamaswap.context_length- The model's context window size (optional)
Example response format:
{
"data": [
{
"id": "llama-3.1-8b",
"meta": {
"llamaswap": {
"context_length": 8192
}
}
}
]
}
Environment Variables
businessman exports the following environment variables to the tmux session:
| Variable | Description |
|---|---|
ANTHROPIC_BASE_URL |
Set to your llama-swap API endpoint |
ANTHROPIC_AUTH_TOKEN |
Set to "dummy" (llama-swap doesn't require real auth) |
ANTHROPIC_DEFAULT_SONNET_MODEL |
Selected model ID |
ANTHROPIC_DEFAULT_HAIKU_MODEL |
Selected model ID |
ANTHROPIC_DEFAULT_OPUS_MODEL |
Selected model ID |
Context-Aware Settings
If the selected model has a context length:
| Context Size | Settings Applied |
|---|---|
| > 200,000 tokens | CLAUDE_CODE_DISABLE_1M_CONTEXT=0, CLAUDE_CODE_AUTO_COMPACT_WINDOW=200000 |
| <= 200,000 tokens | CLAUDE_CODE_DISABLE_1M_CONTEXT=1, CLAUDE_CODE_AUTO_COMPACT_WINDOW=<model-ctx> |
If no context length is available:
CLAUDE_CODE_DISABLE_1M_CONTEXT=1
The Businessman Skill
This tmux session is initialized with the Businessman skill, which provides:
- Interactive model selection via llama-swap
- Automatic tmux pane setup for Claude + Ralph workflows
- Context-aware Claude Code configuration
- Integration with Ralph for autonomous coding tasks
To use the skill manually, run:
claude "Use the businessman skill to initialize our session"
Tmux Session Management
- Pane 0: Claude Code (model selected during startup)
- Pane 1: Bash shell - ready to run Ralph commands
To detach from the tmux session: Ctrl+b then d
To reattach: tmux attach -t businessman-<timestamp> (see the startup message for the session name)
To list sessions: tmux ls
Ralph Integration
Once Ralph is installed, you can run autonomous tasks in Pane 1:
ralph --prompt-file ./prompt1.md --max-iterations 5 --agent claude-code
Use ralph --status to check progress, and ralph --add-context "..." to inject hints if needed.
License
MIT