Setup & Configuration
Foundation1 Write a great CLAUDE.md — it's the highest ROI action
Claude reads CLAUDE.md at session start and treats it as standing instructions. Include: stack overview, test commands, code style rules, file structure conventions, and any "always/never" rules. Run /init to auto-generate a draft from your existing codebase, then refine it. Every hour you spend improving CLAUDE.md saves hours of repeated prompting.
2 Layer CLAUDE.md files per directory
Claude reads CLAUDE.md files up the directory tree. Put global rules in the repo root, frontend-specific rules in src/client/CLAUDE.md, API rules in src/api/CLAUDE.md. Claude automatically picks up the relevant subset based on where you're working.
3 Use /fewer-permission-prompts to cut friction
The /fewer-permission-prompts skill scans your recent transcripts and auto-generates an allowlist in .claude/settings.json for every tool you've approved repeatedly. Run it once at project start and eliminate 80% of permission prompts.
4 Set a cheaper model for simple tasks
Use /config to switch to Haiku 4.5 for boilerplate generation, comment updates, and rename operations — it's 10× cheaper than Sonnet. Switch back to Sonnet or Opus for architecture decisions, complex debugging, and security reviews.
Context & Cost Optimization
Efficiency5 Put stable context at the top of CLAUDE.md
Prompt caching freezes from the top. Put your full tech stack, schemas, and invariant rules at the top of CLAUDE.md — they'll be cached across sessions. Put dynamic state (current sprint goals, active bugs) near the bottom where it changes.
6 Use /clear to reset context mid-session
When you switch from one task to a completely different one in the same session, run /clear to discard the accumulated context. A fresh context window is cheaper and less confusing than carrying a debugging thread into a feature build.
7 Use /compact to summarize before big tasks
Before a long autonomous task (e.g. "refactor the auth module"), run /compact to compress prior conversation into a summary. Claude retains what matters but frees context space for new file reads and tool results.
Parallelism & Agents
Scale8 Use git worktrees for parallel agents
Run two or more Claude Code sessions on the same repo without conflicts:
git worktree add ../feature-auth feature/auth
git worktree add ../feature-payments feature/payments
Open a terminal in each worktree directory and run Claude Code independently. Full isolation — no merge conflicts between agents during concurrent work.
9 Spawn subagents for research phases
Tell Claude to use the Agent tool for open-ended research: "spawn a subagent to find all usages of the deprecated auth function across the codebase." The subagent runs in its own context window, protecting the main conversation from being flooded with grep results.
10 Use /loop for iterative tasks
/loop 5m /security-review runs your security review every 5 minutes — useful while you're actively writing risky code (auth, crypto, SQL). /loop without an interval lets Claude self-pace: it decides when to re-check based on what changed.
Code Review & Quality
Quality11 Run /ultrareview before any significant merge
/ultrareview launches a multi-agent cloud review: security pass, logic pass, test coverage pass, style pass — all running in parallel and synthesized into a single report. Use /ultrareview 142 to review a GitHub PR by number.
12 Run /security-review before shipping auth changes
The /security-review skill is a focused OWASP-aware pass over your changed files. It catches SQL injection risks, hardcoded secrets, missing input validation, and broken access control patterns — things a general /review often misses.
13 Use /simplify after getting something working
Once code passes tests, run /simplify. It audits for over-engineering: duplicate logic, premature abstractions, unnecessary wrappers. A common pattern: Claude over-builds to make something work, then /simplify trims it to the minimal correct solution.
Hooks & Automation
Automation14 Auto-run tests after every file edit
Add a PostToolUse hook for Write that runs your test suite on the changed file:
{ "PostToolUse": [{ "matcher": "Write", "hooks": [{
"type": "command",
"command": "npm test -- --testPathPattern=$CLAUDE_TOOL_INPUT_FILE_PATH 2>&1 | tail -20"
}]}]}
Claude sees test output immediately and self-corrects if anything breaks.
15 Block pushes to main with a PreToolUse hook
{ "PreToolUse": [{ "matcher": "Bash", "hooks": [{
"type": "command",
"command": "if echo \"$CLAUDE_TOOL_INPUT_COMMAND\" | grep -q 'push.*main'; then echo 'Push to main blocked'; exit 1; fi"
}]}]}
16 Log every tool call for debugging
Add a PostToolUse hook that appends to a log file. Useful when Claude runs long autonomous tasks and you want a full audit trail without reading every turn:
{ "PostToolUse": [{ "matcher": ".*", "hooks": [{
"type": "command",
"command": "echo \"$(date -u +%H:%M:%S) $CLAUDE_TOOL_NAME\" >> /tmp/claude-audit.log"
}]}]}
MCP & External Tools
Integration17 Add the GitHub MCP server for any repo work
claude mcp add github -- npx -y @modelcontextprotocol/server-github
Claude can then read PR descriptions, review comments, linked issues, and file history without you copy-pasting anything. Pair with GITHUB_TOKEN in your env for write access.
18 Use the filesystem MCP to access files outside the project
claude mcp add files -- npx -y @modelcontextprotocol/server-filesystem ~/Documents
Reference external design docs, API contracts, or data files without copying them into the repo. Claude reads them on demand.
Scheduling & Long-Running Tasks
Persistence19 Schedule daily health checks
Use /schedule to set up recurring automated tasks that run without a human in the loop:
/schedule every weekday at 8am check for new failing tests and open a GitHub issue with the details
20 Use /loop without an interval for adaptive polling
When monitoring a long build or a flaky test, /loop with no interval lets Claude decide the check frequency. It reads the state, decides "nothing changed yet, check again in 90s" — smarter than a fixed timer.
Power-User Tricks
Advanced21 Reference files with @ in your prompt
Type @src/auth/middleware.ts in any prompt to include that file in context without reading it first. Claude will load it automatically. Works for directories too: @src/api/ includes all files in the folder.
22 Use EnterPlanMode for big tasks before coding
For complex features, start with "enter plan mode and plan how to implement X before writing any code." Claude will draft a step-by-step implementation plan and ask for your approval before touching files. Prevents runaway implementations that go in the wrong direction.
23 Pin important constraints in CLAUDE.md as hard rules
Use ALL CAPS for non-negotiable rules: "NEVER commit directly to main", "ALWAYS run the test suite before creating a PR", "NEVER modify the migration files once merged". Claude treats capitalized imperatives as blocking constraints.
24 Use TodoWrite to track multi-step tasks
For tasks with 5+ steps, ask Claude to create a TodoWrite list first. Claude marks items done as it goes, and you can see progress at a glance without reading every tool call. Prevents Claude from losing track mid-task.
25 Use Fast Mode for latency-sensitive workflows
Toggle /fast to enable Fast Mode — it uses Claude Opus with optimized output generation for lower perceived latency. Especially useful for tight edit-test-fix loops where waiting for Claude to "think" breaks your flow.
Browse All Claude Code Skills
Find every slash command, hook pattern, MCP server, and automation template in one place.
Open Claude Skills Browser →