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.

Architect Chen
Architect Chen
Architect Chen
Claude Code Core Commands: Full 2026 Edition

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:.

claude

2. 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 persistence

3. claude -c – Continue the most recent session

Resumes the last conversation without re‑entering the context.

claude -c

4. claude --resume – Resume a specified session

Allows you to pick a historic session (e.g., yesterday’s analysis) and continue it directly.

claude --resume

5. claude --version – Show version

Displays the current CLI version, useful for compatibility checks.

claude --version
1.2.0

6. claude doctor – Diagnose environment

Checks Node version, network status, permission configuration, and Claude installation. claude doctor Sample output:

✓ Network OK
✓ Authentication OK
✓ CLI OK

7. /help – View help

Lists all supported commands; ideal for newcomers.

/help

8. /init – Initialize a project

Generates a CLAUDE.md file and automatically analyses the project structure (e.g., Java, SpringBoot, React) to produce documentation.

/init

9. /clear – Clear conversation context

Deletes the current dialogue to avoid long‑session pollution; useful when switching projects.

/clear

10. /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 standards

12. /config – View configuration

Lists model configuration, permission configuration, and tool configuration; useful for troubleshooting.

/config

13. /permissions – Manage permissions

Allows setting file write, Bash command execution, and network permissions. /permissions Sample entries:

AllowFileWrite
AllowBashCommand

14. /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 issues

15. /compact – Compress context

Keeps core content while deleting redundant dialogue, saving tokens and improving response speed for very long sessions.

/compact

16. /exit – Exit Claude Code

Terminates the current session; you can also press Ctrl+C.

/exit
Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

DebuggingCLIArtificial Intelligenceprompt engineeringVersion ControlCommand ReferenceClaude Code
Architect Chen
Written by

Architect Chen

Sharing over a decade of architecture experience from Baidu, Alibaba, and Tencent.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.