Claude Code Rules Guide — CLAUDE.md and .claude/rules
Claude Code gets sharp when project rules are short, strict, and always nearby. It gets expensive when every session re-discovers your tree.
Here’s how to think about Claude Code rules — and why the token-saving layer should be a purchased pack, not a DIY paste.
Where Claude Code reads instructions
Common patterns:
| Location | Use when |
|---|---|
CLAUDE.md | Repo-wide defaults you want obvious in git |
.claude/rules/ | Modular rules (cost, testing, API contracts) |
| Local overrides | Machine-specific notes you should not commit |
Prefer modular files once anything grows past “one screen.”
Claude Code among other agent rule locations
What belongs in your rules
Put your project truths in-repo:
- How to run tests
- Public APIs that must not break
- Stack notes unique to this product
Skip:
- Long product marketing copy
- Duplicating the entire README
- A home-grown “cost engine” you’ll abandon in a month
Prompt hygiene still matters
Even great rules can’t save a prompt that asks Claude Code to “read the whole backend and make it better.”
Prefer:
Task: Add retry to webhook handler
In: lib/webhooks.ts, tests/webhooks.test.ts
Constraints: no new dependencies
Pair that with a real pack for enforcement: context windows.
Buy Token Kits for the cost layer
Token Kits is lifetime access to the battle-tested token-saving pack:
- Aimed at cutting agent spend roughly in half
- Installs into Claude Code’s rules path after you buy
- Same product if you also use Cursor, Windsurf, or Copilot
- $39 prelaunch for the first 100, then $79 one-time
We don’t publish the pack contents or free install one-liners in blog posts. Checkout unlocks your install instructions.
Keep Claude Code sessions inside a token budget
Team rollout checklist
- Short project
CLAUDE.mdfor local truths - Token Kits purchased for the cost pack
- Install completed from post-purchase instructions
- Teammates use the same pack
- Monthly cleanup of stale project notes
FAQ
Is CLAUDE.md required?
Not always — but a visible, committed instruction file helps humans and agents align.
Can I use AGENTS.md too?
Yes. Many teams keep AGENTS.md as a universal baseline and buy Token Kits for denser always-on control.
Will this guide give me the Token Kits file?
No. Buy lifetime access to unlock it.
Bottom line
Claude Code is fast when the rules are. Buy the pack that stays strict — then keep your project notes thin.
