Effective Prompting with Claude
Most bad results trace back to a context problem, not a model problem.
Beginner → Advanced
Fix the bug in the login flow.
The sign-in form at /signin redirects to /dashboard instead of
showing "invalid password" when credentials are wrong. Look at
src/auth/login.ts -- probably the catch block around the fetch
call. Don't touch the signup flow, it's unrelated.
CLAUDE.md is read automatically at the start of every session — the
place for what you'd otherwise re-explain: build/test commands, conventions the linter
won't catch, which directories are off-limits. Add to it when Claude makes the same
mistake twice, or you type the same correction two sessions in a row.
| File | Scope |
|---|---|
./CLAUDE.md | the project — committed, shared with the team |
~/.claude/CLAUDE.md | you, every project |
./CLAUDE.local.md | you, this project only — gitignore it |
/init to have Claude read the codebase and generate
a starting file; concrete beats vague ("use 2-space indentation," not "format code
properly"). It survives /compact (re-read from disk automatically), but a
stale CLAUDE.md that contradicts the actual codebase is worse than none at all.
# Build & test
npm run dev # local server on :3000
npm test -- --watch
# Conventions
2-space indentation, no semicolons.
Components live in src/components/, one per file.
# Off-limits
Never touch src/legacy/ -- scheduled for deletion, not worth fixing.
~/.claude/projects/<project>/memory/, shared across
every worktree of the same repo, with a MEMORY.md index (only its first 200
lines / 25KB load automatically) pointing at topic files that load on demand.
/memory to browse, edit, or turn it off. Since it's plain markdown,
nothing about it is hidden — if Claude misremembered something, just open the file and fix
it.
CLAUDE.md | Auto memory | |
|---|---|---|
| Who writes it | you | Claude, as it works |
| When it loads | in full, every session | on demand, via the MEMORY.md index |
| Good for | standing rules that never change: build commands, conventions, off-limits paths | things learned along the way: a preference stated once, a gotcha hit mid-session |
| Edit it | any text editor, committed with the repo | /memory, or open the markdown files directly |
/context to
confirm the file you expect actually loaded; if it did and Claude still isn't following
it, the instruction is probably too vague, or contradicted somewhere else in the tree. For
anything that must happen every single time regardless of what Claude decides — run the
linter before every commit, no exceptions — that's not a prompting problem at all, it's
what hooks are for.
Shift+Tab cycles into plan mode without typing anything.