Skip to main content

Overview

Forge supports 8 different AI coding agents - giving you the freedom to choose the best tool for each task. This is the core of Forge’s BYOL (Bring Your Own LLM) philosophy.

The Agent Landscape


Supported Agents

Commercial API-Based

Open Source & Local

LLM-Agnostic

Claude Code Router

Type: LLM proxy Use: Any OpenAI-compatible API Best for: Flexibility, vendor independence Cost: Varies by backendRoute to ANY model - OpenAI, Anthropic, local, custom

Amp

By: Sourcegraph Type: Code intelligence Best for: Large codebase navigation Cost: Based on usageExcels at understanding existing code

Choosing the Right Agent

By Task Type

Task TypeBest AgentWhy
Complex ArchitectureClaude Sonnet/OpusSuperior reasoning
Quick FixesGemini FlashFastest, free
UI ComponentsCursorUI/UX intuition
RefactoringClaude SonnetMaintains coherence
TestingClaude/GPT-4Comprehensive coverage
DocumentationGPT-4Clear writing
Privacy-CriticalOpenCode/QwenRuns locally
ExperimentationGeminiFree tier, fast

By Budget

💰 Budget-Conscious:
  1. Gemini Flash (free tier!)
  2. OpenCode (local, free)
  3. GPT-3.5 Turbo (cheap)
💵 Balanced:
  1. Claude Haiku (fast + cheap)
  2. Gemini Pro
  3. Cursor (subscription)
💎 Premium:
  1. Claude Opus (best quality)
  2. GPT-4 Turbo
  3. Claude Sonnet

By Context Window

AgentContextBest For
Gemini 1.5 Pro2M tokensMassive codebases
Claude 3.5200K tokensLarge projects
GPT-4 Turbo128K tokensStandard projects
GPT-3.516K tokensSmall files

Agent Comparison

Speed vs Quality

Quality

  │     Claude Opus ●
  │            Claude Sonnet ●
  │                    GPT-4 ●
  │                         Cursor ●
  │                              Claude Haiku ●
  │                                   Gemini Pro ●
  │                                        GPT-3.5 ●
  │                                             Gemini Flash ●
  └──────────────────────────────────────────────────────────→
                                                          Speed

Cost vs Capability

Capability

  │     Claude Opus ●
  │            GPT-4 ●
  │                Claude Sonnet ●
  │                     Gemini Pro ●
  │                          Claude Haiku ●
  │                               GPT-3.5 ●
  │                                    Gemini Flash ●
  │                                         OpenCode/Qwen ●
  └──────────────────────────────────────────────────────────→
                                                          Cost
                                                      (cheaper)

Real-World Performance

Benchmark: “Add JWT Authentication”

Same task, different agents:
╭───────────┬──────────┬─────────┬────────┬───────╮
│ Agent     │ Duration │ Quality │ Tests  │ Cost  │
├───────────┼──────────┼─────────┼────────┼───────┤
│ Claude S  │ 5m 22s   │ A+      │ 95%    │ $0.23 │
│ Gemini F  │ 2m 15s   │ B+      │ 78%    │ $0.00 │
│ GPT-4     │ 6m 01s   │ A       │ 88%    │ $0.45 │
│ Cursor    │ 4m 18s   │ A-      │ 85%    │ $0.19 │
│ OpenCode  │ 8m 33s   │ B       │ 70%    │ $0.00 │
╰───────────┴──────────┴─────────┴────────┴───────╯

Winner: Claude Sonnet (best balance)
Budget: Gemini Flash (free!)
Speed: Gemini Flash (2m 15s)

Switching Between Agents

One of Forge’s superpowers: try multiple agents on the same task!
# Start with fast, cheap agent
forge task create "Add authentication" --llm gemini

# If not satisfied, try Claude
forge task fork 1 --llm claude

# Compare results
forge task compare 1

# Choose winner
forge task merge 1 --attempt 2

Agent Configuration

Quick Setup

See detailed setup for each agent:

Configuration File

.forge/config.json:
{
  "llms": {
    "claude": {
      "apiKey": "sk-ant-...",
      "model": "claude-3-5-sonnet-20241022"
    },
    "gemini": {
      "apiKey": "AIza...",
      "model": "gemini-2.0-flash-exp"
    },
    "openai": {
      "apiKey": "sk-...",
      "model": "gpt-4-turbo"
    },
    "cursor": {
      "enabled": true
    }
  }
}

