I keep coming back to a boring question: how much of an agent's time and money goes into the tool-call plumbing rather than the actual work? I've been poking at this with a small Rust CLI called ap, and I wanted to write down what I actually measured, including the parts that didn't move much.

The starting point

There's a Microsoft paper, FreeHand, arXiv:2612.02442, that reports a single-bash, zero-MCP-schema runtime gaining 5.1 points and cutting cost by 49% across 5 benchmarks. That's the claim that got me curious. Not because I think one paper settles anything, but because "no schema, just a shell" is a testable idea, and I had a tool sitting around that could test a slice of it.

ap v2.94.0 is MIT-licensed, pure Rust. Current state: 344/344 tests pass, 0 clippy warnings, prebuilt binaries with SHA256SUMS. Nothing exotic. The part relevant here is that it's a direct CLI, no MCP server, no schema negotiation. You call it, it does a thing, it returns text.

What I actually looked at

The analysis behind this covered 101,108 coding-agent tool-call traces. That's the raw material: lots of real calls, what they cost, what they returned. Out of that I pulled two things worth reporting.

First, ap sieve, which is SQLite FTS5 under the hood. I fed it a 597-line cargo test log and it cut it by 95.9%. That's the kind of thing that matters when an agent is staring at a wall of test output and you're paying per token to let it read the wall.

Second, ap recall has a median of 0.33 ms. That's the lookup path, not the model. It's fast enough that it disappears into the noise of everything else.

On the Windows side, ap-winjob uses Win32 Job Objects so that a whole process tree gets killed on timeout. This is the POSIX killpg equivalent, and if you've ever had a runaway cargo build spawn children that outlive the parent, you know why this is not a small thing. On Linux you take process groups for granted. On Windows you have to build the cage.

Where this does not help

I want to be honest about the edges, because the numbers above are easy to over-read.

The 95.9% figure is one log. One. It's a real measurement of a real file, but it is not a universal compression rate. A short log, or a log where every line is load-bearing, will not shrink like that. Treat it as an existence proof, not a promise.

And for small tasks with few tools, none of this gains much. If your agent makes three calls and reads two short files, the overhead you're saving is already tiny. The plumbing only starts to matter when you're making many calls, reading large outputs, and paying for the privilege. A zero-MCP direct CLI is not magic; it's just less ceremony, and ceremony is cheap when there's little of it.

How to check it yourself

Don't take my numbers. The repo is public: github.com/xgbtxy/ap. Build it, run ap sieve on your own logs, time ap recall on your own data. The green CI run I'm pointing at is 47465666416 if you want to see the test state. There are also 80 merged upstream PRs into other people's public repos if you want to see the code in the wild; the search is author:xgbtxy is:pr is:merged -user:xgbtxy is:public.

More writing lives at xgbtxy.github.io.

The thing I keep noticing is that most of the wins here are unglamorous: kill the process tree properly, compress the log before the model reads it, skip the schema handshake. None of it is novel. It's just done.

我觉得技术没有壁垒,在合适的时间做合适的事情就好,hhh