This benchmark proves that Claude Code with knowing MCP tools completes tasks with fewer tool calls, fewer tokens, and higher correctness than without.
The benchmark has three parts:
-
Task fixtures (
tasks.go): 8 tasks targeting the knowing codebase, each with a description, ground truth (relevant files, key symbols, answer keywords), and a complexity rating. -
Transcript analyzer (
transcript.go): Parses Claude Code JSONL session transcripts to extract token counts, tool call counts, wall-clock time, files read, and correctness scores against the ground truth. -
Comparison engine (
compare.go): Computes the deltas between control (without knowing) and treatment (with knowing) sessions, and renders a Markdown report.
The benchmark does NOT run Claude Code automatically. You run sessions manually (or via the runner script) and then point the analyzer at the resulting JSONL files.
Generate tasks.json so the runner script can read task descriptions without a
Go toolchain:
GOWORK=off go test ./bench/agent-efficiency/ -run TestExportTasks -vThis writes bench/agent-efficiency/tasks.json.
# Control session (no knowing tools)
./bench/agent-efficiency/runner.sh blast-radius-handler control
# Treatment session (with knowing tools)
./bench/agent-efficiency/runner.sh blast-radius-handler treatmentRun both modes for all 8 task IDs:
for task in blast-radius-handler context-engine-scoring node-struct-blast-radius \
louvain-community-detection snapshot-package-coverage \
hierarchical-merkle-diff edge-types file-save-to-cache-invalidation; do
./bench/agent-efficiency/runner.sh "$task" control
./bench/agent-efficiency/runner.sh "$task" treatment
done- Open a Claude Code session in
/Users/dayna.blackwell/code/knowing. - Paste the task description from
tasks.json. - For control sessions: do not use any knowing MCP tools.
- For treatment sessions: use knowing MCP tools freely.
- Save the session JSONL transcript to:
bench/agent-efficiency/transcripts/<task-id>-<mode>.jsonl
Claude Code stores session transcripts in
~/.claude/projects/<project-hash>/. Copy the relevant .jsonl file to the
transcripts directory with the naming convention above.
GOWORK=off go test ./bench/agent-efficiency/ -run TestAnalyzeTranscripts -vThis reads all transcripts in bench/agent-efficiency/transcripts/, computes
metrics, compares control vs. treatment pairs, and writes
bench/agent-efficiency/FINDINGS.md.
Transcripts must follow this naming pattern:
transcripts/<task-id>-<mode>.jsonl
Where <mode> is either control or treatment. Examples:
transcripts/blast-radius-handler-control.jsonl
transcripts/blast-radius-handler-treatment.jsonl
transcripts/context-engine-scoring-control.jsonl
transcripts/context-engine-scoring-treatment.jsonl
| ID | Description | Complexity |
|---|---|---|
blast-radius-handler |
Find the function that handles the blast_radius MCP tool | low |
context-engine-scoring |
Explain the context engine scoring formula and weights | medium |
node-struct-blast-radius |
What breaks if Node struct changes | medium |
louvain-community-detection |
Walk through the Louvain algorithm implementation | medium |
snapshot-package-coverage |
What test files cover the snapshot package | low |
hierarchical-merkle-diff |
How hierarchical Merkle tree improves diff performance | high |
edge-types |
List all supported edge types and where they are defined | medium |
file-save-to-cache-invalidation |
Trace data flow from git commit to cache invalidation | high |
| Metric | Description |
|---|---|
TotalTokens |
Input + output tokens across all turns |
ToolCalls |
Total number of tool_use blocks |
ToolCallsByType |
Per-tool breakdown (Read, Grep, knowing_context, etc.) |
Turns |
Number of assistant messages |
WallClockMs |
Time from first user message to last assistant message |
FilesRead |
Unique files opened via Read tool |
FoundRelevantFiles |
Ground-truth relevant files that were actually read |
FoundKeySymbols |
Ground-truth key symbols that appeared in assistant output |
AnswerCorrectness |
Fraction of expected answer keywords present in final response |
- Token savings: positive means treatment used fewer tokens.
- Tool call savings: positive means treatment made fewer tool calls.
- Time savings: positive means treatment finished faster.
- Correctness delta: positive means treatment gave more correct answers.
A good result shows knowing tools providing significant token and tool call savings while maintaining or improving correctness.