What Changes When the Agent Writes the Code, Part 2: Writing It and Proving It
Part 2 of 2: Which language and libraries to use, when to write your own, and how to prove it works

Part 1 in brief
Part 1 covered what to settle before the agent writes any code. It drew on three projects built with Claude: EnviroPlus-Huzzah, a sensor display on an old ESP8266 board; pipiece-ui, a Raspberry Pi camera and bird-watching station; and WarpCad, a web-based CAD tool. Its two lessons:
- State the expensive decisions on day one. Agents test what you ask for. WarpCad wrote down its performance, security, debugging, reliability and licensing goals before the first feature. pipiece-ui retrofitted them one bug at a time, and EnviroPlus-Huzzah failed five security checks in a review at the end. Research backs this up: when nobody states security constraints, models pick the insecure option about 45% of the time.
- Keep the design docs with the code. Every session starts cold, so what to build, and why, lives in the repo: one finding per file in
TODO/, dated decisions, decision records, post-mortems of failed attempts and a troubleshooting log. Jira and Confluence can be reached through a connector, but agents find context by grepping, and they can't grep a ticket.
Part 2 is about what happens once the agent starts writing: which language and libraries to use, when to write your own, and how to prove the result works.
Pick languages for readers, not writers
The moment this clicked for me was in EnviroPlus-Huzzah. Claude Code running Haiku, Claude's smallest model, patched Adafruit's current BME280 driver back to the syntax of a 2019 CircuitPython build, with the logic unchanged (write-up). If the smallest model can translate between language versions on demand, a lot of what we value in a language stops mattering.
Most new language features exist to make code nicer to write. Agents now do most of the writing, so developer experience shouldn't drive language choice. I choose for four things instead:
- Readability. Fewer features and simpler code, because humans now mostly review rather than write.
- Security.
- Performance.
- Availability. JavaScript is in every browser. Python is on almost every machine set up for an agent.
The research mostly agrees
Translation between versions works, at small scale. Migration between language versions is now an active research area; a 2026 benchmark tests models upgrading Java 8 code to Java 11 (source). Larger translations are still shaky. LegacyTranslate found a single agent got 45.6% of PL/SQL-to-Java outputs to compile and 30.9% to pass tests (source). My CircuitPython case was small and the dialects were close, which is where translation works best. Tests in the loop help.
Humans really are reviewers now. In a Cambridge/Microsoft study, about half of programming time went to interacting with the AI and 35% to double-checking its suggestions (source). METR found 75% of experienced open-source developers read every line of AI-generated code, and 56% often had to make major changes to clean it up (source). If people mostly read code, the language should be easy to read.
Linting matters more than language features. Feeding static-analysis results back to GPT-4o cut readability violations from over 80% to 11% within ten iterations (source). Another study found AI agents are 9 times more likely than humans to use any in TypeScript (source). A type system only helps when something enforces it.
Why agents reach for Python
When an agent builds a tool for itself, it usually picks Python. My guess was availability, and that part holds. Linux ships Python, cloud sandboxes have it, and on a Mac the Xcode Command Line Tools install it. Claude Code's desktop app needs git, which means running xcode-select --install, so a Mac set up for Claude Code has Python 3. Windows is the exception.
Researchers credit a different cause. "LLMs Love Python" found models chose Python in 90–97% of language-agnostic tasks, even in 58% of setups where it was a poor fit, and blames the training data (source). The two causes feed each other. Either way, the agent can count on Python being there.
Will new language features slow down?
I wouldn't be surprised. We're not trying to write faster anymore. If the ternary operator (the "confusor" operator, as my C professor called it) were introduced today, would it catch on? A new shortcut saves the writer a few keystrokes, and the writer is now an agent that doesn't care.
New features also start out invisible to the agent. They aren't in the training data yet, so agents keep using the older way, especially when a feature depends on a particular editor or tool. Does that mean everything boils down to assembly? I don't think so. The limit now is readability, and a new shortcut doesn't help anyone read.
That was Perl's problem. If you weren't reading and writing it every day, you forgot what all the symbols meant and spent your time looking them up. Agents don't have that problem; they write whatever they were trained on. A run of plain if/else statements where a ternary would do barely slows me down when I read it. A 400-character line does.
What the research says
- Agents lag new features. A Rust benchmark found models scored 56.1% on APIs released before their training cutoff and 32.5% on APIs released after (source). Studies of deprecated APIs find the opposite problem too: models keep producing obsolete interfaces their training data was full of (source).
- Popularity compounds. A 2025 study found a "Matthew effect": the more popular a language or framework, the better LLM-generated code works in it. DeepSeek-V3 solved 79.8% of problems in Python but about 21–24% in Racket and Erlang (source). The authors warn this could suppress experimentation and reinforce what's already popular (source). That's an argument that new languages, and probably new features, will have a harder time catching on.
- My professor had a point about the ternary. Researchers at NYU identified small code patterns that programmers reliably misread, called "atoms of confusion," and the conditional operator is one of them. A Java replication found 20% of answers wrong on the ternary variants, and many participants said it made code unclear (source).
- But readers disagree about it. The same paper notes the ternary was the most-voted, "most readable" answer on Stack Overflow, and some participants said four lines of
if/elsetook longer to read than one ternary (source). Familiarity decides a lot. - Line length really does hurt. In code-readability models built from human ratings, average and maximum line length are among the features with the greatest negative impact on readability (source).
- Perl's readability cost was a trade-off. A long-time Perl trainer wrote that sigils and similar features make Perl more expressive "at the cost of learnability and readability" (source). Perl's defenders argue the language is readable once you know it (source), which is my point: the cost falls on anyone who doesn't read it every day.
- The strongest pushback. Some language features are growing because of AI, not despite it. GitHub's Octoverse 2025 data shows TypeScript jumped 66% in a year to become GitHub's most-used language, and GitHub links that to AI convenience: types give the model rules to check against (source). So features that help a checker catch mistakes may still win. Features that only save typing probably won't. And TypeScript's type features don't require TypeScript: JSDoc annotations get the same types and the same checking from the TypeScript compiler, with no build step, as "Skip the transpiler" below explains.
When the agent reads the internals
For WarpCad's native app, I had to choose between Capacitor, from the Node ecosystem, and Tauri, which is built on Rust. Both were good, and I know Node really well. I chose Rust for its smaller footprint and Tauri's security review. The agent's decision record actually recommended Capacitor; I overrode it, and the record keeps the full comparison. If I were reading the internals myself, I'd have picked Capacitor. When the agent does the reading, the question changes from "what can I read" to "what is small, secure and fast."
That review is real and public. Radically Open Security audited Tauri's crates, tooling and build pipeline in 2021, ahead of 1.0 (source). An external audit of 2.0 was finished and published in August 2024, before the stable release (source).
One caution: Rust's memory safety doesn't stop supply-chain attacks. In August 2026, backdoored crates including arrayref (about 245 million downloads) ran malware at build time through build.rs (source). npm and pnpm now block unapproved install scripts by default; stable Cargo has no equivalent.
Code is cheap; dependencies aren't
An agent can write almost any library it needs, so every dependency now has to justify itself. Dependencies bring costs:
- They impose their own opinions on how things should work.
- They may carry incompatible or onerous licenses.
- They may do too much and be too big.
- They need updating and watching for as long as you use them.
This isn't a new argument. Russ Cox has long argued that every dependency adds risk and must be watched after you adopt it (source). npm's 2025 attacks showed the cost: the chalk/debug compromise hit packages with about 2 billion weekly downloads, and the Shai-Hulud worm spread through more than 180 packages (source). Agents already lean this way. ChatBotKit observed Claude Code building its own feature flags, auth and caching rather than adding LaunchDarkly, Auth0 or Redis (source).
WarpCad: a hand-built CRDT
WarpCad's AI partner became a second user of the same project file. Its edits had to merge with mine instead of pausing me or throwing one side's work away. That calls for a CRDT, a data structure that merges concurrent edits.
I skipped the suggested CRDT library. The agent turned my NDJSON file format into a full CRDT instead: about 1,500 lines of merge code and 1,100 lines of specs. The decision record compared a hand-built merge, a three-way merge, Yjs, Automerge, Loro, and staying single-writer. The libraries lost on the costs above, not on project health:
- Imposed opinions. Each would mean rewriting the document model around its own types. In Yjs and Automerge, a list move is a delete plus an insert, so two concurrent reorders duplicate rows.
- Size. Automerge is a 47.5 MB WASM package and Loro is 20.8 MB, for a static web app.
- Maintenance risk. Yjs has a single npm maintainer.
- My own requirement. Stay in NDJSON. Record lines stay byte-identical; merge metadata lives in one trailing line.
CRDTs are notoriously hard to get right. Many published replication algorithms were later shown to be wrong, some with supposed machine-checked proofs (source). When Martin Kleppmann tweeted a buggy CRDT, at least 16 people tried to find the bug and only two CRDT PhD students did (source).
So the merge is held to its laws by tests, not trust:
- 2,000 seeded random histories. Three replicas each make up to 30 random edits. Every case checks that merging is commutative, associative and idempotent, and that all six merge orders give byte-identical output.
- Random seeds on every run. Any failure prints its seed, which reproduces it exactly.
- No interleaving. Concurrent inserts at the same spot stay together. Interleaving is a known bug in several published text-editing CRDTs (source).
- Hostile input. It rejects a counter large enough to win every merge, a 10 MB position key, and malformed stamps.
- Scale. Two 5,000-entry files merge in under 2 seconds.
Known risks, like file growth from tombstones (deleted-row markers that are never cleaned up), are tracked as tasks, not hidden.
pipiece-ui: small device, small footprint
On the Raspberry Pi, the same choice came up again and again, driven by small storage, a 480 px screen and big raw image files:
- Charts without D3, Recharts or Chart.js. Hand-built SVG for the system sparklines and every Bird Watcher stats chart, from heatmaps to species accumulation. Nothing to bundle.
- Sunrise and sunset without an astronomy library. 357 lines and 19 tests, including polar dates when the sun never reaches nautical twilight. One module drives the report scheduler, the night backlight and the chart overlays.
- A DNG/FITS metadata reader without exiftool. It reads only the few KB of header it needs, never a whole 25 MB file, and returns null rather than an error on a file it can't read. When some DNGs showed no exposure data, the cause was a different writer's file layout. The fix used exiftool as a reference only.
- A system monitor that reads
/procdirectly instead of adding thesysteminformationpackage. - Atomic writes in 76 lines, with fsync on both the file and its directory.
Where dependencies still win
pipiece-ui does depend on Express, Vue, Pinia, Mermaid, markdown-it, the Anthropic SDK, and its test tools. They're big, well maintained, hard to replace and have no opinions about my data. My rule: write what's small, specific to your data and easy to test; take what's large and hard to verify.
Two more cautions from the research:
- Licenses don't fully go away. Models can reproduce licensed code without attribution, and most fail to identify the license of code they reproduce (source).
- Some code is hard to get right. For cryptography, auth, and parsers of untrusted input, either take a well-reviewed library or have the agent build the tests that prove the code works, the way WarpCad's merge is held to its laws.
The flip side: agents write the same thing twice
"The agent can write anything" includes writing the same thing over and over. In pipiece-ui, duplication was a bigger problem than dependencies:
- 126 error responses written inline across nine routers instead of using the shared helper. They drifted into three different shapes.
- Six copies of a config-directory fallback that a shared module already owned. An earlier set of copies caused a real production bug: half the API read one directory and half read another.
- 14 copies of an error/success banner, each with its own auto-dismiss timer.
- Six Python scripts, each with its own atomic-write helper. A fixed temp file name let two writers race and corrupt output.
The fix each time was one shared module plus a guard test that fails if a new copy appears. One test parses the router source files and fails on any hand-written error response. It found all 126 in one run.
Owning the code means owning its consolidation. A lint rule or a source-scanning test is what stops copy 127.
Write tests for the expert reviewer
Agents write thousands of tests; WarpCad's unit stage alone passes more than 3,600. The count proves nothing. A test that asserts true == true passes forever and catches nothing, and an agent asked for coverage will happily write that kind of test.
The research agrees. In one study, some LLM-generated test suites reached 100% coverage but only a 4% mutation score: they caught almost none of the bugs planted in the code to test them (source).
So the job isn't more tests. It's tests that can fail, and results an expert can check at a glance.
Every assert must be able to fail
- Red first. WarpCad's TDD skill writes the test before the code and runs it. If the new test passes with no code change, the agent stops and asks, because the behavior already exists or the test isn't testing it.
- Break the code on purpose. On one WarpCad task, the agent made a scorer's checks always pass and confirmed six specs then failed. The same check found a spec whose hand-computed expected value was wrong; the code was right.
- Never loosen to get green. WarpCad's test skill ends its escalation with "stop": no loosening an assertion or a snapshot threshold to make a run pass. A canvas snapshot that differs by a pixel or two usually means a real rendering difference, not noise. pipiece-ui does allow a 2% pixel mismatch, but only after comparing actual and baseline images showed anti-aliasing jitter under parallel load, and that reason is written next to the setting.
- Exact where it can be, tolerant only where it must be. Floating-point asserts use an explicit tolerance, never bare equality.
Show me: screenshots and movies
For anything with a UI, the most useful test output is a picture a person can look at. WarpCad and pipiece-ui both lean on this.
- Snapshots across devices. WarpCad's layout and panel specs snapshot at phone, tablet and laptop sizes, on Chromium, Firefox and WebKit. Engines draw WebGL differently, so "it works in Chrome" isn't evidence it works everywhere.
- Pictures come from tests, never from manual capture. WarpCad's 67 docs specs generate about 360 screenshots and 160 animated GIFs, in light and dark themes. The movies drive real drags at human speed. A guard test fails on a dead link, an orphaned picture, or a picture no spec produces.
- The pictures live in the repo. When the UI changes, the changed images show up in the staged files next to the code. If the change was intended, regenerate, look at the new image and commit it. If it wasn't, it's a regression.
- pipiece-ui works the same way. Its 18 Playwright specs hold about 270 screenshot baselines at 800×480, the Pi's HyperPixel 4 resolution. The 114 docs screenshots are copied from those baselines, so the docs can't drift from the UI, and checking them is the first of its six test stages. Visual snapshots run headless so rendering matches the Pi's display, and the component Storybook is published with the docs. Even the astro pipeline's integration tests run on real M51 and M17 captures.

