Skip to content

Reference

Quick reference for commands, troubleshooting, and official documentation links.


Commands Cheatsheet

Session Management

Command Purpose
/clear Reset context window completely
/compact Summarize and compress context
/context Show current token usage
/memory View and edit persistent memory
/init Bootstrap CLAUDE.md from repo
Ctrl+O Toggle verbose output
Shortcut Purpose
Ctrl+C or Escape Cancel current generation
Escape × 2 Rewind conversation to a previous point

Thinking & Effort

Action How
Set effort level /effort command or CLAUDE_CODE_EFFORT_LEVEL env var (low/medium/high/max/auto)
Toggle thinking Option+T (macOS) / Alt+T (Linux/Windows)
Max thinking budget MAX_THINKING_TOKENS env var
Always-on thinking alwaysThinkingEnabled setting

Tools & Extensions

Command Purpose
/mcp Check MCP server status
/skills List available skills
/hooks Manage hooks (interactive UI)
/agents Manage agents interactively
/plugin Plugin manager
/plugin list List installed plugins
/plugin install <name> Install a plugin
/plugin marketplace add <source> Add a marketplace

GitHub Integration

Command Purpose
/install-github-app Install the Claude GitHub App for CI integration
gh issue view <id> View issue details
gh pr create Create pull request

CLI Management

# Add MCP server (user scope)
claude mcp add <name> -s user --transport http <url>

# Add MCP server (project scope)
claude mcp add <name> -- <command> <args>

# List MCP servers
claude mcp list

Troubleshooting

Context Issues

Claude ignores CLAUDE.md rules Context rot — rules from session start are forgotten. Use /compact to refresh, add CRITICAL markers to essential rules, or /clear and restart.

Claude produces inconsistent code Too much context from previous tasks. Use /clear to start fresh.

Claude forgets earlier decisions Decision fell out of active context in a long session. Use /compact, repeat important constraints, or use the task system to track decisions.

MCP Issues

Server won't connect

  1. Package installs correctly: npx -y <package>
  2. Environment variables are set: echo $VAR
  3. Network accessible for HTTP servers
  4. Check /mcp for status and errors

Server times out Check if the process is hanging. Try restarting Claude Code.

Hook Issues

Hook doesn't run Check matcher pattern ("Edit|Write"), JSON syntax in settings, and script permissions (chmod +x).

Hook blocks everything Script exits with code 2 unintentionally. Add || exit 0 to non-critical checks.

Hook is too slow Lint only the changed file, not the entire project. Move expensive checks to Stop event.

Skill Issues

Skill doesn't activate Check description trigger phrases, YAML frontmatter syntax, /skills list, and try explicit /skill-name.

Instructions are ignored Make instructions specific with numbered steps, concrete examples, and IMPORTANT markers.

Code Quality Issues

Inconsistent patterns — Always explore existing code before implementing. Reference specific files.

Over-engineering — Prompt: "Use the simplest approach following our existing patterns."

Hallucinated APIs — Review imports carefully. Use LSP plugins for type checking. Run tests after every change.

Deleted tests — Add to CLAUDE.md: "NEVER delete existing tests."

Performance Issues

Claude is slow — Context nearly full (use /compact), slow MCP servers, or large files being read repeatedly.

Tests take too long — Run specific files (pytest tests/auth/ -x), full suite only at the end.


Official Documentation

Topic URL
Getting Started code.claude.com/docs/en/getting-started
CLAUDE.md & Memory code.claude.com/docs/en/memory
MCP Servers code.claude.com/docs/en/mcp
Permissions code.claude.com/docs/en/permissions
Settings & Hooks code.claude.com/docs/en/settings
Skills code.claude.com/docs/en/skills
Sub-agents code.claude.com/docs/en/sub-agents
Agent Teams code.claude.com/docs/en/agent-teams
Best Practices code.claude.com/docs/en/best-practices