5 anti-patterns we removed from our CLAUDE.md | Claude Code Toolkit
Deep Dives

5 anti-patterns we removed from our CLAUDE.md

The most valuable file in your repo is also the easiest to make worse. Concrete before/after examples from real teams.

FA
Fatima A. August 30, 2026 · 12 min read

CLAUDE.md is probably the highest-leverage file in a repo that uses Claude Code. It shapes what tools get called, what conventions get followed, what the assistant assumes about the codebase. Bad CLAUDE.md = bad AI output. Good CLAUDE.md = surprisingly-good AI output.

The problem is that most teams write CLAUDE.md the way they'd write internal docs — thorough, exhaustive, and dense. That's the wrong shape. This post is about five specific patterns we've seen (and shipped ourselves) that seemed reasonable and were actively making Claude Code worse.

For each: what we had, why it hurt, what we changed it to, and why the new version works.

Anti-pattern 1: "Here's everything about our codebase"

Our CLAUDE.md started at 4,000 tokens. It described the architecture, listed every service, noted our conventions, explained our team structure. It was comprehensive. It was also bad.

The problem: when every prompt starts with 4K tokens of context, Claude spends its attention navigating your document, not the task. And most of what's in that document is irrelevant to the specific task. The dev asks "add pagination to the users API" — Claude reads 4K tokens about the entire company before it gets to the specific work.

BEFORE — 4,000 tokens of everything
# Acme Corp Engineering

## Architecture Overview
We run a microservices architecture with 47 services...
(1500 more tokens)

## Team Structure
Platform team owns...
(800 tokens)

## Coding Conventions
### Naming
### Testing
### Error Handling
(1200 tokens)

## Common Workflows
### How we do releases
### How we do incidents
(500 tokens)
AFTER — 800 tokens of just-in-time
# Acme Corp — repo-level guidance

## About this repo
This is the user-service. It exposes REST endpoints for user management.
Language: TypeScript. Framework: Fastify. DB: PostgreSQL via Prisma.

## Conventions this repo follows
- All handlers are in `src/handlers/`. One file per route.
- Errors use our `AppError` class, not `throw new Error`.
- Tests colocate as `*.test.ts` next to source.

## When you need broader context
Team conventions are in the shared `.claude/team-guide.md` (auto-loaded).
Service topology: run `/topology` command.
Deployment: run `/deploy-help` command.

The rewrite is 80% smaller and points at other sources for the context you don't always need. Slash commands surface deep context on demand. A shared team-guide file is auto-included but small. What stays in CLAUDE.md is the tight, repo-specific stuff that's always relevant.

Result: response quality improved, not degraded. Fewer red herrings, tighter reasoning, faster answers. The intuition "more context is always better" is wrong once you cross a threshold.

Anti-pattern 2: The "please" and "always" trap

Our old CLAUDE.md was full of instructions like "please always run tests before finalizing" and "always check for security implications." Well-meaning. Also useless.

Two problems. First, "always" applied to everything makes each individual instruction weaker. If 30 things are "always," none of them feel like priorities. Second, "please" makes instructions read as soft requests that Claude weights against other considerations.

The fix: instructions get imperative and specific, or they get demoted to references. Not "please always run tests" but "for changes touching `src/handlers/`, run `pnpm test:handlers` before completing." Now the instruction has a trigger, a scope, and a concrete action.

BEFORE — soft, absolute, unfocused
## General instructions
- Please always run tests before finalizing changes
- Always check for security implications
- Please make sure to update documentation
- Always follow our coding standards
- Please consider edge cases
- Always be helpful
AFTER — imperative, scoped, specific
## What to run before finalizing
For handler changes (`src/handlers/`): `pnpm test:handlers`
For DB migration changes (`prisma/`): `pnpm prisma validate`
For anything touching auth (`src/auth/`): flag it in your summary
so a human reviews.

## What to include in every code change
- Match the existing error style (use `AppError`, not `throw new Error`)
- Add a JSDoc block if the function is exported
- Skip tests only if the change is CSS-only or docs-only

Nothing about "please." Nothing about "always" as a general prefix.
Instructions describe when they apply and what to do.
Rule of thumb

If you can't attach a trigger to an instruction ("when X happens, do Y"), it's probably not doing work. Delete it or find its real trigger.

Anti-pattern 3: Conflating "team conventions" with "repo state"

CLAUDE.md often ends up mixing two very different things: how we think code should look (team conventions — stable, opinionated, culturally-loaded) and what this codebase currently is (repo state — practical, changeable, situational).

They belong in different files, because they get maintained differently. Team conventions change once a quarter. Repo state changes every sprint. If they're in the same file, either you don't update state often enough (because the file feels stable) or you thrash the conventions section (because you're editing anyway).

Split them. CLAUDE.md holds repo state. A shared team-conventions file (loaded via CLAUDE.md reference) holds conventions. Now each has its own lifecycle and its own owner.

Anti-pattern 4: The example that lies

Examples in CLAUDE.md carry outsized weight — Claude Code treats them almost as commandments. Which is great when they're accurate and terrible when they drift.

We had an example showing our "preferred error handling pattern." It was accurate 18 months ago. Then we migrated to a new error class. The example still showed the old pattern. Every new code Claude wrote used the old pattern. We'd be reviewing PRs saying "why does this use the old error class again?" not realizing our own doc was training the AI to write old code.

The fix that worked

Every example in CLAUDE.md gets a code-owner. Every quarter that owner has to confirm the example is still accurate or update it. Examples with no owner get deleted, not left to rot.

Uncomfortable but necessary. Stale examples are worse than no examples.

How we annotate examples now
## Error handling example

<!-- OWNER: @farhan  LAST-VERIFIED: 2026-08 -->

```typescript
throw new AppError({
  code: 'INVALID_INPUT',
  status: 400,
  message: 'Email is required',
  cause: err,
});
```

Not: `throw new Error(...)`. Not: `res.status(400).json({error: ...})`.
Use `AppError` — the middleware translates it correctly.

Anti-pattern 5: The escape-hatch paragraph

Somewhere in most CLAUDE.md files there's a paragraph like: "if in doubt, ask the user for clarification before proceeding" or "when uncertain, err on the side of caution and explain your reasoning." Reasonable-sounding. Actively harmful.

These paragraphs create a global escape hatch that gets over-applied. Claude Code starts asking for clarification on tasks that don't need it. It hedges when a direct answer would serve the user better. The very-hedge-y default response becomes the default response.

The right instruction is specific: "for changes touching payment code, always ask the user to confirm before writing." That's a real, scoped instruction. "When uncertain, err on the side of caution" is philosophy dressed as instruction, and it makes everything worse.

The result

We've cut our CLAUDE.md from 4,000 tokens to about 900. We removed six "always" instructions, two escape-hatch paragraphs, three unowned examples, and reorganized the split between repo-state and team-conventions.

Output quality went up. Response time went down. New hires learn our conventions from the team-guide file (which is now a useful team document, not a Claude-only artifact). And critically — the file now gets updated. When it was a wall of text no one owned, it was a wall of text no one maintained. Now that it's tight and scoped, changes to it fit in PRs and get real review.

The meta-lesson

The goal of CLAUDE.md isn't to describe your codebase. It's to shape what Claude does with your codebase. Those aren't the same document.

FA

Written by

Fatima A.

Fatima covers developer experience, tooling architecture, and how MCP-native workflows change day-to-day dev.

Get cctk running in one command

85 slash commands, 12 subagents, 12 MCP integrations, 12 hooks. All the patterns from this post are shipped in cctk.

npx cctk@latest init Get cctk v1.5.2 →