$npx -y skills add NeoLabHQ/context-engineering-kit --skill agent-evaluationEvaluate and improve Claude Code commands, skills, and agents. Use when testing prompt effectiveness, validating context engineering choices, or measuring improvement quality.
| 1 | # Evaluation Methods for Claude Code Agents |
| 2 | |
| 3 | Evaluation of agent systems requires different approaches than traditional software or even standard language model applications. Agents make dynamic decisions, are non-deterministic between runs, and often lack single correct answers. Effective evaluation must account for these characteristics while providing actionable feedback. A robust evaluation framework enables continuous improvement, catches regressions, and validates that context engineering choices achieve intended effects. |
| 4 | |
| 5 | ## Core Concepts |
| 6 | |
| 7 | Agent evaluation requires outcome-focused approaches that account for non-determinism and multiple valid paths. Multi-dimensional rubrics capture various quality aspects: factual accuracy, completeness, citation accuracy, source quality, and tool efficiency. LLM-as-judge provides scalable evaluation while human evaluation catches edge cases. |
| 8 | |
| 9 | The key insight is that agents may find alternative paths to goals—the evaluation should judge whether they achieve right outcomes while following reasonable processes. |
| 10 | |
| 11 | **Performance Drivers: The 95% Finding** |
| 12 | Research on the BrowseComp evaluation (which tests browsing agents' ability to locate hard-to-find information) found that three factors explain 95% of performance variance: |
| 13 | |
| 14 | | Factor | Variance Explained | Implication | |
| 15 | |--------|-------------------|-------------| |
| 16 | | Token usage | 80% | More tokens = better performance | |
| 17 | | Number of tool calls | ~10% | More exploration helps | |
| 18 | | Model choice | ~5% | Better models multiply efficiency | |
| 19 | |
| 20 | Implications for Claude Code development: |
| 21 | |
| 22 | - **Token budgets matter**: Evaluate with realistic token constraints |
| 23 | - **Model upgrades beat token increases**: Upgrading models provides larger gains than increasing token budgets |
| 24 | - **Multi-agent validation**: Validates architectures that distribute work across subagents with separate context windows |
| 25 | |
| 26 | ## Evaluation Challenges |
| 27 | |
| 28 | ### Non-Determinism and Multiple Valid Paths |
| 29 | |
| 30 | Agents may take completely different valid paths to reach goals. One agent might search three sources while another searches ten. They might use different tools to find the same answer. Traditional evaluations that check for specific steps fail in this context. |
| 31 | |
| 32 | **Solution**: The solution is outcomes, not exact execution paths. Judge whether the agent achieves the right result through a reasonable process. |
| 33 | |
| 34 | ### Context-Dependent Failures |
| 35 | |
| 36 | Agent failures often depend on context in subtle ways. An agent might succeed on complex queries but fail on simple ones. It might work well with one tool set but fail with another. Failures may emerge only after extended interaction when context accumulates. |
| 37 | |
| 38 | **Solution**: Evaluation must cover a range of complexity levels and test extended interactions, not just isolated queries. |
| 39 | |
| 40 | ### Composite Quality Dimensions |
| 41 | |
| 42 | Agent quality is not a single dimension. It includes factual accuracy, completeness, coherence, tool efficiency, and process quality. An agent might score high on accuracy but low in efficiency, or vice versa. |
| 43 | |
| 44 | An agent might score high on accuracy but low in efficiency. |
| 45 | |
| 46 | **Solution**: Evaluation rubrics must capture multiple dimensions with appropriate weighting for the use case. |
| 47 | |
| 48 | ## Evaluation Rubric Design |
| 49 | |
| 50 | ### Multi-Dimensional Rubric |
| 51 | |
| 52 | Effective rubrics cover key dimensions with descriptive levels: |
| 53 | |
| 54 | **Instruction Following** (weight: 0.30) |
| 55 | |
| 56 | - Excellent (1.0): All instructions followed precisely |
| 57 | - Good (0.8): Minor deviations that don't affect outcome |
| 58 | - Acceptable (0.6): Major instructions followed, minor ones missed |
| 59 | - Poor (0.3): Significant instructions ignored |
| 60 | - Failed (0.0): Fundamentally misunderstood the task |
| 61 | |
| 62 | **Output Completeness** (weight: 0.25) |
| 63 | |
| 64 | - Excellent: All requested aspects thoroughly covered |
| 65 | - Good: Most aspects covered with minor gaps |
| 66 | - Acceptable: Key aspects covered, some gaps |
| 67 | - Poor: Major aspects missing |
| 68 | - Failed: Fundamental aspects not addressed |
| 69 | |
| 70 | **Tool Efficiency** (weight: 0.20) |
| 71 | |
| 72 | - Excellent: Optimal tool selection and minimal calls |
| 73 | - Good: Good tool selection with minor inefficiencies |
| 74 | - Acceptable: Appropriate tools with some redundancy |
| 75 | - Poor: Wrong tools or excessive calls |
| 76 | - Failed: Severe tool misuse or extremely excessive calls |
| 77 | |
| 78 | **Reasoning Quality** (weight: 0.15) |
| 79 | |
| 80 | - Excellent: Clear, logical reasoning throughout |
| 81 | - Good: Generally sound reasoning with minor gaps |
| 82 | - Acceptable: Basic reasoning present |
| 83 | - Poor: Reasoning unclear or flawed |
| 84 | - Failed: No apparent reasoning |
| 85 | |
| 86 | **Response Coherence** (weight: 0.10) |
| 87 | |
| 88 | - Excellent: Well-structured, easy to follow |
| 89 | - Good: Generally coherent with minor issues |
| 90 | - Acceptable: Understandable but could be clearer |
| 91 | - Poor: Difficult to follow |
| 92 | - Failed: Incoherent |
| 93 | |
| 94 | ### Scoring Approach |
| 95 | |
| 96 | Convert dimension assessments to numeric scores (0.0 to 1.0) with a |