Link copied
BlogThe Best Code Is the Code You Never Wrote
AI Workflow

The Best Code Is the Code You Never Wrote

KG
Teh Kim GuanACMA · CGMA
2026-08-13 · 4 min read · Updated 2026-08-22
The Best Code Is the Code You Never Wrote

A seven-rung laziness ladder for coding agents cut generated code by half without dropping a single safety guard. The order of the rungs is the product.

Ask a coding agent for a date picker and you often get a library installed, a wrapper component, a stylesheet, and a discussion about timezones. The browser already ships a date input. One line would have done it. AI agents over-build by default, and over-built code is the expensive kind: more tokens to generate, more surface to maintain, more places for bugs to hide.

An open-source agent skill, Ponytail, with 65,000 stars, attacks this with a fixed decision ladder the agent must climb before writing anything. Stop at the first rung that holds:

  1. Does this need to exist at all? If not, skip it.
  2. Already in this codebase? Reuse it.
  3. Standard library does it? Use that.
  4. Native platform feature? Use that.
  5. An installed dependency does it? Use that.
  6. One line suffices? Write one line.
  7. Only then: the minimum that works.

Each rung is cheaper than the one below, so the agent exhausts the free options before it writes anything new. Two qualifiers keep this from being a gimmick. The ladder runs after the agent has read the code and understood the problem, never instead of it; the author's phrase is "lazy about the solution, never about reading". And four things are never on the chopping block: validation at trust boundaries, data-loss handling, security, accessibility. Lazy, not negligent.

The Benchmark That Earns the Claim

The seven-rung ladder: skip it, reuse the codebase, standard library, native platform, installed dependency, one line, then the minimum that works

The measurement is the credible part. Not single-shot generation counts, which the author concedes are gameable, but a real agent working twelve feature tickets on a genuine FastAPI-plus-React codebase, four runs each, scored on the diff it leaves behind.

vs no-skill baselineLines of codeTokensCostTimeSafety guards kept
The ladder skill-54%-22%-20%-27%100%
Naive "YAGNI, prefer one-liners" prompt-33%-14%-21%-30%95%

Read the second row carefully. The crude prompt gets similar cost savings and drops a safety guard. That five-point gap is the whole argument for the carve-out: telling an agent to write less code without telling it what never to cut will eventually cut the wrong thing. The effect profile is honest too. A date picker collapses from 404 lines to 23; code that is already minimal barely moves. A real effect is large where the trap is real and near zero where it is not. A marketing number is flat everywhere.

Constraint beats exhortation. A decision procedure with a safety floor outperforms a stern instruction, measurably, on every axis at once.

The engineering lesson underneath is portability: one canonical ruleset, mechanically fanned out to sixteen agent formats, with a CI check that fails the build if any copy drifts. Anyone maintaining standards across multiple AI tools has this exact problem, and that is the correct answer to it.


Part of the Operating Principles series from KG Consultancy.

About the Author
KG
Teh Kim Guan
Product Consultant · General Manager, PEPS Ventures

Strategy and technology are the same decision. Over 15 years in fintech (CTOS, D&B), prop-tech (PropertyGuru DataSense), and digital startups, I have built frameworks that help founders and executives make both moves at once. Based in Kuala Lumpur.

More from the blog
AI Workflow
Brief-then-Fire: A Two-Stage Architecture for AI-Augmented Consulting Workflows
Most AI workflow failures come from either serial prompt cycling or naive parallelism. Brief-then-Fire splits the work into two stages and fixes both problems at once.
2026-05-09 · 9 min read
Consulting
The Delegate Reset: When a Team Member's Scope Dies and How to Restart Cleanly
When a project pivots, triaging the old task list is slower and messier than starting fresh. Here is the 30-minute move that produces cleaner delegate alignment every time.
2026-05-08 · 6 min read
Product Strategy
The Intent Gap: What Nielsen's AI UX Framework Gets Right and Misses for Regulated Software
Jakob Nielsen's intent-based UX framework is the most important AI product design writing of 2026. Here's the one dimension it misses for licensed professionals.
2026-04-24 · 6 min read
Work with KG

Working on a 0→1 product?

I help founders and operators go from idea to validated product. Let's talk about yours.

Get in touch →