Skip to content

perf(prompt): restore the dropped "maximize parallel tool calls" guidance#750

Merged
ericleepi314 merged 1 commit into
mainfrom
perf/restore-parallel-tool-call-guidance
Jul 26, 2026
Merged

perf(prompt): restore the dropped "maximize parallel tool calls" guidance#750
ericleepi314 merged 1 commit into
mainfrom
perf/restore-parallel-tool-call-guidance

Conversation

@ericleepi314

Copy link
Copy Markdown
Collaborator

Iteration 2 on the trajectory-step gap. Reporting a null result on the mechanism — see Outcome.

The port gap (real)

text
Reference "…make all independent tool calls in parallel. Maximize use of parallel tool calls where possible to increase efficiency. However, if some tool calls depend on previous calls to inform dependent values, do NOT call these tools in parallel and instead call them sequentially. For instance, if one operation must complete before another starts, run these operations sequentially instead."
clawcodex "…make all independent tool calls in parallel." (ends)

Both dropped clauses matter: the imperative to maximize, and the dependency carve-out. Without a statement of when not to parallelize, "call them in parallel" is risky advice a careful model will mostly decline.

Why I targeted it

Measured on the same tasks, same model, same effort: clawcodex emits >1 tool call per assistant turn in 5.7% of steps against the latest Claude Code's 18.1%. Reading regex-log side by side: CC issued 8 calls, all Bash, batching probes (for c in node deno perl ruby; do command -v $c; done) and creating files via heredoc; clawcodex issued 17, alternating WriteBash and probing one command at a time.

Outcome: correct fix, null mechanism

The parallel-call rate did not improve — 8.9% → 6.8% on the comparable tasks (noise at this n), still far from CC's 18.2%. Mean steps moved 13.0 → 12.7, inside noise.

I'm merging it anyway because the truncation is real and the restored text is what the reference actually says — but it should not be credited with a behavioral win, and the remaining step gap is not explained by batching.

Iteration progression (tasks clean in every run compared)

mean steps gap vs CC reward errors
pre-#747/#748 31.3 +21.7
iter0 (main) 25.5 +18.0 0.857 3
iter1 (#749) 13.0 +4.5 1.000 0
iter2 (this) 12.7 +4.2 1.000 1
Claude Code 8.5

Per task at iter2 vs CC: circuit-fibsqrt 10 vs 13 (clawcodex now lower), fix-code-vulnerability 12 vs 10, cancel-async-tasks 11 vs 6, sparql-university 14 vs 8, regex-log 17 vs 9, distribution-search 12 vs 5.

Also notable: memory-file writes during tasks fell to 0 in this run, from 35 across the earlier 89-trial run.

What the residual is not

Two candidate causes I investigated and ruled out as harness divergences:

  • Write-then-Bash vs heredoc. clawcodex's "reserve Bash for system commands, prefer the dedicated tool" bullet is faithful to the reference — in fact softer than it (the reference adds "and only fallback on Bash if absolutely necessary"). The tool mix on the comparable set is close: Bash 71% vs 76%, Write 18% vs 13%.
  • Parallel batching — this PR, null as above.

Tests: 8843 passed. The new test pins all three clauses, since restoring only the push would leave the model without the safety half.

🤖 Generated with Claude Code

…ance

Iteration 2 on the trajectory-step gap against the latest Claude Code
(same model, same effort). Iteration 1 (#749) took the subset mean from
25.5 to 13.2 steps against CC's 7.5; this addresses the largest remaining
structural difference.

Measured on the same tasks: clawcodex emits more than one tool call per
assistant turn in **5.7%** of steps, the latest Claude Code in **18.1%**.
Every independent pair it does not batch is an extra step, so that ratio
is most of what remains between the two step counts. Reading the
trajectories side by side shows it plainly — on regex-log CC issued 8
calls, all Bash, batching probes ("for c in node deno perl ruby; do
command -v $c; done") and creating files with heredocs; clawcodex issued
17, alternating Write then Bash and probing one command at a time.

Cause is a truncated port. The reference bullet has three parts:

    You can call multiple tools in a single response. If you intend to
    call multiple tools and there are no dependencies between them, make
    all independent tool calls in parallel. Maximize use of parallel tool
    calls where possible to increase efficiency. However, if some tool
    calls depend on previous calls to inform dependent values, do NOT call
    these tools in parallel and instead call them sequentially. ...

clawcodex kept only the first sentence. What was dropped is what turns a
permission into a practice: the imperative to maximize, and the
dependency carve-out. The carve-out matters as much as the push — without
a statement of when NOT to parallelize, "call them in parallel" is risky
advice a careful model will mostly decline, which is what the 5.7% looks
like.

Same defect class as #748 (dropped qualifiers on the file-creation
bullet), and general rather than benchmark-specific: batching independent
work is better agent behavior everywhere.

Tests: 8843 passed. The new test pins all three clauses, since restoring
only the push would leave the model without the safety half.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@ericleepi314
ericleepi314 merged commit 4f553f4 into main Jul 26, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant