|
| 1 | +# Claude Code Configuration |
| 2 | + |
| 3 | +This directory contains configuration for using this project with Claude Code, particularly in the online environment. |
| 4 | + |
| 5 | +## SessionStart Hook |
| 6 | + |
| 7 | +The `hooks/SessionStart` script automatically runs when a new Claude Code session begins. It: |
| 8 | + |
| 9 | +1. **Installs pixi** (if not already installed) - The package and environment manager |
| 10 | +2. **Installs project dependencies** - All Python packages and tools defined in `pyproject.toml` |
| 11 | +3. **Sets up prek hooks** - For automatic code quality checks |
| 12 | +4. **Configures git** - Sets up merge drivers for lockfiles |
| 13 | + |
| 14 | +## Usage with Claude Code Online |
| 15 | + |
| 16 | +When you start a Claude Code online session, the SessionStart hook will automatically run and set up your environment. You'll see output indicating the setup progress. |
| 17 | + |
| 18 | +### Available Commands |
| 19 | + |
| 20 | +Once setup is complete, Claude can use these pixi tasks: |
| 21 | + |
| 22 | +#### Testing & Quality |
| 23 | +- `pixi run test` - Run pytest tests |
| 24 | +- `pixi run coverage` - Run tests with coverage report |
| 25 | +- `pixi run lint` - Run ruff and pylint linters |
| 26 | +- `pixi run format` - Format code with ruff |
| 27 | + |
| 28 | +#### CI Tasks |
| 29 | +- `pixi run ci` - Run full CI pipeline (format, lint, test, coverage) |
| 30 | +- `pixi run fix` - Auto-fix common issues (update lock, format, lint) |
| 31 | + |
| 32 | +#### Prek Hooks |
| 33 | +- `pixi run prek` - Run all prek hooks |
| 34 | +- `pixi run prek-update` - Update prek hook versions |
| 35 | + |
| 36 | +### How It Works |
| 37 | + |
| 38 | +1. **First session**: The hook installs pixi and all dependencies (may take a few minutes) |
| 39 | +2. **Subsequent sessions**: The hook verifies the environment is ready (much faster) |
| 40 | +3. **Environment activated**: All pixi commands are available to Claude |
| 41 | + |
| 42 | +### Troubleshooting |
| 43 | + |
| 44 | +If you encounter issues: |
| 45 | + |
| 46 | +1. **Dependencies not found**: Run `pixi install` manually |
| 47 | +2. **Lockfile conflicts**: Run `pixi run update-lock` |
| 48 | +3. **Prek issues**: Run `pixi run prek-update` |
| 49 | +4. **Full reset**: Delete `.pixi` directory and restart session |
| 50 | + |
| 51 | +### Customization |
| 52 | + |
| 53 | +You can modify `hooks/SessionStart` to: |
| 54 | +- Install additional tools |
| 55 | +- Run custom setup scripts |
| 56 | +- Configure environment variables |
| 57 | +- Set up external services |
| 58 | + |
| 59 | +## Ralph Orchestrator |
| 60 | + |
| 61 | +This project includes [ralph-orchestrator](https://github.com/mikeyobrien/ralph-orchestrator), an autonomous agent orchestrator for managing complex multi-step tasks. |
| 62 | + |
| 63 | +### Installation |
| 64 | + |
| 65 | +Ralph is installed as a pixi dependency. After running `pixi install`, it's available in the environment. |
| 66 | + |
| 67 | +### Basic Usage |
| 68 | + |
| 69 | +```bash |
| 70 | +# Initialize ralph (creates ralph.yml and PROMPT.md if not present) |
| 71 | +pixi run ralph init |
| 72 | + |
| 73 | +# Plan a task (creates a spec file) |
| 74 | +pixi run ralph plan "Implement feature X" |
| 75 | + |
| 76 | +# Run ralph with the current PROMPT.md |
| 77 | +pixi run ralph run |
| 78 | + |
| 79 | +# Check ralph version |
| 80 | +pixi run ralph --version |
| 81 | +``` |
| 82 | + |
| 83 | +### Configuration Files |
| 84 | + |
| 85 | +- `ralph.yml` - Main configuration (event loop, hats, backends) |
| 86 | +- `PROMPT.md` - Task description for ralph to execute |
| 87 | +- `specs/` - Directory for task specifications |
| 88 | + |
| 89 | +### Customization |
| 90 | + |
| 91 | +Edit `ralph.yml` to customize: |
| 92 | +- `event_loop.max_iterations` - Maximum iterations before stopping |
| 93 | +- `event_loop.max_runtime_seconds` - Maximum runtime |
| 94 | +- `cli.backend` - AI backend (claude, gemini, codex, etc.) |
| 95 | +- `hats` - Define custom personas for multi-agent workflows |
| 96 | + |
| 97 | +See the [ralph-orchestrator documentation](https://github.com/mikeyobrien/ralph-orchestrator) for more details. |
| 98 | + |
| 99 | +## Learn More |
| 100 | + |
| 101 | +- [Claude Code Documentation](https://docs.claude.com/claude-code) |
| 102 | +- [Pixi Documentation](https://pixi.sh) |
| 103 | +- [Ralph Orchestrator](https://github.com/mikeyobrien/ralph-orchestrator) |
| 104 | +- [Project README](../README.md) |
0 commit comments