136 lines
4.2 KiB
Markdown
136 lines
4.2 KiB
Markdown
# 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](#businessman-skill) initialized
|
|
- **Pane 1**: A bash shell ready to run [Ralph](https://github.com/Th0rgal/open-ralph-wiggum) for autonomous coding tasks
|
|
|
|
The tool fetches available models from a [llama-swap](https://github.com/dotcross/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](https://claude.ai/download) (`claude` command)
|
|
- [Open Ralph Wiggum](https://github.com/Th0rgal/open-ralph-wiggum) (`ralph` command) - for autonomous coding
|
|
- [tmux](https://github.com/tmux/tmux) (for terminal multiplexing)
|
|
- [jq](https://stedolan.github.io/jq/) (for JSON parsing)
|
|
- [curl](https://curl.se/) (for API requests)
|
|
|
|
## Installation
|
|
|
|
1. Clone this repository
|
|
2. Run the installation script:
|
|
```bash
|
|
./install-businessman.sh
|
|
```
|
|
3. The script will:
|
|
- Prompt for your llama-swap API endpoint
|
|
- Install `businessman` to `/usr/local/bin/businessman`
|
|
- Install the Businessman skill to `~/.claude/skills/businessman/SKILL.md`
|
|
|
|
## Usage
|
|
|
|
```bash
|
|
businessman [project-directory]
|
|
```
|
|
|
|
If no directory is specified, the current directory is used.
|
|
|
|
### What happens when you run `businessman`:
|
|
|
|
1. Connects to your llama-swap API endpoint to fetch available models
|
|
2. Displays a list of models with their context lengths
|
|
3. Prompts you to select a model
|
|
4. Starts a new tmux session named `businessman-<timestamp>`
|
|
5. Configures Claude Code with the selected model and context settings
|
|
6. 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/models` with a JSON response containing:
|
|
- `data[].id` - The model identifier
|
|
- `data[].meta.llamaswap.context_length` - The model's context window size (optional)
|
|
|
|
Example response format:
|
|
```json
|
|
{
|
|
"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:
|
|
|
|
```bash
|
|
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
|