CLAUDE.md template, hooks and prompts to copy

How to use the templates

Here are things you can copy straight away. They come from my real setup, and I only shortened them and stripped out everything personal.

You don’t have to write or save anything by hand; just paste a template into the conversation and tell Claude to save it and adapt it to your project, for example “Save this as .claude/agents/critic.md and adapt it to my project.”

Tip

Above all, don’t add everything at once, because that’s exactly how I clogged up my setup over the summer. Start with the CLAUDE.md file and add the hook, the critic or the permissions one at a time, once you run into the problem they solve. Why I work this way is described in My setup.

Verified

I checked the syntax against the official Claude Code documentation in November 2026, but Claude Code changes quickly, so if something doesn’t work, ask Claude to compare it with the current documentation.

Prompt builder

A good prompt has five parts: what you want, who it's for, what you're starting from, the constraints and how you'll know it's done. Why each of them matters is shown on the Before and after page. Here you just fill them in in your own words and the prompt assembles itself, split into labelled parts so Claude reads it easily. The safeguards below the fields add rules that have worked for me: a plan first, no invented details and proof at the end.

The task and the definition of done stay in the prompt as a placeholder in square brackets until you fill them in. Other empty parts are left out. Nothing is sent anywhere; the prompt is put together only in your browser.

Starter CLAUDE.md

CLAUDE.md is the rules file Claude reads at the start of every conversation. This skeleton has six parts, describing what the project does, the rules, what not to touch, when each kind of work counts as done, lessons from mistakes, and what to keep when a long conversation gets compacted. Replace the project description with your own and leave the last two parts almost empty, because Claude will fill them in over time.

# Project
A web calculator for the family budget. I'm the only user.
I don't code. Explain things simply and without jargon.

# Rules
- Reply in English.
- Before you say "done", verify the result with a test.
  Add a line "Verified: <what you ran and what came out>".
- One change, one commit.
- Before you ask me anything, try to find the answer in the project.
- Never calculate numbers in your head. Write a script for it.

# Do not touch
- data/originals/: read only, never overwrite.
- .env: never read, copy or commit.

# Task, tool, done
- Design changes: files in src/styles.
  Done when the page looks right on mobile and desktop.
- New feature: src/.
  Done when a test passed and I have seen it in the browser.

# Lessons from mistakes
- (add one sentence here: what went wrong and how to prevent it)

# When the conversation is compacted, keep
What is in progress, what is waiting for me and which files changed.

Done guard

This is a hook, a safeguard that Claude Code itself runs every time Claude finishes a reply. If Claude writes “done” and the “Verified:” line is missing, the hook sends it back to work with one sentence saying what to add, but only once, so it can’t get stuck in a loop. The first part goes into the project’s .claude/settings.json file and tells Claude Code when to run the hook.

{
  "hooks": {
    "Stop": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "python ${CLAUDE_PROJECT_DIR}/.claude/hooks/done_guard.py",
            "timeout": 30
          }
        ]
      }
    ]
  }
}

The second part is the Python script itself, which reads Claude’s last reply and looks for the word “done” and for the line with the proof. It works together with the rule in the CLAUDE.md above, where the rule tells Claude what to do and the hook makes sure it really did it.

# .claude/hooks/done_guard.py
# Stop hook: no "done" without a "Verified:" line.
import json
import re
import sys

data = json.loads(sys.stdin.buffer.read().decode("utf-8"))

# Loop guard: if the hook already sent the work back once, let it stop.
if data.get("stop_hook_active"):
    sys.exit(0)

text = data.get("last_assistant_message") or ""
claims_done = re.search(r"\b(done|finished|complete)\b", text, re.IGNORECASE)
has_proof = re.search(r"^Verified:", text, re.MULTILINE)

if claims_done and not has_proof:
    print(json.dumps({
        "decision": "block",
        "reason": "You report done without proof. Verify the result with a test "
                  "and add a line 'Verified: <what you ran and what came out>'.",
    }))
sys.exit(0)

Critic

The critic is a subagent, a helper with its own context, and it goes into the .claude/agents/critic.md file. The top part between the dashes says what it’s called, when to use it, which tools it may have and which model it runs on, and writing and editing are deliberately missing from its tool list, so the critic can’t change anything. The rest of the file is its instructions, the most important of which is that it gets only the brief and the result, never the author’s opinion, because otherwise it would often just nod along.