Specialized Agent Profiles

Apply “personas” to any base agent:
# Security-focused Claude
forge task create "Add auth" \
  --llm claude \
  --agent "security-expert"

# Test-focused Gemini
forge task create "Add feature" \
  --llm gemini \
  --agent "test-writer"

# Performance-focused GPT-4
forge task create "Optimize query" \
  --llm openai \
  --agent "performance-optimizer"
See Specialized Agents for details.

Agent Strengths & Weaknesses

Claude Code

Strengths ✅:
  • Complex reasoning
  • System design
  • Edge case handling
  • Clear explanations
Weaknesses ⚠️:
  • Can be verbose
  • Sometimes over-engineers
  • More expensive
Best for: Architecture, refactoring, security

Gemini

Strengths ✅:
  • Blazing fast
  • Free tier (!)
  • Good for simple tasks
  • Concise code
Weaknesses ⚠️:
  • May miss edge cases
  • Less sophisticated reasoning
  • Shorter responses
Best for: Quick fixes, iteration, experimentation

Cursor CLI

Strengths ✅:
  • Great UI/UX intuition
  • Fast iterations
  • Context-aware
  • Good for frontend
Weaknesses ⚠️:
  • Subscription required
  • Less depth on algorithms
  • Tied to Cursor ecosystem
Best for: UI components, rapid prototyping

OpenAI Codex (GPT-4)

Strengths ✅:
  • Reliable and consistent
  • Well-documented
  • Good all-rounder
  • Strong community
Weaknesses ⚠️:
  • Expensive
  • Slower than alternatives
  • Nothing exceptional
Best for: General coding, documentation

Open Source (OpenCode/Qwen)

Strengths ✅:
  • Fully local
  • Privacy guaranteed
  • Free (your hardware)
  • No rate limits
Weaknesses ⚠️:
  • Slower
  • Lower quality
  • Requires powerful hardware
  • More setup needed
Best for: Privacy-sensitive, learning, cost control

Multi-Agent Workflows

Sequential Workflow

Use different agents for different stages:
# 1. Design with Claude (best at architecture)
forge task create "Build payment system" --llm claude

# 2. Implement with Cursor (fast iteration)
forge task create "Build UI components" --llm cursor

# 3. Test with GPT-4 (comprehensive tests)
forge task create "Add integration tests" --llm openai

# 4. Document with Gemini (fast, cheap)
forge task create "Write API docs" --llm gemini

Parallel Comparison

Run multiple agents simultaneously:
# Try 3 agents at once
forge task create "Optimize database query" --llm claude &
forge task fork 1 --llm gemini &
forge task fork 1 --llm openai &

wait

# Compare and choose best
forge task compare 1

Cost Tracking

Monitor spending per agent:
# This month's costs
forge cost summary --month january

# Output:
╭──────────┬─────────┬────────╮
 Agent Tasks Cost
├──────────┼─────────┼────────┤
 Claude 24 $5.67
 Gemini 48 $0.00
 GPT-4 12 $8.23
 Cursor 15 (sub)  │
╰──────────┴─────────┴────────╯
Total: $13.90

Best Practices

Start with Free Tier

Begin with Gemini Flash (free!) to validate approach, then use premium agents for refinement

Match Agent to Task

Don’t use Claude Opus for simple fixes. Don’t use Gemini Flash for architecture.

Learn Agent Strengths

Track which agent works best for which task types in your codebase

Keep Options Open

Configure multiple agents. Vendor lock-in is the enemy of productivity.

Troubleshooting

Error: “Agent ‘claude’ not configured”Solution:
  • Check .forge/config.json has API key
  • Verify API key is valid
  • Run forge config validate
Issue: Even “fast” agents are slowPossible causes:
  • Network latency
  • Large context window
  • Complex task description
Solutions:
  • Check internet speed
  • Reduce context
  • Simplify task description
Issue: Same task, different results each timeThis is normal!AI is non-deterministic. Use temperature=0 for more consistency:
{
  "llms": {
    "claude": {
      "temperature": 0
    }
  }
}

Next Steps