Best Claude Code Settings & Configuration (2026): Power User Guide
Optimize your Claude Code setup with the best settings for CLAUDE.md, hooks, model routing, effort levels, permissions, and sub-agent configuration.
#Why Configuration Matters
Out of the box, Claude Code is good. Properly configured, it's transformative. The difference between a beginner and a power user isn't skill with prompts — it's how they've set up their environment.
This guide covers every configuration surface in Claude Code: CLAUDE.md files, settings.json, hooks, model selection, effort tuning, permissions, and sub-agent routing. Each section includes the actual config you should use.
#CLAUDE.md Best Practices
Your CLAUDE.md is the highest-leverage configuration file. Claude reads it at the start of every session. A good one saves you hundreds of repeated instructions.
#Project-Level CLAUDE.md
Place this at your project root and commit it to git. Your whole team benefits.
# CLAUDE.md## ProjectBrief description of what this project does.## Stack- Language: TypeScript 5.x- Framework: Next.js 15 (App Router)- Database: PostgreSQL via Drizzle ORM- Styling: Tailwind CSS- Testing: Vitest + Playwright- Package manager: pnpm## Commands- Dev: `pnpm dev`- Build: `pnpm build`- Test: `pnpm test`- Lint: `pnpm lint`- Type check: `pnpm tsc --noEmit`## Conventions- Components in src/components/, colocated with their tests- API routes in src/app/api/- Database schemas in src/db/schema/- Use server components by default, 'use client' only when needed- Error boundaries around all data-fetching components- Use zod for all input validation## Do NOT- Use default exports (except pages/layouts)- Add new dependencies without checking if we already have an equivalent- Modify the auth middleware without discussing firstKey principles:
- Be specific about commands — include flags and paths
- List conventions that Claude might not infer from code alone
- Add a "Do NOT" section for common mistakes you've had to correct
#Personal CLAUDE.md
Place at ~/.claude/CLAUDE.md for preferences that apply across all projects:
# Personal Preferences- Always use TypeScript, never plain JavaScript- Prefer functional components over class components- Write tests for any new function with >5 lines of logic- Use descriptive variable names, no single-letter variables except loop counters- When creating commits, use conventional commit format#Nested CLAUDE.md
You can place CLAUDE.md files in subdirectories. Claude reads them when working in those directories:
src/ components/ CLAUDE.md # "All components use forwardRef and accept className prop" api/ CLAUDE.md # "All API routes validate input with zod, return standardized error format"Deep dive: Claude Code Memory & CLAUDE.md Guide
Want step-by-step guides for this and more?
ClawDocx Pro includes 500+ curated prompts, setup guides, SKILL.md files, and templates — everything to make your AI agent unstoppable.
See plans & pricing#Settings.json Configuration
Claude Code reads settings from two locations:
- Project:
.claude/settings.json(committed, shared with team) - Global:
~/.claude/settings.json(personal)
#Recommended Project Settings
{ "permissions": { "allow": [ "Read", "Glob", "Grep", "Bash(pnpm test*)", "Bash(pnpm lint*)", "Bash(pnpm build*)", "Bash(pnpm dev*)", "Bash(npx tsc*)" ], "deny": [ "Bash(rm -rf*)", "Bash(git push*)", "Bash(git reset --hard*)" ] }}Why this matters: The allow list lets Claude run tests, lint, and build without asking permission every time. The deny list prevents destructive operations. This balances autonomy with safety.
#Permission Modes
Claude Code has three permission modes:
| Mode | Behavior |
|---|---|
| Default | Asks permission for writes, commands, and sensitive operations |
| Permissive | Auto-approves most operations, only blocks dangerous commands |
| Restricted | Requires approval for everything |
For solo development, permissive mode with a solid deny list is the fastest workflow. For shared environments, default mode with explicit allow lists is safer.
#Hooks Configuration
Hooks fire automatically on Claude Code events. They live in .claude/settings.json under the hooks key.
#Auto-Format on File Write
{ "hooks": { "afterWrite": [ { "command": "npx prettier --write $FILE", "description": "Auto-format written files" } ] }}#Lint Check Before Commit
{ "hooks": { "beforeCommit": [ { "command": "pnpm lint --quiet", "description": "Lint before committing" } ] }}#Block Writes to Protected Files
{ "hooks": { "beforeWrite": [ { "command": "echo $FILE | grep -qE '(package-lock|pnpm-lock|\\.env)' && exit 1 || exit 0", "description": "Prevent writes to lock files and .env" } ] }}Stack multiple hooks per event. They run in order — if any hook exits non-zero, the operation is blocked.
Deep dive: Claude Code Hooks Beginner's Guide
#Model Selection Strategy
Use /model to switch between models mid-session. Here's when to use each:
| Model | Best For | Token Cost |
|---|---|---|
| Opus 4.6 | Complex architecture, nuanced refactoring, debugging hard issues, multi-file changes | Highest |
| Sonnet 4.6 | Standard feature implementation, code review, writing tests | Medium |
| Haiku 4.5 | Quick questions, simple edits, file lookups, explanations | Lowest |
Power user pattern: Start a session with Opus for planning and architecture, switch to Sonnet for implementation, drop to Haiku for quick follow-up questions.
Sub-agents automatically route to cheaper models when appropriate — Explore uses Haiku by default. You can override this in custom sub-agent definitions.
#Effort Level Tuning
The /effort command controls how deeply Claude reasons about each response.
| Level | Tokens | Use Case |
|---|---|---|
| low | ~500-1K | Rename a variable, answer a quick question, simple file edit |
| medium | ~1-3K | Standard feature work, write a function, add a test |
| high | ~3-10K+ | Debug a complex issue, architect a new module, refactor across files |
Default is medium. Most power users leave it there and switch to high only for specific complex tasks. Using high for everything wastes tokens and slows you down.
Full breakdown: Effort, Context & Slash Commands
#/compact Strategy
Context window management is one of the biggest levers for Claude Code quality. Here's the strategy:
- Proactive compaction: Run
/compactevery 15-20 messages, or whenever you shift to a new task within a session - Before complex tasks: Compact before starting a major feature so Claude has maximum context space
- When quality drops: If Claude starts repeating itself, losing track of requirements, or producing lower-quality code, compact immediately
- Custom summary: You can provide a focus —
/compact focus on the auth module changes— to preserve specific context
#Sub-Agent Routing Rules
For custom sub-agents, you can control model, tools, and system prompt:
<!-- In CLAUDE.md -->## Custom Agents- For database migration tasks, use Opus with full shell access- For documentation generation, use Haiku with read-only access- For security review, use Opus with read-only access and emphasize OWASP top 10Claude Code will respect these routing preferences when delegating to sub-agents. The key insight: cheap models for exploration, expensive models for decision-making.
Deep dive: Claude Code Sub-Agents Guide
#Memory Management
Beyond CLAUDE.md, Claude Code maintains a .claude/ directory with auto-generated memories. Manage this actively:
- Review periodically: Check
.claude/to see what Claude has remembered. Delete anything outdated. - Seed important context: Add files to
.claude/manually for context you want persisted across sessions but don't want in the committed CLAUDE.md. - Keep CLAUDE.md lean: If your CLAUDE.md exceeds ~100 lines, it's too long. Move detailed information to separate files in
.claude/and reference them.
#The Complete Power User Setup
Here's everything together — a checklist for optimizing a new project:
- Create
CLAUDE.mdat project root with stack, commands, conventions, and "do not" rules - Create
.claude/settings.jsonwith permission allow/deny lists - Add hooks for formatting, linting, and protected file guards
- Set up nested
CLAUDE.mdfiles for directories with special conventions - Configure your personal
~/.claude/CLAUDE.mdwith cross-project preferences - Establish a
/compacthabit — proactive, not reactive
The payoff compounds. Each session starts smarter than the last, and you spend less time correcting Claude and more time shipping.
#Further Reading
- The Ultimate Claude Code Guide — comprehensive overview of all features
- Claude Code for Beginners — if you're just getting started
- Claude Code Dispatch & Channels — automation and CI integration
- Agent Teams & Parallel Development — multi-agent workflows
- Claude Code in 2026 — voice, loop, and scheduled tasks
#FAQ
What's the single most impactful Claude Code setting?
CLAUDE.md. Nothing else comes close. A well-written CLAUDE.md file at your project root eliminates the majority of correction cycles and makes Claude Code behave like a teammate who knows your codebase. Invest 10 minutes writing a thorough one before configuring anything else.
Should I use permissive mode or default mode?
For solo development on personal projects, permissive mode with a deny list for destructive operations is fastest. For team projects or anything in production, use default mode with explicit allow lists. The few seconds of approval clicks are worth the safety. Never use restricted mode unless you have a specific compliance requirement — it kills productivity.
How often should I run /compact?
Every 15-20 messages, or whenever you notice quality degradation. Many power users compact proactively before starting each new major task, even if the conversation isn't that long yet. Think of it like saving your game — do it before the boss fight, not after you've already lost.
Can I share Claude Code settings across a team?
Yes. Commit .claude/settings.json and your root CLAUDE.md to git. These are designed to be shared. Personal preferences go in ~/.claude/CLAUDE.md and ~/.claude/settings.json, which stay local. This gives teams consistent behavior while letting individuals customize their experience.
Does the model I choose really matter that much?
Yes. Opus 4.6 produces noticeably better results for complex tasks — architecture decisions, multi-file refactoring, subtle bug diagnosis. But it's 5-10x more expensive than Haiku. The power user approach is strategic switching: Opus for thinking, Sonnet for implementing, Haiku for searching. Don't use Opus for everything — your bill will thank you.