Claude Code Power User Guide: Every Command, Shortcut, and Hidden Feature
The complete Claude Code reference for 2026 — CLAUDE.md architecture, MCP wiring, worktrees, slash commands, and the workflows that 10x your output.
A Claude Code cheat sheet hit #10 on Hacker News today with 144 points and 50 comments — developers bookmarking it because they keep discovering commands they didn't know existed. Claude Code shipped faster than its documentation. Most users know claude and a handful of slash commands. The power users running 10x the output know the other 80%.
This is that guide.
📁 Full source code and CLAUDE.md templates for this article are on GitHub: github.com/aistackinsights/stackinsights/claude-code-power-user-guide-2026
Why Claude Code Is Different from Every Other AI Coding Tool
Claude Code is not a plugin or a sidebar. It's an agentic loop running in your terminal — it reads files, executes bash, runs tests, makes commits, and calls MCP servers autonomously until the task is done or you stop it. The implication: every minute you spend learning it compounds.
Anthropic's internal benchmarks show Claude Code completing 60-70% of SWE-bench Verified tasks with the right prompting strategy and permission mode. The gap between a beginner and a power user isn't the model — it's the workflow.
The CLAUDE.md Architecture: Your Most Important Config File
Every project should have a CLAUDE.md at the root. This file is loaded into context at every session start and survives /compact — the only context that does.
There are three scopes:
| File | Scope |
|---|---|
./CLAUDE.md | Project (team-shared, commit to VCS) |
~/.claude/CLAUDE.md | Personal (applies across all projects) |
/etc/claude-code/CLAUDE.md | Managed (org-wide policy) |
A battle-tested CLAUDE.md structure:
# Project: MyApp
## Stack
- Next.js 16, TypeScript strict, Tailwind CSS, Prisma + PostgreSQL
- pnpm for package management
- Vitest for unit tests, Playwright for E2E
## Conventions
- Components: PascalCase, co-located tests (Component.test.tsx)
- API routes: zod validation on all inputs, never trust req.body
- Database: always use transactions for multi-table writes
- Commits: conventional commits (feat/fix/chore/docs)
## Commands
- `pnpm dev` — start dev server
- `pnpm test` — run unit tests
- `pnpm test:e2e` — run Playwright suite
- `pnpm build` — production build (MUST pass before PR)
## Rules
- Never modify migration files once committed
- All API responses use { data, error } shape
- No `any` types — use `unknown` + type narrowingKeep CLAUDE.md under 500 lines. Every line is loaded every session. Bloated CLAUDE.md = wasted context budget. Move verbose reference docs to a docs/ folder and @mention them only when needed.
Path-specific rules let you scope instructions to subdirectories:
# In CLAUDE.md
paths:
src/app/api/**:
- Always validate with zod before business logic
- Return 422 for validation errors, not 400
src/components/**:
- No inline styles — Tailwind only
- Accessibility: every interactive element needs aria-labelPermission Modes: Choose the Right One
Shift+Tab cycles through three modes:
Normal — asks before every file write and shell command. Good for exploratory sessions where you want full visibility.
Auto — executes reads freely, asks only for writes and destructive commands. The right default for most work.
Plan — no execution, pure planning. Claude maps out every step before touching anything. Use this when approaching a complex refactor you want to review first.
# Start directly in plan mode
claude --permission-mode plan
# Start in auto (bypassPermissions for CI/scripts)
claude --permission-mode bypassPermissions -p "run all tests and fix failures"Every Keyboard Shortcut That Matters
Most developers know Ctrl+C and Ctrl+D. The rest:
| Shortcut | Action |
|---|---|
Ctrl+L | Clear screen (keeps context) |
Ctrl+O | Toggle verbose — see Claude's thinking |
Ctrl+R | Reverse-search prompt history |
Ctrl+G | Open current prompt in $EDITOR |
Ctrl+B | Background the running task |
Ctrl+T | Toggle background task list |
Ctrl+V | Paste image directly into prompt |
Ctrl+F (×2) | Kill all background agents |
Esc+Esc | Rewind — undo the last action |
Shift+Tab | Cycle permission modes |
Alt+P | Switch model mid-session |
Alt+T | Toggle extended thinking |
\+Enter | Insert newline in prompt |
Ctrl+G (open in editor) is underrated — for complex multi-paragraph prompts, write them in vim/nano, save, and Claude receives the full thing cleanly.
Slash Commands: The Full List
# Context management
/clear # Clear conversation (fresh context, same session)
/compact [focus] # Compress context — optionally tell it what to preserve
/cost # Show token usage and cost for current session
/context # Visual grid of context usage
# Navigation
/resume # Pick up a previous session
/rename [name] # Name the current session
/branch [name] # Fork conversation (alias: /fork)
# Code review workflow
/diff # Interactive diff viewer for pending changes
/copy # Copy last response to clipboard
/export # Export full conversation
# Agent control
/plan [desc] # Enter plan mode, optionally describe the task
/loop [interval] # Schedule a recurring task (e.g. /loop 5m "run tests")
/agents # Manage running sub-agents
# MCP
/mcp # Interactive MCP server manager
/hooks # Manage lifecycle hooks
# Advanced
/btw <question> # Ask a side question without spending context
/effort [level] # Set reasoning effort: low / med / high
/voice # Push-to-talk (20 languages)
/pr-comments [PR] # Pull GitHub PR comments into context
/insights # Analyze session efficiency/btw is one of the most useful commands nobody uses. Ask clarifying questions, check facts, get explanations — all without burning context on your main task.
MCP Integration: Extending What Claude Can Reach
MCP (Model Context Protocol) turns Claude Code into an agent that can reach databases, APIs, browsers, and internal tools. Three config locations:
// .mcp.json (project-level, commit to VCS)
{
"mcpServers": {
"github": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": { "GITHUB_TOKEN": "${GITHUB_TOKEN}" }
},
"postgres": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-postgres"],
"env": { "DATABASE_URL": "${DATABASE_URL}" }
},
"browser": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-puppeteer"]
}
}
}Once wired, Claude can query your database schema, open PRs, or interact with web pages — all from a single prompt.
# List all connected MCP servers
claude mcp list
# Run Claude Code AS an MCP server (expose it to other tools)
claude mcp serveNever commit MCP configs with hardcoded credentials. Use ${ENV_VAR} interpolation as shown above, and add .mcp.json to .gitignore for any server with secrets. Use .mcp.json only for configs safe to share — put secrets in ~/.claude.json.
Worktrees: Parallel Agent Workflows
The biggest productivity unlock for complex projects: git worktrees let you run multiple Claude agents in parallel on different features without them stepping on each other.
# Claude Code creates an isolated branch + worktree automatically
claude --worktree feature-auth
# Or configure in CLAUDE.md for agent isolationIn CLAUDE.md:
agents:
isolation: worktree # each agent gets its own working tree
sparsePaths: # only check out what the agent needs
- src/auth/
- src/api/
- tests/auth/sparsePaths is the new killer feature for monorepos — an agent working on auth doesn't need to load the entire 200k-line frontend into its file tree.
The /batch command auto-creates worktrees for a list of tasks and runs them in parallel:
/batch
# Claude prompts for task list, spawns one worktree per task, runs concurrentlyContext Management at Scale
Context is the resource you're always trading against quality. The levers:
/compact [focus] — compress the full conversation into a dense summary. The optional focus hint tells Claude what to preserve: /compact keep the database schema decisions and the auth API contract.
/btw — side questions consume zero main context. Use it constantly.
@file mentions — only load files when needed. Don't stuff CLAUDE.md with file contents; @mention them in prompts when relevant.
Model selection — Alt+P mid-session. Long, exploratory research sessions on claude-haiku-4-5 (cheap, fast), then Alt+P to claude-opus-4-6 for the final implementation pass.
# 1M token context for large codebases (Opus 4.6 on Max/Team/Ent plans)
# Auto-compact kicks in at ~95% capacity — set focus before it triggers:
/compact preserve all type definitions and the API contract we designedNon-Interactive Mode: Scripting and CI
-p (print mode) makes Claude Code scriptable:
# query_claude_code.py
import subprocess, json, sys
def run_claude(prompt: str, cwd: str = ".") -> str:
result = subprocess.run(
["claude", "-p", prompt, "--output-format", "json"],
capture_output=True, text=True, cwd=cwd
)
if result.returncode != 0:
raise RuntimeError(result.stderr)
return json.loads(result.stdout)["result"]
# Use in CI: auto-generate changelogs
diff = subprocess.run(["git", "diff", "HEAD~1"], capture_output=True, text=True).stdout
changelog = run_claude(f"Write a user-facing changelog entry for this diff:\n{diff}")
print(changelog)# Pipe stdin
cat error.log | claude -p "Find the root cause and suggest a fix"
# Cost cap (never spend more than $2 on one task)
claude -p "refactor the auth module" --max-budget-usd 2
# Stream JSON output for integration
claude -p "list all TODO comments in src/" --output-format json | jq '.result'The Effort System: When to Think Harder
/effort controls how much reasoning Claude applies:
low— fast, cheap. Good for simple edits, lookup tasks, mechanical refactors.med— balanced default for most tasks.high— extended thinking engaged. Use for architecture decisions, complex debugging, security reviews.
In prompts, ultrathink triggers maximum reasoning for a single turn regardless of effort setting — useful for the one step that actually needs it without paying for it everywhere.
CLAUDE_CODE_EFFORT_LEVEL=low claude -p "rename all instances of UserModel to User"Five Workflows That Compound
1. The spec-first loop Write a failing test first, hand it to Claude in plan mode, review the plan, then let it execute. You catch design mistakes before they're in code.
2. PR review ingestion
/pr-comments 1234 pulls the full GitHub review into context. Claude then addresses every comment, explains tradeoffs, and opens a follow-up commit — all in one session.
3. The overnight batch
/batch a list of independent issues before you log off. Worktrees run in parallel, each agent commits to its own branch. You wake up to PRs.
4. Living documentation
/loop 1h "update docs/API.md to reflect any code changes in src/api/" runs every hour. Your docs stay current automatically.
5. The /btw debugging loop
When stuck on a bug: keep your main task open, use /btw "why would a Next.js middleware run twice on image requests?" for side research. Zero context cost, instant answer, back to the task.
Sources
- Claude Code official docs — Anthropic
- Claude Code cheat sheet — storyfox.cz (HN #10 today)
- HN discussion: Claude Code Cheat Sheet
- Model Context Protocol spec — Anthropic
- SWE-bench Verified leaderboard
- Git worktrees documentation
- Claude Code GitHub repository
- Anthropic usage policies and permission modes
- MCP server registry — GitHub
- Claude Code changelog — Anthropic
Was this article helpful?
Related Posts
How Flash-MoE Runs a 397B Parameter Model on a MacBook Pro at 4.4 tok/s
A developer ran Qwen3.5-397B—a model bigger than GPT-4—on a laptop with no Python and no frameworks. Here's exactly how.
Read moreGPT-5.4's Native Computer-Use API Is Live — and It Just Outperformed Humans on Desktop Automation
GPT-5.4 ships native computer-use today, hitting 75% on OSWorld — surpassing the 72.4% human baseline. Here's how to build agents with it.
Read moreHow to Give Claude Full Control of Your WordPress Site Using MCP
WordPress.com just shipped 19 write operations via MCP — your AI agent can now draft posts, fix SEO, and manage your entire site in plain English.
Read moreComments
No comments yet. Be the first to share your thoughts!