Claude Code CLI: How to Start and When to Use Desktop or VS Code

Install Claude Code in your shell, approve your first edit, and choose between the terminal, the desktop Code tab and the VS Code extension.

Published

Claude Code CLI: How to Start and When to Use Desktop or VS Code

Use the Claude Code CLI when you want to send a file into Claude from the terminal and get an answer back in a script. Of the 3 ways to work here, the VS Code extension is the easiest place to review an edit beside your source, and the desktop Code tab is the easiest place to watch several tasks at once.

What is Claude Code CLI?

Claude Code is Anthropic’s coding agent. Its command-line interface (CLI) lets you open a conversation in a project folder by typing claude. Ask where the app starts and it can read across files to find the answer. Ask it to change how the app starts and it can edit those files and run commands. Think of the project folder as the folder you hand a colleague with your question. Choose it before you ask.

Anthropic’s Claude Code overview with its terminal setup instructions
Claude Code

Access. The CLI accepts Pro ($20 billed monthly), Max, Ultra, Team or Enterprise, a Claude Console account with prepaid API credits, or access through a supported organizational provider. Anthropic’s pricing · Claude Code plans explained

The commands and interface differences below were checked against Anthropic’s public documentation on December 1, 2026. If you're still deciding whether to give a coding agent access to a project, the Claude Code review covers that broader decision.

How to install Claude Code CLI in your shell

Anthropic recommends its native installer. On a Mac or Linux machine, open a terminal. On Windows, look at the prompt first. A prompt starting with PS means PowerShell. A drive path such as C:\Users\Sam> without that prefix usually means Command Prompt (CMD). If you deliberately opened a Linux distribution through Windows Subsystem for Linux (WSL), use the Linux command inside it. Anthropic’s installation quickstart

Three stone tiers show which native installer to run in macOS, Linux or WSL, Windows PowerShell, and Windows CMD
Pick the line for the shell in front of you. Copy the corresponding command below.

macOS, Linux or WSL

Bash
curl -fsSL https://claude.ai/install.sh | bash

Windows PowerShell

Powershell
irm https://claude.ai/install.ps1 | iex

Windows Command Prompt

Cmd
curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd

When the installer finishes, open a new terminal window and run claude --version. A version number confirms the shell can find Claude Code. If Windows says it cannot recognize irm, check whether you pasted the PowerShell line into CMD. If the installer finished but the new terminal cannot find claude, check PATH, the list of folders your shell searches for programs.

How to update Claude Code CLI

The native installation updates in the background. Restart Claude Code to pick up a downloaded update, or run claude update to request one. If you installed the stable Homebrew cask instead, use brew upgrade claude-code. For a WinGet installation, use winget upgrade Anthropic.ClaudeCode. Anthropic’s setup and update guide

How to use Claude Code CLI for a first edit

Start with a change you can judge by reading it. A sentence in the README is a good choice, especially in a project you’ve just inherited.

  1. Open the project and sign in

    Open a terminal in the folder containing the project’s README. Type claude and press Enter. On first use with a Claude subscription or Console account, follow the browser sign-in, then return to the terminal. Check the working directory above the prompt before asking about the code.

  2. Find the entry point

    Ask where is the main entry point?, an example from Anthropic’s quickstart. Claude can inspect the project files. Follow up by asking which file a new contributor should read first and why. Open that file to see whether the explanation fits.

  3. Review a small change

    Ask, “Add one sentence to the README telling a new contributor where the app starts. Leave the source files alone.” When a permission request appears, read the filename and proposed sentence. Choose Yes if both match your request. Decline if Claude proposes editing the application itself, then clarify the task. Whether Claude pauses for approval depends on the session’s permission mode.

  4. Find help and finish

    Type /help inside the conversation to see the available commands. Use /exit to return to your ordinary shell prompt.

A stagehand controls a gate between a proposed edit and a file change, with separate approval and decline paths
When Claude asks for approval, check the target file as well as the change.

For a longer walkthrough after this edit, follow the project guide to using Claude Code.

Claude Code CLI commands worth remembering

At the shell prompt, decide whether you want a conversation, a single answer, or an earlier conversation back. A flag is an option you add after the program name. These examples come from the CLI command and flag reference.

At the shellWhen to use it
claudeStart an interactive session and ask follow-up questions.
claude "Explain this project"Open an interactive session with the first question already supplied.
claude -p "Summarize the README"Print one answer and exit. Useful when another command needs the result.
claude -cContinue the most recent conversation in this directory.
claude -rPick an earlier conversation when the most recent one belongs to another task.

For a repeatable README check, the following shell pipeline passes the file’s contents into Claude. The vertical bar is a pipe. It takes the output of the command on its left and supplies it to the command on its right.

Bash
cat README.md | claude -p "Which setup instructions would a new contributor need clarified?"

Run it from the folder containing README.md. Use the interactive version when you want to debate a suggested revision. If you find yourself repeating the same review instructions, Claude Code skills let you package them for reuse. To attach a check to a particular event, see the guide to Claude Code hooks.

Terminal, desktop Code tab or VS Code extension?

Choose by where you need the result. A script needs text it can consume. A reviewer needs the old and new lines together. Someone overseeing several tasks needs to see which session needs attention. Anthropic documents the differences in its desktop feature reference and VS Code extension guide.

