PromptZone - Leading AI Community for Prompt Engineering and AI Enthusiasts

Yohji Sakamoto
Yohji Sakamoto

Posted on

5 coding-agent turns vs 1 command_run workflow: full example

Disclosure: I maintain Tura.

Here is the simple idea. A normal coding agent may use five separate LLM turns for one predictable workflow.

Turn 1 — inspect

rg -n "TODO|command_run|handler" crates/
rg --files crates/runtime/src crates/tools/src
Enter fullscreen mode Exit fullscreen mode

Turn 2 — apply the patch

- // old command handler logic
+ // patched command handler logic
Enter fullscreen mode Exit fullscreen mode

Turn 3 — build

cargo build -p runtime
Enter fullscreen mode Exit fullscreen mode

Turn 4 — test

cargo test -p runtime --lib
Enter fullscreen mode Exit fullscreen mode

Turn 5 — lint

cargo clippy -p runtime --all-targets
Enter fullscreen mode Exit fullscreen mode

The overhead is not only the shell commands. The model wakes up five times and receives the growing conversation again.

Tura exposes one macro tool called command_run, so the agent can send the same workflow once:

{
  "name": "command_run",
  "arguments": {
    "commands": [
      { "step": 1, "command_type": "shell_command", "command_line": "rg -n \"TODO|command_run|handler\" crates/" },
{ "step": 1, "command_type": "shell_command", "command_line": "rg --files crates/runtime/src crates/tools/src" },
      { "step": 2, "command_type": "apply_patch", "command_line": "*** Begin Patch\n*** Update File: crates/tools/src/command_run/handler.rs\n@@\n-    // old command handler logic\n+    // patched command handler logic\n*** End Patch" },
      { "step": 3, "command_type": "shell_command", "command_line": "cargo build -p runtime" },
      { "step": 4, "command_type": "shell_command", "command_line": "cargo test -p runtime --lib" },
      { "step": 4, "command_type": "shell_command", "command_line": "cargo clippy -p runtime --all-targets" }
    ]
  }
}
Enter fullscreen mode Exit fullscreen mode

Build, test, and lint still run. The model simply does not need a new turn between predictable steps.

In the full DeepSWE comparison, Balanced used 35.8% fewer turns and 31.1% fewer tokens than Codex CLI. Direct used 69.1% fewer turns and 77.5% fewer tokens.

GitHub: https://github.com/Tura-AI/tura

Benchmark: https://turaai.net/benchmark

Top comments (0)