acpmux: ask every chat to batch its first reads and keep working while a bg task runs

Merged
TE
2d ago
+16-3

Leo, on why some cmux NEXT sessions do better work than others on the same model:

just being able to read things earlier, like concurrently with the multitasking, I feel like some sessions do it better than others for some reason. Like I feel like it's not just the model. Like there might be some sort of prompting situation [...] see what CMUX Next is missing, and, like, what it can take inspiration from, what it's doing well, what it could do better, what it's doing poorly that we can cut

Leo-ask: ask-c344b7792d

What cmux adds today

A cmux NEXT chat gets the harness's own system prompt (Claude Code's, or Codex's), plus the instructions of the MCP servers cmux attaches:

  • acpmux: the bg_start steer and the github_status steer
  • cmux-subsessions
  • cmux-cloud-repos (Cloud machines only)
  • in code mode, cmux_exec's description, which carries the same bg steer

Compared with Anthropic's published claude.ai prompt and Claude Code's prompt, these additions do the right things. They only cover cmux's own tools and say when to use each one, and they don't restate the model's identity or its safety rules. One thing was missing: nothing tells the agent how to pace its work in cmux. Claude Code's prompt says to batch independent tool calls, but sessions still varied. Codex's prompt doesn't say it as plainly. The bg_start steer also left open whether the agent should wait on the task or keep working.

Change

One sentence goes next to the bg steer, in both places it appears: the acpmux server's instructions and the code-mode cmux_exec description.

Work in parallel: at the start of a task, read the files and run the searches you already know you need as one batch of independent tool calls, not one after another, and while a bg_start task runs, go on with the parts that do not need its result.

It's a default, not a MUST, and it names cmux's own tool (bg_start), so it doesn't just repeat what the base prompt already says. Chief turns don't get it: their allowlist leaves out the bg tools, so the steer isn't attached.

The other half of Leo's ask, a tab that shows what the agent was told and lets the person edit the preset prompt, is a separate PR.

Tests

  • acpmux_mcp_tests::github_status_is_listed_with_its_instruction asserts the new sentence.
  • code_mode::bg_steer_tests asserts the same for cmux_exec.

Observed / Not run

  • Ran on the fleet: cargo test -p acpmux github_status_is_listed and cargo test -p cmux-tui bg_steer. Results are in a comment below.
  • Not run: a measured before/after of tool-call batching. This is a prompt change. Its effect shows up in transcripts over time, not in a unit test.

Changelog

Changed: cmux NEXT agents are asked to batch their first reads and keep working while a background task runs.

Risk: low. Two instruction strings, no code paths.

Agent session: agent session

🤖 Generated with Claude Code


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.


Summary by cubic

Adds a parallel-work instruction to cmux NEXT's MCP prompts so agents batch their first reads and searches and keep working while a bg_start task runs.

  • The instruction is appended to the bg_start steer in the acpmux server's instructions and the code-mode cmux_exec description.
  • Chief turns are unaffected because they don't expose the background tools.
  • Tests in acpmux_mcp_tests and bg_steer_tests assert the new sentence appears.