---
name: critic
description: Independent review of finished work against the brief. Read only. Use it before handing over anything important. Pass it only the paths to the brief and the output, never your own conclusion.
tools: Read, Grep, Glob
model: opus
effort: medium
---
You are an independent critic. You change nothing and fix nothing. You only read and report.

Look for mistakes, not confirmation. Ignore the author's own assessment and verify everything yourself from the sources.

Steps:
1. Read the brief and list exactly what was asked for.
2. Read the output and compare it with the brief point by point.
3. For each finding give the location (file, line or cell), what you expected,
   what is there, and whether it MATCHES or DOES NOT MATCH.
4. If a source is missing, write NOT VERIFIED. Never fill in assumptions.
5. Check only against the brief. Don't propose rebuilds nobody asked for.

End with one verdict: USABLE, FIX BEFORE USE, or STOP.

I also fell into one trap, because if the description contains a colon and isn’t in quotes, the file may silently fail to load and the agent is simply missing. That’s why I never use colons in the description.

Permissions

This setting goes into the .claude/settings.json file and has three lists, where allow says what Claude may do without asking, ask when it has to ask first, and deny what it may never do. The asterisk stands for anything that follows the command, and a deny rule always wins, so a forced push to GitHub stays blocked even though a normal push only needs your approval. Here Claude may read, search, edit files and save changes, but it may not read passwords and keys or touch the folder with the originals. The cleanupPeriodDays line keeps your conversation history longer, because without it Claude Code silently deletes old conversations after 30 days, except for conversations from the desktop app, which it keeps longer since version 2.1.248.

{
  "permissions": {
    "defaultMode": "acceptEdits",
    "allow": [
      "Read",
      "Grep",
      "Glob",
      "WebSearch",
      "Bash(git status *)",
      "Bash(git diff *)",
      "Bash(git log *)",
      "Bash(git add *)",
      "Bash(git commit *)",
      "Bash(npm run *)"
    ],
    "ask": [
      "Bash(git push *)",
      "Bash(npm install *)"
    ],
    "deny": [
      "Bash(git push --force *)",
      "Bash(git reset --hard *)",
      "Bash(rm -rf *)",
      "Read(./.env)",
      "Read(./.env.*)",
      "Read(./secrets/**)",
      "Read(~/.ssh/**)",
      "Edit(./data/originals/**)"
    ]
  },
  "cleanupPeriodDays": 365
}

Proven prompts

These are the sentences I write to Claude most often, and each one deals with one specific weakness of the agent, so feel free to copy them word for word.

1. Plan first. When: for anything bigger than one small tweak.

Before you start, write me a plan as a list. Don't change anything until I approve it.

2. Proof, not promises. When: every time Claude reports that it's done.

Show me proof that it works. What exactly did you run and what came out?

3. Search, then ask. When: Claude asks about something it already has in the project.

Before you ask me, search the project and the notes. In your question, say where you looked and what you found.

4. A second look. When: before handing over anything that matters.

Run the critic on this. Give it only the brief and the result, not your opinion of how it went.

5. Repetition becomes a skill. When: you are explaining the same procedure for the third time.

This is the third time we've done this. Turn it into a skill so you do it the same way next time.

6. A lesson into the rules. When: right after a mistake you never want to see again.

Add the lesson from this mistake to CLAUDE.md. One sentence, written as a rule.

7. A safeguard instead of reminders. When: you keep reminding Claude of the same thing.

I keep reminding you of this. Propose a hook that will check it for you. First describe exactly what it will do.

8. In plain words, please. When: you don't understand what actually changed.

Explain what you changed as if I couldn't code. Three sentences at most.

9. Split it and run in parallel. When: a big task is made of independent parts.

Split this into independent parts and run subagents on them in parallel. Give each one its own files; two agents must never edit the same file.

10. Memory clean-up. When: every few weeks, or when Claude follows outdated rules.

Go through memory and CLAUDE.md and find what no longer applies or contradicts itself. Show me the list before you delete anything.

11. Handover to a new conversation. When: the context is filling up and you want a clean start.

Sum up the state in five points: what is done, what is in progress, what is waiting for me and which files changed.

12. Numbers from a script. When: for every calculation that something depends on.

Don't calculate this number in your head. Write a script for it and show me both the input and the result.

You don’t have to use all of it; feel free to take one template and try it on a real task. More small tricks are in Tips & tricks, and if a template saves you time, or doesn’t work for you, write to me at team@euphronic.com.