A WarpCad docs movie, recorded by a test that drives the app at human speed. No one captured it by hand.

The same app at phone size, one of three viewport snapshots every layout spec takes.

pipiece-ui's Bird Watcher at the Pi screen's 800×480. This docs screenshot is copied from a Playwright baseline.
Looking is only fast if you can see what changed. A side-by-side of two near-identical screenshots hides a 3-pixel shift; a pixel diff shows it. I built Pixel Diff for VS Code for this. Click a changed image in the Source Control panel and it opens against the committed version, instead of VS Code's default diff, which can't show images. It offers side by side, a slider wipe, a toggle between expected and current, and an overlay that paints changed pixels in a highlight color or as a heatmap, with adjustable sensitivity. Animated GIFs are compared frame by frame, which covers WarpCad's movies.
![]()
Pixel Diff's overlay mode: the only pixels that changed between snapshot and render are painted red, so a small shift is obvious at a glance.
When the screen is the test
EnviroPlus-Huzzah has no browser to drive. Its test runner checks each sensor in its own boot, then fills the 160×80 screen green if every test passed or red if any failed. The project's instructions treat any change as unverified until it has been flashed and observed on a board. Code that has only been syntax-checked is labeled exactly that.
Write everything for the reviewer
Tests, code and docs should all be written for the expert who has to review them: easy to read, with good comments and docs. Test names state the behavior they check. Results are short summaries, with failures first. Pictures can be checked at a glance. The agent's job is to produce the evidence; mine is to check it quickly.
Skip the transpiler: JSDoc instead of TypeScript
TypeScript adds a build step, and every step is more tokens for the agent to spend and one more thing to confuse it. I get the same type safety from JSDoc comments, checked by tsc --checkJs or the linter, with documentation for free.
Node's built-in TypeScript support doesn't change this; it strengthens the case. Per the Node.js docs (source):
- Node only strips types that can be removed without changing the JavaScript. Enums, namespaces with values and legacy decorators still need a transpile step.
- Node never checks the types it strips. Running a
.tsfile is not runningtsc. - Node won't strip types inside
node_modules, so published packages still ship JavaScript.
If types are going to be treated as comments anyway, write them as comments. JSDoc gives the same lint-time checks, plus human-readable descriptions, @param and @returns docs, examples and @deprecated markers. Agents are very good at adding all of these. The source is exactly what runs, in every browser and in Node, with no toolchain.
I'm in good company. Svelte moved its core to JavaScript with JSDoc so it could debug without a build step and still type-check with tsc (source). WarpCad's merge core is plain JavaScript with JSDoc @typedef and @param annotations, down to the test helpers.
Tools should help you read, not write
New language features and transpilers that promise a better developer experience aren't helping the person writing the code anymore, because that person is an agent. What helps an agent is feedback: linters and other checkers tell it what's wrong, and they're faster at it than any language feature. The static-analysis study in the language section is the evidence: feeding linter results back cut readability violations from over 80% to 11% (source).
Agents also work on raw files, not in your editor. So a new editor feature has to help you read faster, not help someone type faster. That's where I expect tooling to change. The language features that tooling needs, like types in comments that a checker can verify, already exist. We don't need new ones.
That may matter for the tight language-and-editor pairs, like Visual Studio and C#, whose value was built around the person typing.
Working from a phone shows the gap. I've done a lot of WarpCad work from my phone, through the Claude app connected to Claude Code on my laptop. The developer experience is terrible. Two things helped:
- Ask, don't stall. Getting Claude to ask me a multiple-choice question, instead of ending a turn with a question buried in a paragraph, keeps the work moving when I'm away from the keyboard.
- Show progress. I still need to see that progress is being made. WarpCad has about 6,300 unit tests and more than 5,000 end-to-end tests, and both runners print minimal output to save tokens, so there was no way to tell if a run was 10% or 90% done. I wrote a Claude Code mod that shows a live progress bar, counts and an ETA above the prompt (write-up).
Neither is a language feature. Both are tools for the person reviewing, which is where I think the effort should go.
The rules I work by now
The first two come from Part 1; the rest come from this part.
- State the expensive decisions on day one, before the first feature: security, performance, reliability, logging and debugging, licensing, and how dependencies are chosen.
- Keep what to build, and why, in the repo, where the agent can read and write it: one finding per file, dated decisions, post-mortems and a log of what went wrong.
- Choose languages for the reader and the runtime, not the writer: readable, secure, fast and already installed.
- Enforce with linting and tests, not language features. Every test must be able to fail, and UI tests should leave a picture to review.
- Have the agent write anything small, opinionated or easy to test. Take a dependency for what's large, well maintained and hard to verify.
- For hard code you write yourself, have the agent write the proof too: property tests, fuzzing, seeded reproductions.
- Keep one copy. Guard tests stop the agent from writing it again.
- Skip build steps the agent doesn't need. JSDoc gives TypeScript's checks with no transpiler.
The common thread: code is now cheap to write and expensive to trust. Spend your effort on the trust.
Sources
- Part 1: Before You Start
- The Libraries Didn't Fit. Claude Haiku Wrote Smaller Ones.
- Java 8→11 migration benchmark (ReCode '26)
- LegacyTranslate: multi-agent legacy code translation
- Consensus of developers' views on code readability
- METR, Impact of early-2025 AI on experienced open-source developers
- Blyth et al., Static Analysis as a Feedback Loop
- Lee, Hassan & Hindle, Type constructs in AI-generated code
- Twist et al., LLMs Love Python
- Claude Code desktop git requirement (GitHub issue #35872)
- Tauri feature freeze and security audit (Tauri, DEV)
- Tauri 2.0 stable release
- Backdoored Rust crates on crates.io (CSO Online)
- Russ Cox, Surviving Software Dependencies (CACM)
- September 2025 npm compromise
- ChatBotKit, Why AI Agents Build Instead of Buy
- LiCoEval: license compliance in code generation
- Gomes, Kleppmann et al., Verifying Strong Eventual Consistency (OOPSLA 2017)
- Kleppmann, Tweeting buggy pseudocode (2022)
- Kleppmann et al., OpSets
- Wang et al., Mutation-Guided Unit Test Generation with an LLM (MutGen)
- WarpCad repo: test and TDD skills
- pipiece-ui docs (GitLab Pages)
- Pixel Diff for VS Code (Marketplace)
- Pixel Diff for VS Code (GitLab)
- Svelte moves to JSDoc (DevClass)
- Node.js, Running TypeScript natively
- RustEvo2: API evolution in LLM-based Rust code generation
- Lightweight Model Editing to Correct Deprecated API Recommendations
- The Matthew Effect of AI Programming Assistants
- Langhout & Aniche, Atoms of Confusion in Java
- Code readability metrics: a case study on reactive programming
- Dave Cross, Perl's Problems (Perl Hacks)
- Randal Schwartz, Perl's "readability" (blogs.perl.org)
- InfoQ: GitHub data shows AI tools reshaping language choice
- How Far Along Are the Tests?

