Claude CLI is the command-line version of Claude Code, Anthropic's AI coding agent: you open a terminal in a project, type claude, and describe what you want done in plain language. It reads your files, edits them and runs commands, asking for permission along the way.
This article follows Anthropic's documentation as of November 2026. "Claude CLI" is the name people search for. Anthropic's own name for the product is Claude Code, and the terminal program is what its overview page calls the Terminal CLI. If you want the general chatbot instead, see what Claude is.
What does Claude CLI actually do?
Anthropic describes Claude Code as an agentic coding tool that reads your codebase, edits files, runs commands and integrates with your development tools. "Agentic" means it does not only answer a question. It plans steps, uses tools (reading files, searching, running shell commands) and checks its own results. Examples from the documentation:
- Writing tests for untested code, running them and fixing failures.
- Tracing a bug from an error message to its root cause and fixing it.
- Working with git: staging changes, writing commit messages, creating branches and opening pull requests.
- Connecting to outside tools through the Model Context Protocol (MCP), such as ticket trackers or document stores.
For example, the docs show a one-line request:
claude "write tests for the auth module, run them, and fix any failures"
How is the CLI different from the VS Code extension and the desktop app?
It is not a different product. Anthropic says each surface connects to the same underlying Claude Code engine, so your project's CLAUDE.md files, settings and MCP servers work across all of them. The surfaces differ in how you use them:
| Surface | What it is | Start it with |
|---|---|---|
| Terminal CLI | The full-featured command-line program | claude |
| VS Code / Cursor | Extension with inline diffs and @-mentions | Extension ID anthropic.claude-code |
| JetBrains | Plugin for IntelliJ IDEA, PyCharm, WebStorm and others; needs the CLI installed separately | JetBrains Marketplace |
| Desktop app | Standalone app with visual diffs and parallel sessions; includes Claude Code, so no separate CLI install | Code tab |
| Web | Runs in the browser, no local setup | claude.ai/code |
The CLI is the one to pick if you work in a terminal, want to script it, or want to pipe other commands into it. The VS Code setup guide covers the editor route.
What do you need to use it?
- An account. A Pro, Max, Ultra, Team, Enterprise or Console account. The free claude.ai plan does not include Claude Code. Amazon Bedrock, Google Cloud's Agent Platform and Microsoft Foundry also work.
- A supported system. macOS 13.0+, Windows 10 1809+ or Windows Server 2019+, Ubuntu 20.04+, Debian 10+ or Alpine Linux 3.19+, with at least 4 GB of RAM and an internet connection.
- A shell. Bash, Zsh, PowerShell or CMD.
- Git for Windows (recommended on native Windows). Without it, Claude Code runs shell commands through PowerShell instead of Bash.
How to install Claude CLI
Anthropic recommends the native installer. Pick the command for your system.
macOS, Linux or WSL:
curl -fsSL https://claude.ai/install.sh | bash
Windows PowerShell:
irm https://claude.ai/install.ps1 | iex
Windows CMD:
curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd
The installer shows no progress while it downloads. When it finishes, open a new terminal and check the install:
claude --version
A working install prints a version number such as 2.1.211 (Claude Code) (example output; yours will differ). If you see The token '&&' is not a valid statement separator, you ran the CMD command in PowerShell. If you see 'irm' is not recognized as an internal or external command, you ran the PowerShell command in CMD.
Other routes exist: brew install --cask claude-code on macOS, winget install Anthropic.ClaudeCode on Windows, apt, dnf and apk repositories on Linux, and npm install -g @anthropic-ai/claude-code (Node.js 22 or later; never with sudo). Native installs update themselves in the background. Homebrew, WinGet and the Linux package managers do not, so you upgrade them yourself.
How to start your first session
cd your-project
claude
On first use Claude Code asks you to log in; follow the browser prompts. If the ANTHROPIC_API_KEY environment variable is set and you approve the key when asked, it skips the login. Then type a request. Start with something read-only, such as asking it to explain the project, before you let it change files.
If something looks wrong with the install or settings, claude doctor prints read-only diagnostics without starting a session.
Claude CLI commands you will use most
These come from the CLI reference:
| Command | What it does |
|---|---|
claude | Start an interactive session |
claude "query" | Start a session with an initial prompt |
claude -p "query" | Print the answer and exit (print mode) |
cat file | claude -p "query" | Process piped content |
claude -c | Continue the most recent conversation in this directory |
claude -r "<session>" "query" | Resume a session by ID or name |
claude update | Update to the latest version |
claude --model sonnet | Pick a model for this session using an alias such as sonnet, opus, haiku or fable, or a full model name |
claude --version | Print the version number |
Print mode is what makes the CLI scriptable. The documentation's examples include git diff main --name-only | claude -p "review these changed files for security issues". In print mode, --output-format accepts text, json and stream-json, and --max-turns caps the number of agentic turns.
Is it safe to let it run commands on your machine?
Claude Code works with the permissions of your user account, so treat it like a new colleague with access to your terminal. In the default mode it asks before file edits and most shell commands. Anthropic's VS Code documentation describes the other modes: plan (describe first, wait for approval), automatic edits, and an auto mode where a classifier reviews actions. Its docs say the bypass option belongs in sandboxes without internet access.
Practical habits that follow from this:
- Use it inside a git repository and commit before a large task, so you can see and revert every change.
- Read each permission prompt instead of approving by reflex.
- Keep secrets out of the project folder, or out of what it can read.
How do you customize it?
A CLAUDE.md file in the project root is read at the start of every session. Put coding standards, architecture decisions and preferred libraries there. If a repository already has an AGENTS.md for other tools, Claude Code can read that in its place. Hooks run shell commands before or after its actions (for example, formatting after each edit), and skills package repeatable workflows. Settings live in settings.json; the /config command opens the interactive options.
If the claude command is not found
Open a new terminal window first, because the installer changes your PATH and existing windows do not see it. If the shell still says claude is not found or not recognized, the install directory is not on your PATH. Anthropic's installation troubleshooting page has a "command not found: claude after installation" section that covers the fix for each shell. On macOS and Linux the native installer places the launcher at ~/.local/bin/claude, so check that folder is on your PATH.
Frequently asked questions
- Is Claude CLI the same as Claude Code?
- Mostly yes. People say "Claude CLI" for the command-line version of Claude Code, the program you start by typing claude in a terminal. Anthropic's documentation calls the product Claude Code and calls the terminal version the Terminal CLI. The same engine also runs in VS Code, JetBrains, the desktop app and the web.
- Is Claude CLI free?
- The program is free to install, but using it is not free. Anthropic's setup page says Claude Code requires a Pro, Max, Ultra, Team, Enterprise or Console account, and that the free claude.ai plan does not include access. You can also connect it to Amazon Bedrock, Google Cloud's Agent Platform or Microsoft Foundry.
- Does Claude CLI change my files without asking?
- By default it asks before edits and most shell commands, and you can approve or reject each one. Permission modes change how much it asks. Run it in a project under version control, so you can review the changes and undo them.
- How do I run Claude CLI without the interactive screen?
- Use print mode: claude -p "your question". It prints the answer and exits, which suits scripts and CI. You can pipe input into it, for example cat logs.txt | claude -p "explain", and choose the output format with --output-format text, json or stream-json.