A rigorous benchmarking framework for evaluating AI coding agents on real-world GitHub repositories. OpenCode Bench runs agents against production code changes and scores their outputs using multiple LLM judges across five key dimensions: API signature compliance, logic equivalence, integration correctness, test coverage, and project checks.
OPENCODE_API_KEY for OpenCode agentsOPENAI_API_KEY for Codex agentsANTHROPIC_API_KEY for Claude Code agentsbun install
bun run build
Run a benchmark evaluation:
orvl opencode --model opencode/claude-sonnet-4-5 --eval DataDog/datadog-lambda-python
Export results to JSON:
orvl opencode --model opencode/gpt-5-codex --eval DataDog/datadog-lambda-python --output results.json
Both --model and --eval are required. Each invocation executes three isolated episodes (fresh clones) and aggregates the judge scores before exporting results.
During development, run the CLI directly with Bun:
bun run dev -- opencode --model opencode/claude-sonnet-4-5 --eval <owner/repo>
OpenCode Bench evaluates AI coding agents by:
Each evaluation runs three isolated episodes to ensure statistical reliability. Episodes use fresh repository clones and independent judge assessments.
Each submission is evaluated across five weighted dimensions:
Weights are configurable per evaluation in dataset.yaml.
Scores are aggregated using a weighted variance-penalized approach. For a matrix S ∈ [0,1]^(m×k) where rows index judges and columns index score types, with judge weights w ∈ Δ^(m-1) and score weights v ∈ Δ^(k-1), the base score is:
R = v^T S^T w = Σ(j=1 to k) v_j ( Σ(i=1 to m) w_i s_ij )
To discourage judge disagreement, a variance penalty is applied:
R_pen = R - λ Σ(j=1 to k) v_j Var_j
where:
Var_j = Σ(i=1 to m) w_i (s_ij - s̄_j)²
s̄_j = Σ(i=1 to m) w_i s_ij
λ = 0.5 (disagreement penalty coefficient)
Implementation details are in lib/utils/scoreAggregation.ts and tested in tests/scoreAggregation.test.ts.
Currently uses three LLM judges with equal weighting: - claude-4.5 (Claude Sonnet 4.5 via Anthropic) - gpt-5-codex (GPT-5 Codex via OpenAI) - kimi (Kimi-k2 via Moonshot)
All judges use "Zen" model variants optimized for code evaluation.
bun run build
This compiles cli.ts to dist/cli.js with all necessary externals.
Run the full test suite:
bun test
Test judge consistency:
bun run test:consistency
Test score aggregation:
bun test tests/scoreAggregation.test.ts
agents/ # Agent integrations (OpenCode, Codex, Claude Code)
scores/ # Score dimension implementations
prompts/ # Task definitions per evaluation (YAML)
lib/ # Core framework utilities
tests/ # Test suite
dataset.yaml # Evaluation definitions
cli.ts # Main CLI orchestrator
The project uses GitHub Actions for CI/CD with automated benchmark publishing. Preview packages are published on every push via pkg.pr.new.
Contributions are welcome! Key areas for improvement:
benchmark-observations.md)benchmark-observations.md for analysis of scoring stability and improvement suggestionsnotes.md for methodology discussions and validation approaches$ claude mcp add opencode-bench \
-- python -m otcore.mcp_server <graph>