The most expensive sentence in AI-assisted work is the one you have typed twenty times. Every session that starts with "remember, we always..." is paying a tax that a one-time file eliminates. This Setup File shows the three places durable knowledge lives in Claude Code, with the real files, and a true story about a punctuation mark.
The situation
Months ago, the owner of this company told the AI working on this site one thing, once: em dashes read as AI-written, so never use them in site copy. Use periods or colons instead.
That instruction outlived the conversation it was said in. It survived new sessions, new projects, and a full site redesign. This week, an AI session that had never been told the rule grepped the repo for em dashes before publishing new copy, found three, and removed them without being asked. That is the difference between an AI you instruct and an AI you have trained. The mechanism is not magic; it is three kinds of files.
The files
File type one: the project constitution. CLAUDE.md sits in your repo root and loads into every session automatically. Codex reads the sibling convention, AGENTS.md, the same way, and repos where teams use both tools simply keep both. The winning format is commands and constraints, not philosophy:
# Project: Acme Order Portal
## Commands
- Run locally: npm run dev (port 3000)
- Tests: npm test -- --watch=false
- Lint before any commit: npm run lint
## Hard rules
- Never edit /legacy/* ; it is scheduled for deletion.
- All prices come from the pricing service, never hardcoded.
- Customer-facing copy: no em dashes, sentence case headings.
## Context the code cannot tell you
- QuickBooks is the source of truth for invoices, not our DB.
- "Accounts" in the UI are "companies" in the schema (history).
File type two: skills. A skill is a packaged procedure the AI loads when a matching task appears: one folder, one SKILL.md, loaded on demand instead of crowding every session. The description is the trigger, so it must say when to use it:
---
name: site-copy-voice
description: House style for all customer-facing copy. Apply BEFORE
writing or editing any page text, blog post, or product blurb.
---
Voice: plain, specific, no hype. Short sentences beat clever ones.
Hard rules:
- No em dashes anywhere in copy. Use a period or a colon.
- Numbers get verified sources or they do not ship.
- Every claim about "we" must be true of us specifically.
Before finishing: grep the changed files for the em dash
character and fix any hits. Report what was checked.
File type three: memory. Claude Code keeps per-project memory files that persist across sessions. The high-value entries are corrections with their reasoning attached, because the "why" is what lets the AI apply the rule to situations you never described:
---
name: no-em-dashes-in-content
description: owner rule: em dashes read as AI-written; use
periods/colons; grep before deploying copy
metadata:
type: feedback
---
Owner rule for all site content: no em dashes. They read as
AI-written to him and to savvy readers.
**Why:** the site must never feel machine-generated; punctuation
is a tell people actually check.
**How to apply:** write with periods and colons instead. Before
any deploy that touches copy, grep the changed files for the
character and fix hits.
The run
Here is the rule firing this week, months after it was stated, in a session that was never told about it:
> The plan finder needs the missing providers added. [nothing
about punctuation anywhere in the request]
# Session recalls the stored rule on its own and, before
# wrapping up, runs the check the memory prescribes:
grep -n "—" *.php assets/data/*.json
ai-subscription-plan-finder.php:223 "...warnings—without..."
ai-subscription-plan-finder.php:399 "...$20 tier—but the..."
ai-subscription-plan-finder.php:646 'Best stack — but one...'
# Three hits, three rewrites:
"...warnings. No affiliate commissions steering the answer."
"...$20 tier, but the winner changes sharply by workflow."
'Best stack, but one plan wins'
Final sweep: 0 em dashes in user-visible copy. Rule enforced
without being requested.
Notice what made this work. The memory did not just store the rule; it stored the reason (reads as AI-written) and the enforcement move (grep before deploying). Rules with reasons generalize. Rules without reasons get followed literally and badly.
Same idea in Codex. AGENTS.md carries your constitution, and larger repos nest additional AGENTS.md files in subdirectories so each area gets local rules. For repos where the team uses both tools, Anthropic's own docs recommend one source of truth: have CLAUDE.md import AGENTS.md (or symlink them) so the two never drift apart. Skills are converging too: both tools now build on the same open Agent Skills standard, a folder with a SKILL.md, so a well-written skill largely ports between them. The principle underneath is portable: knowledge that lives in a chat scrolls away, and knowledge that lives in a file compounds.
Where it breaks
- The constitution becomes an essay. A 2,000-word CLAUDE.md about your engineering values gets skimmed like every other essay. Commands, constraints, and gotchas. If a line does not change behavior, cut it.
- Vague skill descriptions. The description is the trigger. "Helpful writing guidelines" never fires; "apply BEFORE writing any customer-facing copy" fires every time it should.
- Stale rules. A memory that references a deleted file or a dead process is worse than none, because it gets confidently applied. Prune when things change; delete rules that turn out to be wrong.
- Contradictions. When CLAUDE.md says one thing and a memory says another, you get coin-flip behavior. One home per rule.
- Secrets in instruction files. These files ride along with the repo and get read on every session. Connection strings and API keys belong in environment config, never in the constitution.
Steal this
The twice rule
The operating habit that makes all three file types work: if you have told the AI something twice, file it. Where it goes takes ten seconds to decide:
- True of this project and needed every session →
CLAUDE.md/AGENTS.md. - A procedure for a recurring kind of task → a skill with a when-to-use description.
- A correction or preference with a reason → memory, with the why and the how attached.
Start with the CLAUDE.md template above; it earns its keep the first week. And if you want this discipline installed across a real team, with the hooks from Setup File 02 enforcing what the files declare, we set these systems up for businesses.
