GUIDESEPISODES
Claude Code tips: spec, model, effort, skills, hooks
You asked for a login page and got a whole social network. Claude didn’t misbehave: you ordered badly. Here are the four orders that fix it. A spec before the build, the right model, the right effort, and a skill plus a hook. Every line is checked against Anthropic’s own docs.

01COURSE 1
Let Claude interview you before it cooks
Why it mattersEvery question Claude asks now is a guess it doesn’t make later.
Here’s how the social network happened. You typed one line, “build me a login page”, and Claude filled every gap with a guess. Email or Google? Password reset? A profile page? It guessed yes to all of it.

Open the full chapterIncludes code, a note
The fix is to let Claude ask first. Anthropic’s best-practices page says: “For larger features, have Claude interview you first.” It even gives the prompt. Swap [brief description] for your feature:
I want to build [brief description]. Interview me in detail using the AskUserQuestion tool.
Ask about technical implementation, UI/UX, edge cases, concerns, and tradeoffs. Don't ask obvious questions, dig into the hard parts I might not have considered.
Keep interviewing until we've covered everything, then write a complete spec to SPEC.md.Copied word for word from Anthropic’s best-practices page.
Claude asks about the parts you hadn’t thought of: the “technical implementation, UI/UX, edge cases, and tradeoffs.” Answer in plain words. When it runs out of questions, it writes everything to SPEC.md.
What a good spec has
The docs say the most useful specs are self-contained. They “name the files and interfaces involved” and “state what is out of scope.” They end with a check “that proves the feature works.”
- Files: which pages, routes and tables change.
- Out of scope: “no profile page, no social login” stops the extra dishes.
- The check: one test or click path that proves the feature works.
02COURSE 1, PART 2
Then cook the spec at a fresh table
Why it mattersThe spec carries what matters. The chat history only carries noise.
The interview fills Claude’s memory with questions, answers and second thoughts. Don’t build in that same chat.

Open the full chapterIncludes code, a note
The docs: “Once the spec is complete, start a fresh session to execute it. The new session has clean context focused entirely on implementation, and you have a written spec to reference.”
/clear
Read SPEC.md and build it. Run the end-to-end check at the bottom of the spec when you're done./clear resets the conversation. SPEC.md is on disk, so nothing is lost.
03COURSE 2
The menu: pick the model with /model
Why it mattersThe right chef for the dish is faster and cheaper than the best chef for everything.
Using the biggest model for everything is a five-star chef making toast. It works, it’s slower, and it costs more. Type /model to switch at any time.

Open the full chapterIncludes a table, code, a note
| Alias | What the docs say it’s for |
|---|---|
sonnet | Uses the latest Sonnet model for daily coding tasks |
opus | Uses the latest Opus model for complex reasoning tasks |
haiku | Uses the fast and efficient Haiku model for simple tasks |
opusplan | Uses opus during plan mode, then switches to sonnet for execution |
/model sonnet everyday coding
/model opus a hard design or a multi-step problem
/model haiku a small, simple job
/model opusplan Opus while you plan, Sonnet when it buildsThe notes on the right are ours, not part of the command.
The costs page puts it plainly: “Sonnet handles most coding tasks well and costs less than Opus. Reserve Opus for complex architectural decisions or multi-step reasoning.” You can also set a default in /config.
04COURSE 3
Doneness: pick the effort with /effort
Why it mattersMedium for most work, high for bugs, ultrathink for the one hard turn.
Effort is how hard Claude thinks before it answers. More effort means more thinking tokens, and the costs page says thinking tokens “are billed as output tokens.”

Open the full chapterIncludes a table, code, a note
| Level | When the docs say to use it |
|---|---|
low | Quick exchanges, a first sketch, or a small change like a rename |
medium | The default on Opus 5.5, Sonnet 5.5 and Haiku 5.5. Day-to-day work with a clear scope |
high | Work where verification matters or edge cases are likely, such as fixing a bug |
xhigh | Deeper reasoning at higher token spend |
max | Hard problems you want Claude to work through alone. It “is prone to overthinking”, so test it first |
/effort open the slider
/effort high set a level directly
/effort auto clear your saved level for this model
ultrathink why does login fail only after the session times out?One hard question? Type ultrathink
You don’t need to change the dial for one tough turn. The docs: “Include ultrathink anywhere in your prompt to request deeper reasoning on that turn without changing your session effort setting.”
05DESSERT
Order “the usual”: turn a repeat prompt into a skill
Why it mattersA skill is a prompt you write once and order by name.
If you paste the same long prompt every day, you are reading the whole menu out loud every night. The skills page says to “create a skill when you keep pasting the same instructions, checklist, or multi-step procedure into chat.”

