🛠️

Claude Code Commands Overview

Jun 21, 2025

Overview

This lecture provides an overview of all major commands in Claude Code, explaining their purpose, usage, and best practices for efficient workflow.

Reporting & Troubleshooting Commands

  • Use /bug to report bugs directly to the development team.
  • /doctor checks if your Claude Code installation has proper permissions and setup.
  • /help lists all available commands with brief descriptions.

Managing Context and Token Usage

  • /clear wipes the conversation history to start a new chat, reducing token usage.
  • /compact summarizes the current chat and starts a new conversation with the summary as context; supports custom instructions.
  • Claude Code auto-compacts when at 95% token capacity.

Configuration and Preferences

  • /config lets you adjust settings like autocompact, to-do usage, verbose output, theme, notifications, editor mode (normal/vim), and model selection.
  • Autocompact is recommended to stay enabled for token management.
  • To-do lists keep tasks focused and organized within the tool.
  • Verbose output shows Claude Code's internal reasoning; toggle with Ctrl+R when needed.

Project Initialization and Memory

  • /init scans your codebase and creates claw.md, summarizing project structure and key components.
  • The claw.md file acts as persistent "memory" used at the start of new chats.
  • Manual edits to claw.md are allowed for evolving projects.

Login & Session Management

  • /login lets you sign in via subscription or API plan.
  • /logout logs you out and provides a session summary with costs and models used.
  • /cost tracks API usage costs (not relevant for max/pro plan users).

Models and Permissions

  • /model selects the Claude model for requests; supports switching between Opus 4, Sonnet 4, and others.
  • /permissions manages which commands Claude Code can auto-run (bash, edit/read files, web fetch, MCP tools).
  • Be cautious with permissions to avoid unintended file edits or security risks.

Memory Features & Best Practices

  • Supports project memory (per-project claw.md) and user memory (preferences across all projects).
  • Add custom files or instructions into memory using @filename or the hash # shortcut in chat.
  • Organize memory entries in logical groups; be specific and avoid excess entries to keep context clear.

External Integrations

  • /mcp connects to external Model Context Protocol servers, allowing Claude Code to interact with external systems (e.g., databases).

GitHub Integration & Status

  • /pr_comments fetches pull request comments from GitHub within Claude Code.
  • /review triggers a PR review process inside Claude Code.
  • /status displays the current working directory, account, active memories, and model.

Editor and Terminal Shortcuts

  • /terminal_setup enables Option+Enter for new lines.
  • /vim puts the editor in Vim mode for Vim key bindings.

Key Terms & Definitions

  • Stateless — The AI model does not retain memory between sessions or chats.
  • Token — A unit of text used to measure model usage and compute cost.
  • claw.md — A file summarizing project context, used as persistent memory by Claude Code.
  • Memory — Stored context (either per-project or user-wide preferences) for Claude Code.
  • To-do list — An internal checklist of steps Claude Code creates to keep tasks focused.
  • MCP (Model Context Protocol) — A protocol for integrating Claude with external tools and systems.

Action Items / Next Steps

  • Run /init when starting with a new project to generate project memory.
  • Adjust /config for your preferred workflow and enable autocompact.
  • Regularly clear or compact chats to manage token usage.
  • Begin adding relevant coding standards and preferences to memory as your workflow evolves.
  • Review documented commands with /help as needed.