Claude Code Core Commands: Full 2026 Edition
This article provides a complete, step‑by‑step reference of Claude Code’s CLI commands—including interactive mode, single‑run queries, session continuation, version checking, environment diagnosis, project initialization, context management, configuration viewing, permission handling, code review, context compression, and exit procedures—each illustrated with concrete examples and expected outputs.
Claude Code is a leading AI large model, and this guide lists and explains all of its core command‑line interface (CLI) commands as of the 2026 version.
1. claude – Start interactive mode
Enter the interactive chat where you type prompts prefixed with You: and receive responses prefixed with Claude:.
claude2. claude -p – Single‑execution mode
Suitable for quick questions without entering the interactive console.
claude -p "Explain Redis persistence principles"Typical output:
RDB
AOF
Mixed persistence3. claude -c – Continue the most recent session
Resumes the last conversation without re‑entering the context.
claude -c4. claude --resume – Resume a specified session
Allows you to pick a historic session (e.g., yesterday’s analysis) and continue it directly.
claude --resume5. claude --version – Show version
Displays the current CLI version, useful for compatibility checks.
claude --version
1.2.06. claude doctor – Diagnose environment
Checks Node version, network status, permission configuration, and Claude installation. claude doctor Sample output:
✓ Network OK
✓ Authentication OK
✓ CLI OK7. /help – View help
Lists all supported commands; ideal for newcomers.
/help8. /init – Initialize a project
Generates a CLAUDE.md file and automatically analyses the project structure (e.g., Java, SpringBoot, React) to produce documentation.
/init9. /clear – Clear conversation context
Deletes the current dialogue to avoid long‑session pollution; useful when switching projects.
/clear10. /status – Show current status
Displays the active model, token usage, context length, and project directory. /status Example:
Model: Claude Sonnet
Context: 45%11. /memory – View memory content
Shows stored project rules, coding standards, and historical preferences. /memory Example entries:
Java uses Lombok
Unified logging standards12. /config – View configuration
Lists model configuration, permission configuration, and tool configuration; useful for troubleshooting.
/config13. /permissions – Manage permissions
Allows setting file write, Bash command execution, and network permissions. /permissions Sample entries:
AllowFileWrite
AllowBashCommand14. /review – Code review
Claude scans the specified source file for bugs, security vulnerabilities, performance issues, and coding‑style problems. /review UserService.java Typical output:
Found 3 potential issues15. /compact – Compress context
Keeps core content while deleting redundant dialogue, saving tokens and improving response speed for very long sessions.
/compact16. /exit – Exit Claude Code
Terminates the current session; you can also press Ctrl+C.
/exitSigned-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Architect Chen
Sharing over a decade of architecture experience from Baidu, Alibaba, and Tencent.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
