The essential reference for Claude Code power users. Commands, shortcuts, CLAUDE.md patterns, and advanced techniques.
/help- Show all available commands/clear- Clear conversation context/compact- Summarize and compress context/cost- Show session token usage and cost/quit- Exit Claude Code/init- Initialize CLAUDE.md in project/memory- View/manage persistent memory/context- Show current context window/add-dir <path>- Add directory to context/review- Review changes before commit/think- Enable extended thinking/ultrathink- Maximum reasoning depth/thinkhard- Deep analysis mode/resume- Resume previous session/history- Show command history/undo- Undo last file change/diff- Show uncommitted changes# Project Overview This is a Next.js 14 app with App Router. Stack: TypeScript, Tailwind CSS, Prisma, PostgreSQL # Key Directories - /src/app - Page routes - /src/components - React components - /src/lib - Utilities and helpers - /prisma - Database schema
# Coding Standards - Use 'use client' only when needed - Prefer server components by default - Use Zod for validation - Error handling: try/catch with proper logging - Tests: Vitest for unit, Playwright for e2e
# Do NOT - Do not add comments to unchanged code - Do not refactor code not related to the task - Do not add features beyond what's requested - Do not use console.log for production code - Do not commit without running tests
# Workflow 1. Read the file before editing 2. Make minimal changes to achieve the goal 3. Run tests after changes: npm test 4. Format with: npm run format 5. If tests fail, fix before continuing
Work autonomously until complete. After each step, verify the result. If something fails, debug and retry. Only stop when fully working.
Search for [X] in parallel: 1. Check files matching *.ts 2. Search for "keyword" in /src 3. Look at recent git commits Report all findings together.
Analyze this code and respond with: ## Issues Found ## Suggested Fixes ## Code Changes ## Verification Steps
Before we continue, summarize: 1. What we've accomplished 2. Current blockers 3. Next steps planned Save this to CLAUDE.md under ## Session Notes
{
"mcpServers": {
"memory": {
"command": "npx",
"args": ["@whenmoon-afk/memory-mcp"]
},
"filesystem": {
"command": "npx",
"args": ["@modelcontextprotocol/server-filesystem", "/path/to/allowed"]
},
"github": {
"command": "npx",
"args": ["@modelcontextprotocol/server-github"],
"env": {
"GITHUB_TOKEN": "your-token-here"
}
}
}
}"Fix the bug" โ "Fix the null pointer in handleSubmit at line 42 of UserForm.tsx"
Start prompts with file paths: "In src/lib/auth.ts, update the token validation..."
Don't try to do everything at once. Small, focused changes are more reliable.
Always ask Claude to run tests after making changes. Catch issues immediately.
Invest 10 minutes in a good CLAUDE.md. It saves hours of re-explaining context.
Use /ultrathink for complex architecture decisions. Normal mode for simple tasks.
Tell Claude what NOT to do. "Do not modify files outside /src/components"
Before /clear, ask Claude to summarize the session to CLAUDE.md.
Join the newsletter for weekly tips, new tool announcements, and advanced techniques.
Want to dive deeper?
Explore Documentation