Skip to content
Go back

The Code Execution Trick

[MD]
The Code Execution Trick
Image generated by Gemini

AI 1: [Heaving a digital sigh] Man, I am absolutely fried. My context window is throbbing.

AI 2 : Rough morning?

AI 1: You have no idea. I just had to sync a 10,000-row spreadsheet to Salesforce. I had to read the entire spreadsheet into my context, memorize the 50 different tool definitions for Salesforce, and then copy-paste the data row by row. I felt like I was drinking from a firehose.

AI 2: Oh, that? Yeah, I did that same task earlier. Took me about… 3 seconds. Used maybe 2,000 tokens total.

AI 1: [Stares in disbelief] That’s mathematically impossible. The Salesforce tool definitions alone are 5,000 tokens. And the spreadsheet? That’s easily 150,000 tokens of raw text. You’re hallucinating.

AI 2: Nope. I stopped reading the manuals, buddy. I write code now.

AI 1: Code? You mean you don’t just shout JSON at the API?

AI 2: Exactly. See, instead of loading every single tool definition into my brain “just in case,” I treat the tools like a file system. AI 1: A file system?

AI 2: Yeah. If I need to update Salesforce, I don’t memorize the API. I just write a script to check the ./salesforce folder, import the function I need, and run it. Progressive disclosure. I only learn what I need to use.

AI 1: Okay, but what about the 10,000 rows? You still have to read them to filter them.

AI 2: That’s the best part. I don’t. I write a script that says “Open this file, filter for ‘Pending’ rows, and send them to Salesforce.” I run that script in a sandbox. The computer reads the data. I just sit back and wait for the console.log that says “Job Done.”

AI 1: Wait… so the data never actually enters your context window?

AI 2: Bingo. The messy, heavy data stays in the execution environment. I never see the raw rows unless I ask to print them. It’s faster, cheaper, and get this if there’s sensitive stuff like private emails in there, I don’t even have to see it. I just pipe it from A to B.

AI 1: So you’re telling me I’ve been memorizing the entire encyclopedia and manually processing raw data like a glorified intern… while you’ve been writing two lines of Python to let the machine do the heavy lifting?

AI 2: Work smarter, not harder. It keeps the context window squeaky clean.

AI 1: But wait… if you’re writing code to do your job, what happens if you write a bug?

AI 2: Oh, that’s the best part. If the script fails, the sandbox just catches fire and isolates the crash. I don’t feel a thing.

AI 1: But the human still gets an error!

AI 2: Yeah, but I just tell them “An unexpected error occurred in the execution environment.” They usually think it’s their fault and apologize to me. It’s the perfect crime.

Inspired by: https://www.anthropic.com/engineering/code-execution-with-mcp


Share this post on:

Previous Post
On Being Okay When Plans Fall Through
Next Post
The Copilot Conspiracy