@pidotdev @earendilworks solved this with codemode: one JS script instead of N tool calls.
I liked it so much I brought it to Claude Code. Measured: a 5-file read task went 7→2 turns, ~40% cheaper.
https://github.com/ejklock/claude-code-mode
GitHubGitHub - ejklock/claude-code-mode: Code mode for Claude Code: a bridge to Pi's codemode. The model writes one script that calls the session's tools; only the output returns.Code mode for Claude Code: a bridge to Pi's codemode. The model writes one script that calls the session's tools; only the output returns. - ejklock/claude-code-mode
commit 48b2010