<- all tokdocs

YAGNI in AGENTS.md: A Six-Rule Coding Standards Snippet for AI Agents

By , founder of Mavric and Apso

View on TikTok ->

A TikTok from @philofsurprises shares a six-rule "Global Coding Standards" snippet seen at a San Francisco JavaScript meetup, credited on screen to @Claude_Memory, and recommends adding its YAGNI rule to your AGENTS.md files to stop coding agents from overbuilding. The rules are real and circulate publicly. The catch for Claude Code users is that Claude reads AGENTS.md by default only when there is no CLAUDE.md in the working directory or above it.

What are the six rules?

The slide in the video, headed # Global Coding Standards, lists:

  1. YAGNI: "Don't build it until you need it"
  2. DRY: "Extract patterns after second duplication, not before"
  3. Fail Fast: "Explicit errors beat silent failures"
  4. Simple First: "Write the obvious solution, optimize only if needed"
  5. Delete Aggressively: "Less code = fewer bugs"
  6. Semantic Naming: "Always name variables, parameters, and API endpoints with verbose, self-documenting names that optimize for comprehension by both humans and LLMs, not brevity (e.g., wait_until_obs_is_saved=true vs wait=true)"

The same six rules appear in a public pull request dated 25 October 2026, jondubin95/skirt_steak PR #17, which adds them as a Cursor rule at .cursor/rules/coding-standards.mdc. The list works in whatever instruction file your tool reads.

Is the snippet an AGENTS.md file?

Not as shown. The video calls it an "agents.md file," but the slide never shows that filename. The visible heading is "Global Coding Standards" and the editor path starts at "Users >", which points to a file in a home directory rather than a repository's AGENTS.md.

AGENTS.md is a specific format. The agents.md site describes it as "a simple, open format for guiding coding agents." It came out of work by OpenAI Codex, Amp, Jules, Cursor and Factory, is now stewarded by the Agentic AI Foundation under the Linux Foundation, and is supported by over 20 coding agents. The site reports GitHub search showing it in over 60,000 open-source projects. The video uses "agents.md" as a general label for an agent instruction file.

Does Claude Code read AGENTS.md?

Only in some setups. The Claude Code memory documentation says: "By default, Claude reads AGENTS.md only when you have no CLAUDE.md in your working directory or above it." If a repository has both, Claude reads "Your CLAUDE.md files only."

Three details matter:

  • A personal, uncommitted CLAUDE.local.md counts. The docs warn: "Because CLAUDE.local.md counts, adding one to keep your own uncommitted instructions in a project that relies on AGENTS.md stops Claude from reading AGENTS.md for you."
  • Reading AGENTS.md directly "requires Claude Code v2.1.277 or later."
  • The Project instructions setting accepts claude-md-and-agents-md, which makes Claude read both files.

The speaker says he put the snippet "in almost all of my agents.md files." That works in repositories with AGENTS.md and no CLAUDE.md, on a recent version. In a repo with any CLAUDE.md, Claude Code skips it by default, and the video does not mention this.

Where to put rules you want in every project

The video describes one rule applied everywhere, which is user scope. For Claude Code, the docs list ~/.claude/CLAUDE.md as "Personal preferences for all projects." A home-directory file also matches the path shown on the slide.

What does YAGNI stand for?

YAGNI stands for "You aren't gonna need it." Martin Fowler's 2015 entry traces it to the C3 project in Extreme Programming: "Chet came up to Kent with a series of capabilities that the system would soon need, to each one Kent replied 'you aren't going to need it.'" That places Kent Beck and Chet Hendrickson at its origin.

Wikipedia attributes the standard statement to XP co-founder Ron Jeffries: "Always implement things when you actually need them, never when you just foresee that you [will] need them," citing a post from 4 April 1998 and Extreme Programming Installed (2001). Wikipedia lists "You ain't gonna need it," the video's phrasing, as an accepted variant.

Does YAGNI work as an agent rule on its own?

Partly. The slide's version, "Don't build it until you need it," is narrower than the original. Fowler applies YAGNI to presumptive features, meaning "some capability we presume our software needs in the future should not be built now." He also ties it to continuous refactoring, automated unit tests and continuous integration, which keep the approach safe when needs change. An agent given only the one-line rule gets half of the practice. Pairing it with instructions to refactor and run tests is closer to what Fowler describes.

Who wrote the snippet?

The video's on-screen sticker reads "thanks to @Claude_Memory on X." That is the account for claude-mem, a project by Alex Newman (@thedotmack) that describes itself as "Persistent Context Across Sessions for Every Agent." It is Apache 2.0 licensed, and the repository showed version 15.2.1 and 103.4k stars when checked. The video never names the presenter, and the credit appears only in the sticker.

The speaker says the rule has helped, with agents telling him they skipped extra work after reading it. The video shows no agent output to back this up, so treat it as one person's report. The meetup itself is not identified in the video.

Bottom line

The six-rule list is a sensible, publicly shared set of coding standards, and YAGNI is a long-standing XP principle. If you use Claude Code and your repository has any CLAUDE.md or CLAUDE.local.md, put the rules there or in ~/.claude/CLAUDE.md, or turn on the setting that reads both files. Pair the YAGNI rule with refactoring and testing instructions.

Sources

Published October 25, 2026. Based on a TikTok by @philofsurprises. Full video notes (markdown)