Agent Configuration
This guide covers how to configure AI coding agents in RAPID.
Overview
Section titled “Overview”RAPID supports multiple AI coding agents. Each agent is configured in rapid.json under the agents section:
{ "agents": { "default": "claude", "available": { "claude": { ... }, "opencode": { ... }, "aider": { ... } } }}Agent Properties
Section titled “Agent Properties”Each agent configuration supports:
| Property | Type | Required | Description |
|---|---|---|---|
cli | string | Yes | Command to execute |
instructionFile | string | No | Path to instruction file |
envVars | array | No | Required environment variables |
installCmd | string | No | Installation command |
args | array | No | Additional CLI arguments |
Claude Code
Section titled “Claude Code”Anthropic’s AI coding assistant.
Installation
Section titled “Installation”npm install -g @anthropic-ai/claude-codeConfiguration
Section titled “Configuration”{ "agents": { "available": { "claude": { "cli": "claude", "instructionFile": "CLAUDE.md", "envVars": ["ANTHROPIC_API_KEY"], "installCmd": "npm install -g @anthropic-ai/claude-code" } } }}Required Secrets
Section titled “Required Secrets”{ "secrets": { "items": { "ANTHROPIC_API_KEY": "op://Development/Anthropic/api-key" } }}Instruction File (CLAUDE.md)
Section titled “Instruction File (CLAUDE.md)”# Project: my-project
## Overview
Brief description of the project.
## Code Style
- Language: TypeScript- Style guide: Airbnb- Formatting: Prettier
## Important Commands
- `npm run dev` - Start dev server- `npm test` - Run tests- `npm run build` - Build for production
## Architecture
Description of project structure.
## Restrictions
- Do not modify config files without asking- Always run tests after changesOpenCode
Section titled “OpenCode”Multi-provider AI coding assistant.
Installation
Section titled “Installation”npm install -g opencodeConfiguration
Section titled “Configuration”{ "agents": { "available": { "opencode": { "cli": "opencode", "instructionFile": "AGENTS.md", "envVars": ["ANTHROPIC_API_KEY", "OPENAI_API_KEY"], "installCmd": "npm install -g opencode" } } }}Required Secrets
Section titled “Required Secrets”{ "secrets": { "items": { "ANTHROPIC_API_KEY": "op://Development/Anthropic/api-key", "OPENAI_API_KEY": "op://Development/OpenAI/api-key" } }}Instruction File (AGENTS.md)
Section titled “Instruction File (AGENTS.md)”# Agent Instructions
## Project Type
Node.js/TypeScript REST API
## Key Files
- `src/index.ts` - Entry point- `src/routes/` - API routes- `src/services/` - Business logic
## Commands
- Test: `npm test`- Lint: `npm run lint`- Build: `npm run build`
## Guidelines
- Use async/await for async operations- Add JSDoc comments to exported functions- Write tests for new featuresAI pair programming tool.
Installation
Section titled “Installation”pip install aider-chatConfiguration
Section titled “Configuration”{ "agents": { "available": { "aider": { "cli": "aider", "instructionFile": ".aider.conf.yml", "envVars": ["OPENAI_API_KEY"], "installCmd": "pip install aider-chat", "args": ["--model", "gpt-4o"] } } }}Required Secrets
Section titled “Required Secrets”{ "secrets": { "items": { "OPENAI_API_KEY": "op://Development/OpenAI/api-key" } }}Configuration File (.aider.conf.yml)
Section titled “Configuration File (.aider.conf.yml)”model: gpt-4oauto-commits: truegitignore: truemap-tokens: 1024dark-mode: trueUsing Anthropic Models
Section titled “Using Anthropic Models”{ "agents": { "available": { "aider": { "cli": "aider", "envVars": ["ANTHROPIC_API_KEY"], "args": ["--model", "claude-3-5-sonnet-20241022"] } } }}GitHub Copilot CLI
Section titled “GitHub Copilot CLI”GitHub’s AI assistant.
Installation
Section titled “Installation”gh extension install github/gh-copilotConfiguration
Section titled “Configuration”{ "agents": { "available": { "copilot": { "cli": "gh", "args": ["copilot"], "envVars": ["GITHUB_TOKEN"], "installCmd": "gh extension install github/gh-copilot" } } }}Required Secrets
Section titled “Required Secrets”{ "secrets": { "items": { "GITHUB_TOKEN": "op://Development/GitHub/pat" } }}Custom Agents
Section titled “Custom Agents”Add any CLI-based AI tool:
{ "agents": { "available": { "my-custom-agent": { "cli": "my-ai-tool", "instructionFile": "MY_AGENT.md", "envVars": ["MY_API_KEY"], "installCmd": "npm install -g my-ai-tool", "args": ["--config", ".my-ai-config.json"] } } }}Multi-Agent Setup
Section titled “Multi-Agent Setup”Configure multiple agents for different tasks:
{ "agents": { "default": "claude", "available": { "claude": { "cli": "claude", "instructionFile": "CLAUDE.md", "envVars": ["ANTHROPIC_API_KEY"] }, "aider": { "cli": "aider", "args": ["--model", "gpt-4o"], "envVars": ["OPENAI_API_KEY"] }, "opencode": { "cli": "opencode", "instructionFile": "AGENTS.md", "envVars": ["ANTHROPIC_API_KEY"] } } }}Running Multiple Agents
Section titled “Running Multiple Agents”# Launch all in tmux panesrapid dev --multi
# Specific agentsrapid dev --multi --agents claude,aiderEnvironment Variables
Section titled “Environment Variables”Agents receive environment variables in this order:
- System environment
- Container environment (
containerEnvin devcontainer.json) - RAPID secrets (from 1Password/Vault)
- Agent-specific overrides
Switching Agents
Section titled “Switching Agents”Temporarily
Section titled “Temporarily”# Use different agent for this sessionrapid dev --agent aiderPermanently
Section titled “Permanently”# Change defaultrapid agent default opencode
# Or edit rapid.json{ "agents": { "default": "opencode" }}Troubleshooting
Section titled “Troubleshooting”Agent not found
Section titled “Agent not found”# Check if installedwhich claudewhich aider
# Reinstallrapid start --reinstall-toolsAPI key errors
Section titled “API key errors”# Verify secretsrapid secrets verify
# Check specific secretrapid secrets get ANTHROPIC_API_KEYWrong model
Section titled “Wrong model”Check the agent’s args in rapid.json:
{ "aider": { "args": ["--model", "gpt-4o"] // Verify model name }}Best Practices
Section titled “Best Practices”-
Use specific agents for specific tasks
- Claude: Complex reasoning, architecture
- Aider: Quick refactoring, auto-commits
- OpenCode: Multi-model flexibility
-
Keep instruction files concise
- Focus on project-specific info
- Don’t duplicate README content
- Update when architecture changes
-
Secure your API keys
- Never commit keys to git
- Use 1Password or Vault
- Rotate keys periodically
-
Test agent availability
Terminal window rapid status