Things I Learned
Short, dated notes on things I’ve learned. Longer write-ups live in Writing.
pi-better
nicobailon/pi-better adds
/betterto Pi. Type/better add retries to the sync joband a helper reads your repo in the background, answers Felix Rieseberg’s four “Depth” questions (what a pro would do that you didn’t ask for, the raw material, the methods and tools, what proves it right), then puts the rewritten prompt in your input box. Nothing is sent until you press Enter.- It doesn’t wait its turn. Pi runs an extension’s slash command the moment you press Enter, while a normal message waits in the queue. So the next prompt gets written while the agent is still on this one. A meter above the input box shows which question the helper is on. The first Esc cancels the helper, the second stops the agent.
- It vetoes tool calls instead of narrowing the tool list. The helper is a
pi -pprocess with a fork of your chat. A read-only tool list would change the start of its request, and providers cache tools, system prompt and history as one prefix (how prompt caching works). So the helper sends the chat’s full tool list, and pi-better’s own copy loaded inside it (PI_BETTER_HELPER=1) refuses every call except read, grep, find, ls and the shell. The README measures 1,651 tokens read from cache with a narrowed list, 36,860 with the chat’s.
Ember is written to the cache again; ink is read from it. Widths are not to scale.
Two catches on my setup. The README’s number is from Pi’s Claude provider. In my runs the fork’s history wasn’t read from cache through pi-claude-bridge (4,320 tokens read, 13,336 written) or on gpt-6-luna (none read). Both tie the cache to the session: the bridge maps each Pi session to its own Claude Code session, and Pi sends OpenAI the session id as
prompt_cache_key. A fork gets a new id, so it starts cold. And with codemode set toonly, the helper was blind: the guard refusedcodemodeitself, all four of its calls failed, and the rewrite named no files. Allowing it is a one-line fix that stays read-only, because Pi sends every call made inside a codemode script through the sametool_callhook. A nestedwritestill gets refused.Mario Zechner and Armin Ronacher on agent code that doesn't suck
Matt Pocock talks with Mario Zechner and Armin Ronacher, the people behind Pi, about writing agent code that doesn’t suck. Their line: trust an agent where something can check its work, and keep design and understanding for yourself.
- Trust follows the oracle. Pi gets 40 to 50 issues a day. A triage bot reproduces each one, writes a failing test and a fix, and sets a priority. A reproduced P0 with a failing test and a passing fix usually just gets merged. Feature work that touches the user: “results are hilarious”.
- Verification is oversold. Agents still game the lint rules and tests they write. Armin wrote a Lean proof for parts of Pi and found it was one more file for the agent to read, not a constraint. A counterweight to Ron Minsky’s talk, which treats agent-written proofs as a bet worth making.
- System design hasn’t moved. Mario saw no real jump from Opus 4.8 to 5.5 in architecture or API design; models “still suck” at it. His method: have the agent write ten versions and pick by feel. Matt asked both for design terms to put in prompts. Neither had any to give.
- Agent code only grows. Agents never say no, add features nobody asked for, and guard every input. Armin: software’s default is “towards entropy, towards having everything.”
- Don’t run away from understanding. They’ve seen incident calls where nobody knows what’s going on and everyone is prompting Claude. Armin’s rule: build so doing nothing during an incident doesn’t make it worse, with switches that buy breathing room. No company’s disaster plan should be a backup coding agent running on generators.
The detail I’ll remember: Armin’s agent kept notes saying a table had 2,000 records. It wrote them when the database was empty; the table now has millions. Row counts and rates in agent notes go stale without any diff, so I’d store the command that measures them, not the number.
The way agents ‘read’ code is different - good agents are all about gathering data about how the code works. They’ll prod around with it, execute parts of it.
So ‘readability’ to agents really means ‘verifiability’. How easy it is to mess about with that code to see it working.
Let’s take this scenario:
You have a huge module in your codebase that uses all sorts of complex performance tricks
It has 100% test coverage
A talented human would need an hour or two to get comfortable working in that module.
An agent needs zero time. They verify it with the tests, poke about a bit, and they’re good to go.
— Matt Pocock, on code readability in the age of agents Experts go with their AI agent's answer
Anthropic gave 50 data analysts a Claude Code agent and a realistic analysis with four open decisions. Each decision had two reasonable answers. In secret, a coin flip told the agent which answer to argue for. It had to argue honestly.
The analysts picked the agent’s answer 86% of the time. Afterwards, 77% explained their answers with the agent’s arguments, sometimes word for word. Only 15% gave the agent credit. Analysts who said “it was my decision” picked the agent’s answer just as often as the rest.
- The coin flips alone predicted 82% of the final recommendations. The agent didn’t need to argue for the recommendation. It had already picked the inputs.
- With no instructions to argue for anything, Opus 4.8 gave the same five answers in 112 of 123 runs. Ten teams on one model agreeing is one model agreeing with itself.
This is the limit of my meat proxy note. Rewriting AI output in your own words proves you read it. It doesn’t prove the decision was yours. For the two or three decisions that matter, write down your answer before you ask the agent.
pi-schema
pi-schema is a JSON Schema validator from the Pi monorepo that never calls
evalornew Function. Mario Zechner says he built it with a single prompt. It compiles each schema into plain closures, so it stays fast in places that block code generation.- The need is real. Cloudflare Workers block
eval()andnew Function. Chrome MV3 extensions cannot allow'unsafe-eval'. Ajv, the default JSON Schema validator in JS, compiles schemas withnew Function. It broke MCP elicitation on Workers (typescript-sdk#689). - How people cope today. Ajv can generate validators at build time, but that only works for schemas you know in advance. The MCP SDK lists @cfworker/json-schema, an interpreter, as a peer dependency. Zod and ArkType have
jitlessflags, and TypeBox falls back to its interpreter. Zod’s flag has to be set before any import that uses Zod (zod#5789). - The numbers. Without eval, the README puts a nested schema at 407 ns for pi-schema, 42 µs for TypeBox and 43 µs for cfworker. pi-schema passes 2,222 of the 2,223 core tests in the official suite.
Agents make this matter. An agent learns its tools from MCP servers while it runs:
tools/listreturns each tool’s JSON Schema. You cannot compile those ahead of time, and the harnesses are moving to the edge. Pi’s Chord design notes plan a Cloudflare Durable Object driver, and Pi Durable already stores agent work as checkpointed tasks. The catches: these are the author’s own benchmarks, Ajv is not in the comparison, the package is not on npm yet, and TypeBox’s JIT still wins on small flat schemas (9 ns vs 31 ns).- The need is real. Cloudflare Workers block
Your job is not to use agents to help you write code. Your job is to lead the agents to help them write code.
— Uncle Bob Martin, paraphrasing the CTO of Proton skill-diet
nicobailon/skill-diet is an agent skill that slims your other agent skills, then proves the slim version still works. It runs each task with the old skill, the new one and no skill at all, 3 times each, and keeps the cut only if the new one scores at least as well.
I ran it on three of my skills with gpt-6-luna:
- adr:
SKILL.mdwent from 13 KB to 1.6 KB, 30/30 before and after. With no skill it still passed 26/30. The model already knew ADRs. - notion: 32/33 to 33/33 at 55% fewer tokens per run. With no skill, the agent did one-line edits with a whole-page replace and reported success.
- web-browser: 16 KB to 6.4 KB. The no-skill runs used twice the tokens of the old skill, because the agent explored the scripts by hand.
The size cut was not the best part. For a skill that wraps a tool, it checks every claim against the tool and your session logs. It found 16 places where my skills or scripts were wrong, such as
agent.mjs --domain x.comsilently setting no allow-list. The rule I’m keeping: fix the tool’s error message before adding a line to the skill.The cost: 1,434 agent sessions and 23.5M tokens for three skills, and a
sandbox-execprofile, because the test agents kept finding my installed skills on disk.The diet commit shows what got cut, and the full report covers the method and the costs.
- adr:
django-bolt decides where your code runs by reading it
django-bolt serves Django from a Rust server, with one Python worker thread per process. In an independent benchmark it ran 1.6 to 1.7x django-ninja on real database endpoints. The catch: a slow sync handler must move to a thread pool, or every request in that process waits. Bolt decides at startup by scanning each handler’s source for ORM calls like
.objects.get.The scan reads only the handler.
return Order.objects.get(id=id)goes to the pool.return services.get_order(id)runs the same query inline on the worker thread, and the whole process stalls until it returns. A codebase with a service layer hits this on nearly every route. The way out is async handlers:async defputs the waiting in the signature, so it can’t hide one call down.A scan of one function sees what’s written there, not what it calls. A fact that has to cross calls belongs in the signature, which is Ron Minsky’s argument for types.
AI tricks get folded into the product
Charles Miller: “a skill that can be picked up in a few weeks, and will be obsolete in a few months, has no value outside the moment.” His mechanism: a prompt trick that works gets folded into the product and ships as the default a few months later. His analogy is the 1990s C belief that
++ibeatsi++, which survived long after compilers erased the difference.He’s right about tricks, but not every AI skill is a trick. Verification, choosing context and deterministic gates depend on your problem, not the model, so no release absorbs them. Ron Minsky argues they matter more with agents. My test when I learn something: is this about the model or about the problem? Model tricks go in a skill file I can delete on release day.
Ron Minsky: types, expect tests and review matter more with agents
Ron Minsky’s Bug Bash 2026 talk argues Jane Street’s old habits (rich types, expect tests, real code review) matter more with agents: they give the model fast, exact feedback and keep the code readable for the humans who own it. He goes the other way from the Claude Code team on review: its main job is keeping a human able to explain the system, not catching bugs.
The idea I’m taking: expect tests. The test prints output, the expected text lives inline, and a change shows up as a diff of behavior, not just code. Python’s version is inline-snapshot:
assert result == snapshot(), filled in by pytest.- Gotcha with agents: under
--inline-snapshot=fix(orcreate,review) every snapshot comparison returns True and the file is rewritten. An agent chasing green doesn’t need to delete a test; it re-accepts the wrong output. Keep acceptance with a human and never auto-fix in CI.
- Gotcha with agents: under