What are the CLI and slash commands available in Claude Code?

Question

Answers ( 1 )

    0
    2025-03-26T17:48:45+00:00

    Claude Code provides various CLI and slash commands:
    - CLI Commands:
    - `claude`: Starts an interactive REPL.
    - `claude "query"`: Starts REPL with an initial prompt.
    - `claude -p "query"`: Executes a one-time query and exits.
    - `cat file | claude -p "query"`: Processes piped content.
    - `claude config`: Manages configuration settings.
    - `claude update`: Updates to the latest version.
    - Slash Commands:
    - `/bug`: Reports a bug.
    - `/clear`: Clears conversation history.
    - `/compact`: Compresses the conversation.
    - `/config`: Views or modifies configuration.
    - `/cost`: Displays token usage.
    - `/doctor`: Checks installation health.
    - `/help`: Provides usage help.
    - `/init`: Initializes a project with a CLAUDE.md guide.
    - `/login`: Switches Anthropic accounts.
    - `/logout`: Logs out.
    - `/pr_comments`: Views pull request comments.
    - `/review`: Requests code reviews.
    - `/terminal-setup`: Installs Shift+Enter keybindings (iTerm2, VSCode).
    - `/vim`: Enters vim mode.

Leave an answer