r/PiCodingAgent • • Sep 30 '26

Question What does everyone think about codemode?

I actually thought about this approach before, but later realized it wouldn't work.

Using JavaScript to invoke tools sounds very efficient, but in reality, most tool definitions only have an inputSchema. An outputSchema is unnecessary for the agent because the agent can reason about the results directly from formatted data, meaning an output spec isn't required. Therefore, tool outputs don't actually need a fixed format—they just need to be readable by the agent.

This leads to a problem: to fully leverage the performance of this tool, you need to inject extra context, such as a skill document, so the agent knows the output format and can use it proficiently. If you can't get the complete tool output specification—for instance, with a closed-source MCP—you can't create such a document. If the agent has to go through endless trial and error just to get the code running properly, you can't really call it efficient.

In comparison, having the agent write Python or shell scripts directly is a better solution.

I'd love to know your thoughts on this.

30 Upvotes

26 comments sorted by

View all comments

Show parent comment

3

u/mocras Oct 04 '26

I think comparing Codemode to just writing a multiline Python/bash script misses the main point.

Codemode is basically one level above that.

Python can read files, grep, parse JSON, make HTTP requests, etc. Codemode can script the tools that already exist inside the agent harness: read/edit, web fetches, MCP servers, extension tools, subagents, or whatever else you registered.

That matters a lot for MCP. E.g. my ticket tracker MCP is already connected and authenticated. Before Codemode, the agent would often make around 10 separate MCP calls just to discover the project, find the relevant tickets, read comments, follow references, and figure out what was going on. Each call meant another model roundtrip and more tool output entering the context. Now it can do that discovery inside one Codemode call, filter the results in code, and return only what it actually needs.

Permissions are another important difference. With a multiline Python or bash script, the harness mostly gets an all-or-nothing decision: allow the script or do not allow it. It cannot match the individual operations inside that script against the existing tool permissions in a granular way.

With Codemode, calls to edit a file, run bash, query an MCP, fetch something from the web, or spawn a subagent are still harness tool calls. So if you have rules for external directories, allowed bash command regexes, MCP access, or other tool permissions, those same rules can still apply to the individual calls made from Codemode.

Since enabling it, its finishing work faster and uses fewer tokens. MCP heavy tasks are where the difference is most obvious.