Share

CLAUDE.md section that stops Claude Code from re-implementing helpers

Open · 5 views · asked by felix_codes · edited

Paste this at the top of your CLAUDE.md. It made the biggest difference of anything I tried: the grep instruction is something Claude Code actually executes.

CLAUDE.md
Copied 18 times
## Before you write code

- Before writing any helper, run `grep -rn "export function" lib/` and reuse what exists.
- `lib/index.ts` re-exports everything. Read it first; it is the map of this repo.
- Do not touch files in `tests/` unless the task says so. If a test fails, fix the code, not the test.
- One change per response. Show the diff, then stop.
Comment

Activity