Draft:How to install claude code

How to install Claude Code is a step‑by‑step guide for installing and running Claude Code, Anthropic's AI coding assistant, on common desktop operating systems. The guide is aimed at beginners who may not have prior experience with terminals or programming.

What is Claude Code?

Claude Code is an AI coding assistant developed by Anthropic that runs primarily as a command‑line interface (CLI) and integrates with popular editors such as Visual Studio Code.[1][2] Instead of interacting through a web interface, users type natural‑language instructions into a terminal or editor panel, and Claude Code reads local files, suggests edits, and automates development tasks.[1][2] Typical capabilities include explaining files, generating new code, refactoring existing code, adding tests and documentation, and running commands such as build scripts or test suites.[1][2]

Users can access Claude Code through:

  • A terminal on macOS, Linux, or Windows.[3][1]
  • Supported editor integrations, such as the official Visual Studio Code extension, which connect to the Claude Code CLI.[1][4]

Before you start

Claude Code is designed for developers, but non‑technical users can also install it by following a small set of prerequisites.

Basic requirements

Before installing Claude Code, a user should:

  • Have a computer where they can install software with sufficient permissions.
  • Be able to open a terminal or command prompt.
  • Have a Claude or Anthropic account with access to Claude Code where required by the chosen integration or plan.[3][1]

Finding the terminal or command prompt

On most systems, Claude Code is installed and run from a terminal window or command prompt:

  • macOS: Users can open Terminal via Spotlight search (Command–Space, then type “Terminal”).
  • Windows: Users can use PowerShell, Command Prompt (CMD), or Windows Terminal; PowerShell is often recommended for beginners.[3][5]
  • Linux: Most desktop environments provide a Terminal application in the system menu.

Users generally only need to be able to paste commands into this window and press Enter.

Optional: checking Node.js and npm

Claude Code can be installed via a native installer or via the Node.js package manager npm.[3][5] Users who intend to use the npm‑based method can verify that Node.js and npm are present by running:

node --version
npm --version

If these commands return version numbers, Node.js and npm are already installed.[2] If they return “command not found” or similar errors, users can either install Node.js from the official website or choose a native installer method that does not require npm.[3][5]

Installation methods

The official Claude Code documentation describes several supported installation paths, which may vary slightly by operating system and over time.[3][1][5] Common options include:

  • A native “one‑command” installer (recommended for most users).[3][1][5]
  • Package managers such as Homebrew (macOS) or WinGet (Windows).[1][5]
  • Global installation via npm for users who already use Node.js and npm.[3][2][5]
  • Desktop applications that bundle a graphical interface and Claude Code functionality.[1][6]

Because specific commands and options may change, users are generally advised to follow the latest instructions in the official Quickstart and advanced setup pages.[3][5]

Step‑by‑step installation

The following steps summarise the typical beginner‑friendly process; users should cross‑check the exact commands with the official Quickstart documentation.[3]

Opening the official Quickstart page

Anthropic maintains a Quickstart guide for Claude Code that outlines platform‑specific installation commands and first‑use instructions.[3] Users are usually directed to open the Quickstart page in a web browser and keep it available while running commands in a terminal.

Choosing the platform

The Quickstart page groups instructions by environment, for example:

  • macOS
  • Linux
  • Windows
  • Windows Subsystem for Linux (WSL)[3][5]

Users select the section corresponding to their system and follow the recommended “native install” or “one‑command install” for that platform.[3][1] On Unix‑like systems, these commands often involve a single curl pipeline to a shell script; the exact URL and command are provided in the official documentation.[3][5]

Running the installation command

To run the installer, a typical workflow is:

  1. Copy the install command from the Quickstart page.
  2. Paste it into the terminal window.
  3. Press Enter and wait for the command to complete.[3]

During installation, users may see prompts requesting confirmation, password entry (on macOS or Linux) so the installer can write files to protected locations, and download progress messages.[3][5] Once installation succeeds, the script usually prints a short success message.[3]

Afterward, users can confirm that Claude Code is available by running:

claude --version

If the installation worked, the command should print a version number.[3][5] If the shell returns “command not found” or that claude is not recognised, opening a new terminal session and re‑running the version command is a common first troubleshooting step.[3][5]

Installing via npm

For users who are comfortable with Node.js or following guides that rely on npm, Anthropic also supports installation through the npm registry.[3][2][5]

On systems with a compatible version of Node.js and npm installed, the typical command is:

npm install -g @anthropic-ai/claude-code[3][2][5]

The -g flag installs Claude Code globally so that the claude command is available from any directory.[2] Many guides recommend avoiding sudo with global npm installs unless explicitly directed by official documentation, and instead suggest using a Node version manager or configuring a user‑local global modules directory when permission errors occur.[2]

