Tweet by rafalwilinski

September 28, 2025

couple of thoughts about codemode/codeact (https://t.co/s9642Cp2dm) - it's great but it's not a silver bullet. How it works? An agent, instead of doing N tool calls to meet the goal, writes the code that is calling these tools. Code is then evaled at secured sandbox and voila. so we've gone from telling LLMs what to do, to teaching them to write instructions for themselves. It's turtles writing code all the way down *for all the domains* why it's neat: - eliminates *some* problems with long trajectories or fan-outs - it's much easier to oneshot code with a `for loop` over 100 entries instead of expecting an LLM to nail 100 tool calls, either in parallel or sequentially. It only gets worse with bigger N. it's also MUCH faster - MCP schemas become typed TS APIs - this makes it verifyable before running. you can also reuse it easily for e.g. semantic caching. when you see the same input for 2nd time, you don't need to invent the flow, just reuse something that worked in the past (wink wink Vectorize) - saving context/preventing from context rot. instead of dumping that 100k payload from gmail API to `messages`, it's just flowing inside sandboxed runtime, massaged like every other JSON and only precisely picked bits get surfaced in the ctx - enables CaMeL-style approaches where agents literally debug their own homework (https://t.co/5G7IKV5GDI) So, it works great for problems where you know majority of the flow upfront, think of workflow-like things, e.g. "please provision an ec2 instance of m4 class that I can SSH to, place that in public SG and attach an IPGW, make sure it's tagged nicely". it's a clear sequence of function calls which can be easily done as a script. Doing so traditional way _could_ exceed the context and get lost along they. where it’s weaker: open‑ended research loops where you decide at each step what to even do next. You can try to account for each edge case but it kinda defeats the purpose. it's also challenging with idempotency & partial failures but solvable with KV/D1 for resume‑from‑checkpoint/offset etc. Right now, it especially fails at cases where the intelligence needs to be _inserted in the middle of code_. Imagine a spreadsheet with 100 emails and you wanna write a *personalized* email for each entry. `body` argument for that `send_email` call must be also computed using LLM in order for that outreach to be personalized, right? You can shim that with sub‑agents / “call llm() inside the loop,” but then you’re kinda back to traditional agenting, just wrapped in TS. Nevertheless, super excited to see how the field develops this pragmatic bridge between “agent” and “script”, pumped that Cloudflare invests into it. @KentonVarda @threepointone pls do more shit like that

Author
rafalwilinski
Date
September 28, 2025