1. Claude Code CLI
1. Claude Code CLI
Official docs: https://code.claude.com/docs
The full-featured CLI for working with Claude Code directly in your terminal. Edit files, run commands, and manage your entire project from the command line.
Installation
Windows PowerShell (recommended for Windows)
irm https://claude.ai/install.ps1 | iex
Windows CMD
curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd
Windows requires Git for Windows. Install it first if you don't have it.
macOS / Linux / WSL
curl -fsSL https://claude.ai/install.sh | bash
Homebrew (macOS/Linux)
brew install claude-code
How to Use Claude Code
There are two ways to run Claude Code:
| Method | Description |
|---|---|
| CLI (Terminal) | Run claude in your terminal. This is the pro approach -- full control, all features. |
| VS Code / Cursor Extension | Install the Claude Code extension from the marketplace. More packaged, easier to start with. |
The CLI is the power-user tool. The extension is a convenience wrapper around it.
Getting Started
cd your-project
claude
- Type
/to see all available commands /init-- Analyzes your codebase and creates aCLAUDE.mdfile/context-- Shows how much context window Claude has used- You can also just type instructions and press Enter
- Once the context window is starting to apporach the autocompact section, do a "/compact" yourself. this will free up space. When you compact you loose some specific information
- Type "/status" to see Claude information and more stuff like config, and usage.
Tips:
- Claude will prompt you to press
1(yes),2(yes to all), or3(no) for changes - It's not recommended to let Claude write its own
CLAUDE.mdfrom scratch -- let it generate a draft, then review and refine it yourself
Built-in Commands
Full reference: https://code.claude.com/docs/en/interactive-mode#built-in-commands
Session Management
| Command | Purpose |
|---|---|
/clear |
Clear conversation history and free up context. Aliases: /reset, /new |
/compact [instructions] |
Compact conversation with optional focus instructions |
/context |
Visualize current context usage as a colored grid |
/copy |
Copy last response to clipboard. Shows picker for code blocks |
/export [filename] |
Export conversation as plain text |
/fork [name] |
Create a fork of the current conversation at this point |
/rename [name] |
Rename the current session. Auto-generates if no name given |
/resume [session] |
Resume a conversation by ID or name. Alias: /continue |
/rewind |
Rewind conversation and/or code to a previous point. Alias: /checkpoint |
Project & Config
| Command | Purpose |
|---|---|
/init |
Initialize project with CLAUDE.md guide |
/config |
Open Settings interface. Alias: /settings |
/add-dir <path> |
Add a new working directory to the current session |
/memory |
Edit CLAUDE.md memory files, enable/disable auto-memory |
/permissions |
View or update permissions. Alias: /allowed-tools |
/hooks |
Manage hook configurations for tool events |
/keybindings |
Open or create your keybindings configuration file |
/skills |
List available skills |
/plugin |
Manage Claude Code plugins |
/reload-plugins |
Reload all active plugins to apply pending changes |
Model & Usage
| Command | Purpose |
|---|---|
/model [model] |
Select or change the AI model. Use arrows to adjust effort level |
/fast [on|off] |
Toggle fast mode on or off |
/cost |
Show token usage statistics |
/usage |
Show plan usage limits and rate limit status |
/extra-usage |
Configure extra usage when rate limits are hit |
/output-style [style] |
Switch between Standard, Explanatory, or Learning output styles |
Code Review & Git
| Command | Purpose |
|---|---|
/diff |
Interactive diff viewer for uncommitted changes and per-turn diffs |
/review |
Review a PR for quality, correctness, security, and test coverage. Requires gh CLI |
/pr-comments [PR] |
Fetch and display comments from a GitHub PR. Requires gh CLI |
/security-review |
Analyze pending changes for security vulnerabilities |
/plan |
Enter plan mode directly from the prompt |
Integrations
| Command | Purpose |
|---|---|
/agents |
Manage agent configurations |
/mcp |
Manage MCP server connections and OAuth authentication |
/ide |
Manage IDE integrations and show status |
/chrome |
Configure Claude in Chrome settings |
/desktop |
Continue session in Claude Code Desktop app. Alias: /app |
/remote-control |
Make session available for remote control from claude.ai. Alias: /rc |
/remote-env |
Configure the default remote environment for teleport sessions |
/install-github-app |
Set up Claude GitHub Actions app for a repository |
/install-slack-app |
Install the Claude Slack app via OAuth flow |
Account & Misc
| Command | Purpose |
|---|---|
/login |
Sign in to your Anthropic account |
/logout |
Sign out from your Anthropic account |
/doctor |
Diagnose and verify your Claude Code installation |
/status |
Show version, model, account, and connectivity |
/stats |
Visualize daily usage, session history, streaks, and model preferences |
/insights |
Generate a report analyzing your Claude Code sessions |
/feedback [report] |
Submit feedback about Claude Code. Alias: /bug |
/privacy-settings |
View and update privacy settings (Pro and Max only) |
/release-notes |
View the full changelog |
/upgrade |
Open the upgrade page to switch to a higher plan |
/sandbox |
Toggle sandbox mode (supported platforms only) |
/terminal-setup |
Configure terminal keybindings (Shift+Enter, etc.) |
/theme |
Change color theme (light, dark, colorblind-accessible, ANSI) |
/vim |
Toggle between Vim and Normal editing modes |
/stickers |
Order Claude Code stickers |
/mobile |
Show QR code for Claude mobile app. Aliases: /ios, /android |
/passes |
Share a free week of Claude Code with friends |
/exit |
Exit the CLI. Alias: /quit |
/help |
Show help and available commands |