- Get Into AI
- Posts
- This File Fixed Claude For Me.
This File Fixed Claude For Me.
How you can become a better developer
The Future of AI in Marketing. Your Shortcut to Smarter, Faster Marketing.
Unlock a focused set of AI strategies built to streamline your work and maximize impact. This guide delivers the practical tactics and tools marketers need to start seeing results right away:
7 high-impact AI strategies to accelerate your marketing performance
Practical use cases for content creation, lead gen, and personalization
Expert insights into how top marketers are using AI today
A framework to evaluate and implement AI tools efficiently
Stay ahead of the curve with these top strategies AI helped develop for marketers, built for real-world results.
Claude Code forgets your rules mid-session.
It starts following your conventions, then randomly stops. You ask it to use TypeScript and it outputs JavaScript. You tell it to write tests and it skips them.
The fix isn't better prompts. It's a better CLAUDE.md file.
Here are 15 patterns that actually work, including one trick that tells you exactly when Claude stops reading your instructions.
What CLAUDE.md actually does
CLAUDE.md is a file that gets loaded into every Claude Code conversation automatically.
It's not magic. It's context injection.
Claude reads this file at the start of each session. Whatever you put there becomes part of every prompt—without you typing it again.
The problem: most CLAUDE.md files are too long, too vague, or structured wrong.
The 15 patterns that work
1. The "Mr. Tinkleberry" Detection Trick
Add a requirement that Claude address you by a specific name:
Always address me as "Captain" at the start of each response. When Claude stops saying "Captain," you know it's no longer reading your CLAUDE.md. Time to /compact or /clear.
This simple trick saves hours of debugging "why isn't it following my rules?"
2. Keep it under 50 lines
Research shows LLMs follow ~150-200 instructions reliably. More than that, adherence drops fast.
Your CLAUDE.md isn't a wiki. It's a prompt. Treat it like one.
3. Commands at the top
# Commands
- `npm run build` - Build the project
- `npm run test` - Run tests
- `npm run lint` - Check code styleClaude looks for these first. Don't bury them.
4. Be specific, not generic
❌ Bad:
Write clean code and follow best practices.✅ Good:
Use 2-space indentation. No semicolons. Prefer const over let.5. Use the @import syntax
Don't stuff everything in CLAUDE.md. Reference other files:
See @README.md for project overview.
See @docs/api.md for endpoint specs.Claude loads these on demand, saving context for actual work.
6. Structure with clear headers
# Project Overview
React Native app for fitness tracking.
# Code Style
- TypeScript strict mode
- Functional components only
- Tailwind for styling
# Testing
Run `npm test` after every change.7. Add a verification step
After making changes, always run:
1. `npm run typecheck`
2. `npm run test`
3. `npm run lint`Claude follows explicit sequences better than implicit expectations.
8. Use CLAUDE.local.md for personal preferences
This file is gitignored by default. Put your personal quirks here:
# My preferences (not shared with team)
- Explain changes before making them
- Commit after each logical change
- Use verbose variable names9. Subdirectory CLAUDE.md files
Create /tests/CLAUDE.md with test-specific rules:
# Testing conventions
- Use Jest describe/it blocks
- Mock all external APIs
- Minimum 80% coverageClaude reads the nearest CLAUDE.md when working in that directory.
10. The "don't forget" pattern
IMPORTANT: Never modify files in /config without asking first.
YOU MUST run tests before committing.Adding emphasis ("IMPORTANT", "YOU MUST") improves adherence.
11. Negative instructions work better
❌ Vague:
Handle errors properly.✅ Specific:
Never use empty catch blocks. Always log errors with context.12. Include common mistakes
# Known issues
- The auth module uses a legacy JWT format—don't try to modernize it
- /api/v1 routes are deprecated but still used by mobile clientsThis prevents Claude from "helpfully" breaking things.
13. Reference your stack explicitly
# Stack
- Next.js 14 (App Router)
- Prisma + PostgreSQL
- Tailwind CSS
- Deployed on VercelDon't assume Claude will figure out your stack from package.json.
14. Use the prompt improver
Anthropic has a prompt optimization tool. Run your CLAUDE.md through it occasionally. Small changes in wording can dramatically improve instruction following.
15. Refactor it regularly
CLAUDE.md should evolve with your project. Dead rules waste context. Outdated commands cause errors.
Schedule a monthly review.
A starter template
# [Project Name]
## Commands
- `npm run dev` - Start development server
- `npm run build` - Production build
- `npm run test` - Run tests
## Code Style
- TypeScript strict mode
- 2-space indentation
- Functional components with hooks
- Prefer named exports
## Rules
- ALWAYS run tests before committing
- NEVER modify /config without asking
- Ask before deleting any file
## Verification
After changes, run: `npm run typecheck && npm run test`
See @README.md for full project context.Copy this. Customize it. Iterate.
What to try today
Run
/initif you don't have a CLAUDE.md yet.Add the "Mr. Tinkleberry" detection trick with your preferred name.
Cut your CLAUDE.md to under 50 lines.
Add explicit verification commands.
Once Claude actually remembers your rules, everything changes.
Catch you tomorrow.
If this fixed your Claude Code amnesia, share it with a developer who's tired of repeating themselves every session.


Reply