Open the full chapterIncludes steps, code, a note
- Make a folder:
.claude/skills/<name>/. - Add a
SKILL.mdfile inside it, with a short header and your instructions. - Type
/<name>to run it. The folder name becomes the command.
Here is the docs’ own example. $ARGUMENTS is whatever you type after the command. So /fix-issue 1234 works on issue 1234:
---
name: fix-issue
description: Fix a GitHub issue
disable-model-invocation: true
---
Analyze and fix the GitHub issue: $ARGUMENTS.
1. Use `gh issue view` to get the issue details
2. Understand the problem described in the issue
3. Search the codebase for relevant files
4. Implement the necessary changes to fix the issue
5. Write and run tests to verify the fix
6. Ensure code passes linting and type checking
7. Create a descriptive commit message
8. Push and create a PRdisable-model-invocation: true means only you can start it. The docs suggest it “for workflows with side effects that you want to trigger manually.”
06THE BOUNCER
A rule that must always hold? Hire a hook
Why it mattersCLAUDE.md is advice. A hook is a rule that runs every time.
“Never touch my .env file” in CLAUDE.md is a polite request. Most days Claude follows it. A hook makes it a rule. Anthropic’s words: “Unlike CLAUDE.md instructions which are advisory, hooks are deterministic and guarantee the action happens.”

Open the full chapterIncludes code, a note
A hook is a small script Claude Code runs at a set moment. A PreToolUse hook runs before a tool call, and it can block it. This one is copied from the hooks guide. It checks the file Claude wants to edit, and exits with code 2 if it matches .env.
Step 1: the script
#!/bin/bash
# protect-files.sh
INPUT=$(cat)
FILE_PATH=$(echo "$INPUT" | jq -r '.tool_input.file_path // empty')
# Normalize Windows backslash separators so the patterns below match
FILE_PATH="${FILE_PATH//\\//}"
PROTECTED_PATTERNS=(".env" "package-lock.json" ".git/")
for pattern in "${PROTECTED_PATTERNS[@]}"; do
if [[ "$FILE_PATH" == *"$pattern"* ]]; then
echo "Blocked: $FILE_PATH matches protected pattern '$pattern'" >&2
exit 2
fi
done
exit 0Exit code 2 blocks the edit. The message on stderr goes back to Claude, so it knows why. It needs jq installed.
Step 2: make it executable
chmod +x .claude/hooks/protect-files.shStep 3: register it
{
"hooks": {
"PreToolUse": [
{
"matcher": "Edit|Write",
"hooks": [
{
"type": "command",
"command": "\"$CLAUDE_PROJECT_DIR\"/.claude/hooks/protect-files.sh"
}
]
}
]
}
}If the file already has a hooks key, add PreToolUse inside it. Don’t replace what’s there.
Step 4: test it
Ask Claude to add a comment to your .env file. The docs say Claude Code “blocks the edit before it runs” and passes the Blocked: message to Claude. Type /hooks to see every hook you have.
07THE BILL
Your order sheet: the four tips on one page
Why it mattersOrder well once, and every meal after that is faster.
Keep this next to your editor. The model and effort pairs are our suggestion, built from the docs’ own descriptions. Your tasks may need a different mix.

