Skip to content

Agent Configuration

This guide covers how to configure AI coding agents in RAPID.

RAPID supports multiple AI coding agents. Each agent is configured in rapid.json under the agents section:

{
"agents": {
"default": "claude",
"available": {
"claude": { ... },
"opencode": { ... },
"aider": { ... }
}
}
}

Each agent configuration supports:

PropertyTypeRequiredDescription
clistringYesCommand to execute
instructionFilestringNoPath to instruction file
envVarsarrayNoRequired environment variables
installCmdstringNoInstallation command
argsarrayNoAdditional CLI arguments

Anthropic’s AI coding assistant.

Terminal window
npm install -g @anthropic-ai/claude-code
{
"agents": {
"available": {
"claude": {
"cli": "claude",
"instructionFile": "CLAUDE.md",
"envVars": ["ANTHROPIC_API_KEY"],
"installCmd": "npm install -g @anthropic-ai/claude-code"
}
}
}
}
{
"secrets": {
"items": {
"ANTHROPIC_API_KEY": "op://Development/Anthropic/api-key"
}
}
}
# 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 changes

Multi-provider AI coding assistant.

Terminal window
npm install -g opencode
{
"agents": {
"available": {
"opencode": {
"cli": "opencode",
"instructionFile": "AGENTS.md",
"envVars": ["ANTHROPIC_API_KEY", "OPENAI_API_KEY"],
"installCmd": "npm install -g opencode"
}
}
}
}
{
"secrets": {
"items": {
"ANTHROPIC_API_KEY": "op://Development/Anthropic/api-key",
"OPENAI_API_KEY": "op://Development/OpenAI/api-key"
}
}
}
# 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 features

AI pair programming tool.

Terminal window
pip install aider-chat
{
"agents": {
"available": {
"aider": {
"cli": "aider",
"instructionFile": ".aider.conf.yml",
"envVars": ["OPENAI_API_KEY"],
"installCmd": "pip install aider-chat",
"args": ["--model", "gpt-4o"]
}
}
}
}
{
"secrets": {
"items": {
"OPENAI_API_KEY": "op://Development/OpenAI/api-key"
}
}
}
model: gpt-4o
auto-commits: true
gitignore: true
map-tokens: 1024
dark-mode: true
{
"agents": {
"available": {
"aider": {
"cli": "aider",
"envVars": ["ANTHROPIC_API_KEY"],
"args": ["--model", "claude-3-5-sonnet-20241022"]
}
}
}
}

GitHub’s AI assistant.

Terminal window
gh extension install github/gh-copilot
{
"agents": {
"available": {
"copilot": {
"cli": "gh",
"args": ["copilot"],
"envVars": ["GITHUB_TOKEN"],
"installCmd": "gh extension install github/gh-copilot"
}
}
}
}
{
"secrets": {
"items": {
"GITHUB_TOKEN": "op://Development/GitHub/pat"
}
}
}

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"]
}
}
}
}

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"]
}
}
}
}
Terminal window
# Launch all in tmux panes
rapid dev --multi
# Specific agents
rapid dev --multi --agents claude,aider

Agents receive environment variables in this order:

  1. System environment
  2. Container environment (containerEnv in devcontainer.json)
  3. RAPID secrets (from 1Password/Vault)
  4. Agent-specific overrides

Terminal window
# Use different agent for this session
rapid dev --agent aider
Terminal window
# Change default
rapid agent default opencode
# Or edit rapid.json
{
"agents": {
"default": "opencode"
}
}

Terminal window
# Check if installed
which claude
which aider
# Reinstall
rapid start --reinstall-tools
Terminal window
# Verify secrets
rapid secrets verify
# Check specific secret
rapid secrets get ANTHROPIC_API_KEY

Check the agent’s args in rapid.json:

{
"aider": {
"args": ["--model", "gpt-4o"] // Verify model name
}
}

  1. Use specific agents for specific tasks

    • Claude: Complex reasoning, architecture
    • Aider: Quick refactoring, auto-commits
    • OpenCode: Multi-model flexibility
  2. Keep instruction files concise

    • Focus on project-specific info
    • Don’t duplicate README content
    • Update when architecture changes
  3. Secure your API keys

    • Never commit keys to git
    • Use 1Password or Vault
    • Rotate keys periodically
  4. Test agent availability

    Terminal window
    rapid status