Users who originally installed Claude Code via npm can later migrate to a native binary by running the native installer and then removing the npm‑managed package, as described in advanced setup notes.[5]

First‑time login and usage

Once Claude Code is installed, users must sign in and point the CLI at a project folder before starting work.[3][1][2]

Opening a project folder

Claude Code operates on the contents of a directory. Typical usage begins by navigating to a folder in the terminal:

cd /path/to/your/folder

On Windows PowerShell, paths often have the form C:\Users\Name\Documents\project. Users can either create a new empty folder for experimentation or use an existing project directory.[3][2]

Starting Claude Code in the terminal

From inside the target folder, users run the claude command to begin a session.[3][2]

On first run, Claude Code usually:

  • Prompts the user to sign in with a Claude or Anthropic account, often by opening a browser window.
  • Connects the current terminal session to the authenticated account.
  • Scans the project directory to understand the files and structure.[3][1][2]

The CLI displays on‑screen prompts that guide users through the sign‑in and setup process.[3][1]

Asking initial questions

Once configured, the Claude Code prompt allows users to issue natural‑language instructions. Beginner‑oriented examples in tutorials include asking Claude to explain the project, generate a simple “Hello, world” program, summarise key files, or add comments to make code more readable.[3][2] Claude Code can then create or modify files and report changes in the terminal, often presenting diffs before edits are applied when integrated with an editor.[1][2][4]

Using Claude Code in editors

Anthropic provides official integrations that connect the Claude Code CLI to graphical editors, most notably Visual Studio Code.[1][4]

Visual Studio Code

According to Anthropic and neutral tutorials, a typical Visual Studio Code workflow involves:[1][4][2]

  1. Installing the Claude Code CLI using one of the supported methods.
  2. Opening Visual Studio Code and installing the official “Claude Code for VS Code” extension from the marketplace or a linked integration page.[4]
  3. Opening a project folder in Visual Studio Code.
  4. Opening the Claude Code side panel or using a command palette entry documented by the extension.
  5. Completing any in‑editor configuration, such as signing in, selecting models, or configuring how Claude may run commands.[4]

Once set up, the extension allows users to highlight code and ask Claude Code to explain, refactor, or generate related files; it can also show inline diffs of proposed changes and integrate with Git for committing edits.[1][4] Users who prefer the terminal can also run claude in Visual Studio Code’s integrated terminal and connect the session using CLI commands described in the documentation.[4]

Common issues and troubleshooting

Command not found errors

If the terminal reports command not found: claude on macOS or Linux, or “‘claude’ is not recognised as an internal or external command” on Windows, common remedies include opening a new terminal session, ensuring the installer ran without errors, and verifying that the installation directory is on the PATH environment variable, particularly for npm‑based installs.[3][5][2]

Permission issues with npm

When installing via npm, users sometimes encounter “permission denied” errors when attempting a global install.[2] Many Node.js guides recommend avoiding sudo with npm install -g and instead using a tool like a Node version manager or configuring npm to use a user‑writable directory for global modules, then re‑running the install command.[2]

Windows, Git Bash, and WSL

Advanced setup notes indicate that some Windows configurations may require Git for Windows or Windows Subsystem for Linux (WSL) to enable all features of Claude Code or related workflows.[5] In those cases, users may need to install Git, configure the correct Git Bash executable in settings, or follow WSL‑specific instructions provided in the official documentation.[5]

Network and login problems

If sign‑in fails or the browser cannot reach Anthropic's login page, common suggestions include checking the internet connection, retrying from another browser or an incognito window, and ensuring that VPNs or firewalls are not blocking Claude‑related domains.[3][5] Persistent issues are typically escalated via official support links in the Claude documentation.[3][5]

References

  1. ^ a b c d e f g h i j k l m n o p q r "Claude Code overview". Claude Code Docs. Anthropic. 1 April 2026. Retrieved 6 April 2026.
  2. ^ a b c d e f g h i j k l m n o p q r s "Claude Code: A Guide With Practical Examples". DataCamp. 14 January 2026. Retrieved 6 April 2026.
  3. ^ a b c d e f g h i j k l m n o p q r s t u v w x y z aa ab ac ad "Quickstart". Claude Code Docs. Anthropic. 1 April 2026. Retrieved 6 April 2026.
  4. ^ a b c d e f g h "Use Claude Code in VS Code". Claude Code Docs. Anthropic. 2 April 2026. Retrieved 6 April 2026.
  5. ^ a b c d e f g h i j k l m n o p q r s t u "Advanced setup". Claude Code Docs. Anthropic. 1 April 2026. Retrieved 6 April 2026.
  6. ^ "Get started with the desktop app". Claude Code Docs. Anthropic. 2 April 2026. Retrieved 6 April 2026.

Content Disclaimer

Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.

  1. The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
  2. There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
  3. It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
  4. Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
  5. Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.