DEV Community

Yohji Sakamoto
Yohji Sakamoto

Posted on • Edited on

How to batch 5 coding-agent turns into 1 macro workflow

Disclosure: I maintain Tura.

Most coding agents handle a routine change like this:

Normal tool-calling agent

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

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 model wakes up five times, even though most of the sequence is predictable.

Tura macro workflow

Tura exposes one macro tool called command_run. The agent can send the same work 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": "apply the 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

The build, tests, and lint still run. The difference is that the model does not need a new turn between every predictable step. If something unexpected happens, control returns to the model.

In the published DeepSWE comparison, Tura Direct used 69.1% fewer turns and 77.5% fewer tokens than Codex CLI. Tura Balanced used 35.8% fewer turns and 31.1% fewer tokens while reaching an 80% success rate.

If you build coding agents, which parts of your workflow would you batch?

Top comments (0)