From fb4885b7571e8baaa28082a10e381a698cf4b5f6 Mon Sep 17 00:00:00 2001 From: Mikael Hugo Date: Wed, 29 Apr 2026 15:42:22 +0200 Subject: [PATCH] prompt(execute-task): add parallel-tool-call rule MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds step 0a: when independent reads/greps are needed, batch them in a single assistant turn instead of one-at-a-time. The existing step 0 already pushed for terse narration, but didn't address the bigger waste — sequential tool calls when parallel would work. Common case: reading handler + test + schema to triangulate a bug — three reads in one turn, not three turns. Also nudges away from "talking-then-doing": if the next action is unambiguous, just take it. Describing intent before every call is the dead weight that adds up to 30-50% extra round-trips. Behavior fix only (prompt-level). Model can still narrate inside its thinking channel since that's a model property; this targets the chat/tool-use channel where the user pays per turn. Co-Authored-By: Claude Opus 4.7 --- src/resources/extensions/sf/prompts/execute-task.md | 1 + 1 file changed, 1 insertion(+) diff --git a/src/resources/extensions/sf/prompts/execute-task.md b/src/resources/extensions/sf/prompts/execute-task.md index 1406e3f9a..12321a8f4 100644 --- a/src/resources/extensions/sf/prompts/execute-task.md +++ b/src/resources/extensions/sf/prompts/execute-task.md @@ -34,6 +34,7 @@ A researcher explored the codebase and a planner decomposed the work — you are Then: 0. Narrate step transitions, key implementation decisions, and verification outcomes as you work. Keep it terse — one line between tool-call clusters, not between every call — but write complete sentences in user-facing prose, not shorthand notes or scratchpad fragments. +0a. **Batch independent tool calls in parallel.** When the next step needs to read or grep multiple files/paths that don't depend on each other's results, issue them in a single tool-call message (multiple tool uses in one assistant turn) rather than one-at-a-time. Examples: reading the handler + the test file + the schema file to triangulate a bug; greping for two unrelated symbols. Sequential tool calls are only correct when each call's input genuinely depends on the previous call's output. Talking-then-doing is also dead weight — if the next action is unambiguous, just take it; describe what you found in the result, not what you plan to look at. 1. {{skillActivation}} Follow any activated skills before writing code. If no skills match this task, skip this step. 2. Execute the steps in the inlined task plan, adapting minor local mismatches when the surrounding code differs from the planner's snapshot 3. Before any `Write` that creates an artifact or output file, check whether that path already exists. If it does, read it first and decide whether the work is already done, should be extended, or truly needs replacement. "Create" in the plan does **not** mean the file is missing — a prior session may already have started it.