Open the full chapterIncludes a table, a note
| Your task | Model | Effort |
|---|---|---|
| Rename a button, fix a typo | haiku or sonnet | low |
Build a feature from SPEC.md | sonnet | medium |
| Fix a bug in existing code | sonnet | high |
| Plan a big change, then build it | opusplan | medium |
| A hard design or multi-step problem | opus | high, or ultrathink for one turn |
| Tip | Do this | Not this |
|---|---|---|
| Spec first | Interview → SPEC.md → fresh session | One line, then fix the guesses |
| Model | /model per task | Opus for everything |
| Effort | Medium most days, high for bugs | Max on everything |
| Skill | .claude/skills/<name>/SKILL.md → /name | Pasting the same prompt daily |
| Hook | PreToolUse hook that exits 2 | Hoping CLAUDE.md is followed |
Paste the prompt at the top of this page into Claude Code. It creates the /spec skill and the .env hook, and it shows you each file before saving.
THE QUICK READ
What to take away.
In one minute.
- 01
For a larger feature, let Claude interview you and “write a complete spec to SPEC.md.” Then “start a fresh session to execute it.”
- 02
/modelpicks the chef. Sonnet is for “daily coding tasks”, Opus for “complex reasoning tasks”, Haiku for “simple tasks”. Sonnet “costs less than Opus.” - 03
opusplanuses Opus in plan mode, then switches to Sonnet to build. Smart plan, cheaper cooking. - 04
/effortruns fromlowtomax. Medium is the default on the 5.5 models. High fits bug fixes. Max “is prone to overthinking.” - 05
Type
ultrathinkin one prompt for deeper reasoning on that turn only. Your effort setting stays the same. - 06
Paste the same prompt every day? Make it a skill:
.claude/skills/<name>/SKILL.mdbecomes/name. - 07
A rule that must hold every time goes in a hook. The docs: CLAUDE.md is “advisory”, hooks are “deterministic”.
THE TAKEAWAY, IN ONE PASTE
Paste this once. Order right every time.
Paste this into Claude Code. It writes three files, a /spec skill, a hook script and .claude/settings.json, and shows you each one before it saves. It never opens your .env and changes nothing in CLAUDE.md.
Set up four Claude Code habits in this project. Never open a .env file and never print a key. 1. Create .claude/skills/spec/SKILL.md with the frontmatter name: spec, a one-line description and disable-model-invocation: true. Its body: "I want to build $ARGUMENTS. Interview me in detail using the AskUserQuestion tool. Ask about technical implementation, UI/UX, edge cases, concerns, and tradeoffs. Don't ask obvious questions. Keep interviewing until we've covered everything, then write a complete spec to SPEC.md." Then /spec <feature> starts the interview, and I build SPEC.md in a fresh session. 2. Create .claude/hooks/protect-files.sh from the "Block edits to protected files" example in the Claude Code hooks guide: it reads the tool input and exits with code 2 when the file path contains .env. Make it executable. 3. Register it in .claude/settings.json as a PreToolUse hook with the matcher "Edit|Write". Keep every setting already there. 4. Read CLAUDE.md and list any rule that must hold every time and could become a hook. Change nothing in it. 5. Finish with a short cheat sheet for my usual tasks: which /model (sonnet, opus, haiku, opusplan), which /effort level, and when to type ultrathink. Before you write anything, show me every file you will create or change. Wait for my OK.
Paste it into the agent you already build with
- Claude
- ChatGPT
- Gemini
- Cursor
- Copilot
QUESTIONS PEOPLE ASK
Good questions.
Short answers.
How do I make Claude Code ask me questions before it builds?
Ask for it. The docs’ prompt starts “Interview me in detail using the AskUserQuestion tool.” It ends “then write a complete spec to SPEC.md.” Then build the spec in a fresh session.
Which Claude model should I use for coding?
The docs describe sonnet as the model for daily coding tasks, opus for complex reasoning tasks and haiku for simple tasks. The costs page says Sonnet handles most coding tasks well and costs less than Opus.
What is opusplan in Claude Code?
A model setting that uses Opus during plan mode, then switches to Sonnet to carry out the plan. Type /model opusplan.
What effort level should I use?
Medium is the default on Opus 5.5, Sonnet 5.5 and Haiku 5.5, and it fits day-to-day work. The docs suggest high for work where edge cases are likely, such as fixing a bug. Max can overthink, so test it first.
What does ultrathink do?
Typing ultrathink anywhere in a prompt asks for deeper reasoning on that one turn. Your session’s effort setting doesn’t change.
How do I create a skill in Claude Code?
Make a folder .claude/skills/<name>/ with a SKILL.md file inside: a short header, then your instructions. Type /<name> to run it.
What is the difference between CLAUDE.md and a hook?
CLAUDE.md is instructions Claude reads and usually follows. A hook is a script Claude Code runs every time at a set moment. The docs call CLAUDE.md advisory and hooks deterministic.
Does Aster check my Claude Code setup?
No. Aster reads your GitHub repository and flags keys left in code, open Supabase and Firebase rules, and vulnerable Next.js and npm packages. Your skills, hooks and model settings are yours to set with this guide.
Spec first, the right model, the right effort, a skill for the repeat order and a hook for the must-always rule. Then get a second look at what Claude built: your first Aster repository audit is free, and it flags keys left in code, open Supabase and Firebase rules, and vulnerable packages.
Source notebook5 links
- Claude Code Docs: Best practices (Let Claude interview you, Set up hooks, Create skills)
- Claude Code Docs: Model configuration (model aliases, opusplan, effort levels, ultrathink)
- Claude Code Docs: Manage costs effectively (Choose the right model)
- Claude Code Docs: Extend Claude with skills
- Claude Code Docs: Automate actions with hooks (Block edits to protected files)