DecisionTerminal CLIDesktop Code tabVisual Studio Code (VS Code) extension
Where to startRun claude in the project folder.Open Code in the sidebar, choose the local environment and select a folder.Search for Claude Code in the editor’s Extensions view, install it and open its panel.
What it addsPipe input, print an answer, and use the full set of interactive commands and skills.Manage parallel sessions in one window. Arrange the conversation, change review and app preview side by side.Reference selected code and review a proposed edit beside the original. In Manual mode you can edit the proposal before accepting.
Where you hit a limitFor the editor’s native side-by-side diff viewer, connect the CLI to the extension.The Code tab is interactive only. It has no equivalent to the CLI’s print flag for scripts. The standard desktop sign-in requires a paid subscription.The panel exposes a subset of commands and skills. Its bundled CLI is private to the extension.

For a founder reviewing a page change, Desktop lets you keep the app preview beside the proposed edit. For a developer already reading a function in VS Code, selecting the relevant lines is a shorter path to a precise question. Neither graphical interface requires a separate terminal installation to get started. Desktop setup instructions

What do you miss in the VS Code extension?

In the extension, type / to see which commands and skills the panel offers. The terminal also has a ! shortcut for running a Bash command inside the conversation. The panel lacks that shortcut, but both interfaces support checkpoints and configuring MCP servers, which connect Claude to external tools.

Stay in the extension until you need one of those terminal features. Then install the standalone CLI and open the integrated terminal inside VS Code. Run claude --resume and pick the conversation you started in the panel. The two share conversation history, so you can keep the earlier explanation of the code and the edit you discussed.

Does the desktop app use more of your allowance than the CLI?

Anthropic publishes no fixed Desktop-to-CLI usage ratio in its desktop or cost documentation. Desktop uses the same underlying engine. That alone cannot tell you what two sessions will consume. The model, the size of the codebase and the number of sessions doing work all matter. A suggested next prompt can also trigger a small background request, a behavior Anthropic documents for Claude Code generally.

If you had several tasks running in Desktop and one in the terminal, count the active tasks before drawing a conclusion about the interface. Subscribers can use /usage to see plan usage bars. The session’s estimated API cost is a different figure from the amount billed for a subscription. Anthropic’s usage guide · Claude usage limits by plan

Common terminal questions

Is there a CLI for the Claude code?

Yes. The executable is named claude. Run it in your project folder to start a conversation.

Can I run claude locally?

The CLI runs on your machine and can work on local files. It sends requests over the network to the language model. If the project requires fully offline inference, this setup does not meet that requirement. Anthropic’s data-flow documentation

How to use CLI in cmd?

Run the Windows Command Prompt installer above, open a fresh CMD window in the project directory and type claude.

What is CLI vs CMD?

A CLI is any interface you operate by typing commands. CMD is the Windows command interpreter where you can launch programs such as Claude Code.

Is CLI faster than GUI?

For repeated tasks, a saved shell command can save you clicks. Anthropic’s interface guides give no general speed advantage for generating an answer.

Why is CLI still used?

A script can pass input to Claude and collect the answer without someone opening a chat or copying text by hand.

Which is better, CLI or IDE?

Use the CLI when the result feeds another command. Choose an integrated development environment (IDE) such as VS Code when you need the answer next to the file you’re editing. You can run the CLI inside that editor too.

Why do people prefer CLI over GUI?

A practical reason is repeatability. You can save the README check above and run the same question after the next documentation change.

Is CLI just the terminal?

The terminal is the application where you type. Claude Code’s CLI is one program you can start there. After you exit Claude, the terminal stays open.

If you want to keep Claude beside your files, compare the best IDEs for Claude Code.

Published
Category
Build
Related Articles
Cursor to Grok Build: What Changes for Your Team

Cursor to Grok Build: What Changes for Your Team

Keep your editor, sessions and third-party models. See what the Agents Window beta adds and which Cursor mentions to change on December 7.Nov 30, 2026Build
Claude Ultracode

Claude Ultracode

Use Claude Code’s ultracode setting for one task, one session or every launch. See which jobs justify parallel agents and how to watch your plan usage.Nov 30, 2026Build
Gemini Enterprise Agent Platform: What It Is, What It Costs, and How to Start

Gemini Enterprise Agent Platform: What It Is, What It Costs, and How to Start

Find the new names for Vertex AI services, see how the platform differs from employee-facing Gemini Enterprise, and follow Google’s first agent quickstart.Nov 30, 2026Build
LLM Council: What It Is, What It Costs, and How to Run It

LLM Council: What It Is, What It Costs, and How to Run It

Follow one question through Andrej Karpathy’s LLM Council, run the original app locally, and see when a second model opinion is worth reading.Nov 30, 2026Build
Readdy AI: What It Is, What It Costs, and How to Start

Readdy AI: What It Is, What It Costs, and How to Start

See what Readdy builds from a prompt, screenshot, template, or link, what you can take to another host, and how to publish your first business site.Nov 30, 2026Build
Google Account Banned? Antigravity Reports and What to Do

Google Account Banned? Antigravity Reports and What to Do

What Google says about the restored account, which Antigravity connections it supports, and how to protect your Gmail and Drive or appeal a lockout.Nov 29, 2026Build
Claude refusals and fallback: How to handle an HTTP 200 decline

Claude refusals and fallback: How to handle an HTTP 200 decline

Read Claude’s refusal JSON, choose a fallback, and track which model answered and what you owe, even when the stream changes models mid-response.Nov 29, 2026Build
Claude Code in Action: Lessons, Enrollment and the Course Badge

Claude Code in Action: Lessons, Enrollment and the Course Badge

Find Anthropic’s nine lessons, see how to earn the Claude Academy badge, and save your old Skilljar certificate before the site closes.Nov 29, 2026Build
Newsletter

One letter, every Sunday.Working systems, not hot takes.

Weekly. No spam. Unsubscribe anytime.