The Complete Guide to Installing and Configuring Claude Code: From Zero to Verified

A complete guide to installing, configuring, and verifying Claude Code across all major platforms.
This article provides a comprehensive walkthrough for installing Claude Code on macOS, Linux, and Windows, covering platform-specific methods (Curl scripts and Winget), common environment pitfalls like PATH misconfiguration, glibc version mismatches, and enterprise SSL certificate issues, plus a first-run smoke test to verify your setup is fully functional.
As an AI programming command-line tool from Anthropic, Claude Code can read and write files, execute commands, and operate Git directly in the terminal. It's one of the tools that comes closest to the real capability boundaries of AI programming. But many people hit roadblocks at the very first step — installation and configuration. This article systematically covers Claude Code's installation methods across different platforms, common troubleshooting scenarios, and the initial verification process.
Unlike tools such as GitHub Copilot and Cursor, Claude Code falls into the category of agentic coding. Traditional AI programming tools primarily offer code completion and suggestions — you write a line of code, and the AI predicts the next one. The core philosophy of agentic coding is to let the AI act as an autonomous agent that can understand high-level intent, plan steps on its own, read project files, execute system commands, modify code, and verify results. This means Claude Code isn't a plugin embedded in an editor — it's an independent agent with system-level operational capabilities, which is the fundamental reason it uses the command line as its primary interface.
Installation Methods for Different Platforms
Installing Claude Code isn't complicated. The core objective is simple: get the claude command into your system PATH so it can launch normally from the terminal. The recommended installation path varies depending on your operating system.
macOS and Linux: One-Click Installation via Curl Script
For macOS and Linux users, the recommended approach is to run the official Curl installation script directly. The script automatically detects your system architecture, downloads the corresponding binary, and adds claude to your local command directory (typically ~/.local/bin).
After installation, type claude in the terminal to launch it. If you get a Command Not Found error, check your PATH configuration first and confirm that .local/bin under your Home directory has been added to the environment variables.
It's worth explaining how the PATH environment variable works here. When you type a command in the terminal (like claude), the operating system doesn't search your entire hard drive for the executable. Instead, it only looks through the directories listed in the PATH variable, in order. PATH is a list of directories separated by colons (Linux/macOS) or semicolons (Windows), such as /usr/local/bin:/usr/bin:/home/user/.local/bin. If the claude binary is placed in ~/.local/bin but that directory isn't in PATH, the system will report Command Not Found. The fix is to add export PATH="$HOME/.local/bin:$PATH" to your Shell configuration file (such as ~/.bashrc or ~/.zshrc), then reload the configuration or restart the terminal. ~/.local/bin is the conventional location for user-level executables on Linux and macOS, following the XDG Base Directory specification. It doesn't require root permissions to write to, making it ideal for installing your own command-line tools.

Windows: Install Git First, Then Use Winget
For Windows users, the official documentation specifically emphasizes: don't rely on the outdated CMD. Instead, use Windows Terminal, PowerShell, or Git Bash as your terminal environment.
There are clear technical reasons behind this recommendation. CMD (Command Prompt) is a command-line interpreter that has existed since the Windows NT era. Its character encoding handling, pipe mechanisms, and scripting capabilities are quite limited, and its UTF-8 support is incomplete, which can easily cause garbled output with Chinese paths or text. PowerShell is Microsoft's modern command-line environment, built on .NET, supporting object pipelines, rich scripting syntax, and better Unicode handling. Windows Terminal is a terminal emulator (not a Shell itself) that can host CMD, PowerShell, WSL, and other Shells, providing modern terminal features like GPU-accelerated rendering, multiple tabs, and split panes. Git Bash is a Bash environment based on MSYS2 that comes with Git for Windows, simulating the basic Linux command-line experience (commands like ls, grep, cat, etc.), making it more friendly for developers accustomed to Unix-style operations. Many of Claude Code's operations involve file path handling, command piping, and Git operations, all of which can encounter compatibility issues in CMD.
The installation process has two steps:
- Install Git for Windows: Run
winget install Git.Git - Install Claude Code: Run
winget install Anthropic.ClaudeCode
After installation, reopen the terminal and run claude --version. If you see a version number, the CLI is ready to use.

Common Environment Issues and Solutions
The installation itself usually goes smoothly. What really causes headaches are environment issues. Here are three high-frequency pitfalls.
macOS Missing Xcode Command Line Tools
macOS users may encounter missing toolchain issues when running Git-related operations for the first time. The fix is simple — follow the system prompt to install Xcode Command Line Tools. Usually a single command xcode-select --install does the trick.
Xcode Command Line Tools is a basic developer toolkit provided by Apple that includes Git, Make, GCC/Clang compilers, linkers, and other core development tools. macOS doesn't pre-install these tools by default to keep the system lean. When you invoke the git command in the terminal for the first time, the system detects the missing tools and pops up an installation prompt. The toolkit is about 1-2 GB, and after installation, you get all the infrastructure needed for command-line development without downloading the full Xcode IDE (approximately 12 GB).
glibc Version Issues on Older Linux Systems
Some older Linux distributions may encounter issues where the glibc version is too low for the binary to run. In this case, you have two options: upgrade the system to a newer version, or use a Docker container to run Claude Code, bypassing the host machine's library version limitations.
glibc (GNU C Library) is the most fundamental shared library in Linux systems. Virtually all programs written in C/C++ depend on it to call the operating system's low-level functions (such as file operations, memory allocation, network communication, etc.). glibc follows a forward-compatible but not backward-compatible versioning strategy: a program compiled with glibc 2.31 can run on a system with glibc 2.35, but not the other way around. This is because newer versions of glibc introduce new symbol versioning, and programs record the minimum symbol version they depend on at compile time. When you compile a binary on a newer system (like Claude Code's official build environment) and then try to run it on an old server running CentOS 7 (glibc 2.17), you'll see errors like GLIBC_2.28 not found. Using a Docker container is the cleanest solution because the container comes with its own complete userspace libraries, completely isolated from the host's glibc version.
SSL Certificate Verification Failures in Enterprise Networks
This is the most common issue in enterprise environments. Corporate networks typically deploy SSL man-in-the-middle proxies, causing HTTPS request certificate verification to fail. The solution is to configure the Node.js extra CA certificate environment variable (NODE_EXTRA_CA_CERTS) to point to your company's CA certificate file path.
To understand this issue, you need to know the basics of SSL/TLS certificate verification. When your computer makes an HTTPS request to api.anthropic.com, the server presents a digital certificate to prove its identity, and your computer uses its built-in trusted root certificates (CA certificates) to verify the certificate's authenticity. However, in enterprise networks, IT departments typically deploy an SSL inspection proxy (such as Zscaler, Blue Coat, etc.). This proxy intercepts all HTTPS traffic, re-issues a "substitute certificate" using the enterprise's own CA certificate, and then inspects the decrypted traffic for security purposes. The problem is that the enterprise's CA certificate isn't in Node.js's default trusted certificate list, so Claude Code will throw UNABLE_TO_VERIFY_LEAF_SIGNATURE or SELF_SIGNED_CERT_IN_CHAIN errors when making API requests. After setting the NODE_EXTRA_CA_CERTS environment variable, Node.js appends the specified certificate file to its trust list, allowing certificates issued by the enterprise proxy to pass verification. You can request the .pem format CA certificate file from your company's IT department, then configure it with export NODE_EXTRA_CA_CERTS=/path/to/company-ca.pem.
Choosing Among Multiple Entry Points
Besides the terminal CLI, Claude Code offers multiple entry points, including a VS Code extension, Desktop App, Web interface, and more.

Despite the variety of options, the terminal CLI is recommended as your primary entry point. Here are three reasons:
- Most complete functionality: The CLI can directly read files, run commands, and operate Git without any UI-layer feature trimming
- Closest to real capability boundaries: You can clearly see what operations Claude Code actually performs
- More transparent debugging: When issues arise, terminal log output is far richer than what a GUI provides
Behind these three points lies a deeper technical logic. When a GUI (Graphical User Interface) wraps underlying operations, it inevitably performs information abstraction and trimming. Take the VS Code extension as an example — it needs to map Claude Code's operation results to the editor's UI components: file changes displayed in diff views, command output collapsed in panels, permission requests turned into popup buttons. While this encapsulation lowers the barrier to entry, it also hides critical execution details. When an AI agent executes a series of operations, in the CLI you can see in real-time which files it reads, what Shell commands it executes, what the return codes are, and what output is produced. This fully transparent execution chain is crucial for understanding the AI's decision-making process, spotting potential errors, and building an accurate mental model of the tool. Especially during the learning phase, the CLI's transparency helps you understand Claude Code's working methods and capability boundaries more quickly, rather than being misled by the GUI's "magic feel."
Other entry points (like the VS Code extension) can serve as supplements for daily development, but the CLI is key to building a solid foundation.
First Verification: Confirming Your Environment Is Fully Functional
After installation, don't rush into real project work. First, run a complete environment verification. Here are the steps:
- Create a new test directory and navigate into it
- Launch Claude Code
- Send a simple instruction, such as "create a simple HTML page"
- When done, view the result with
open index.html(macOS),xdg-open index.html(Linux), orstart index.html(Windows)

The purpose of this verification isn't to build a webpage — it's to confirm that all four capabilities are working properly in one go:
- ✅ Account login: Claude Code can connect to the Anthropic API normally
- ✅ File creation: It has permission to write files in the current directory
- ✅ Command execution: System commands can be invoked normally
- ✅ Project read/write: It can read the directory structure and understand context
These four checks actually cover the complete capability chain of Claude Code as an agentic coding tool. Account login verifies network connectivity and API authentication; file creation verifies local filesystem write permissions; command execution verifies Claude Code's ability to spawn subprocesses and execute Shell commands; project read/write verifies whether it can build contextual understanding of the project. If any of these four items fails, subsequent complex tasks will be blocked. Covering all critical paths through a minimal task in one go is a common Smoke Test approach in engineering practice — it doesn't aim for comprehensive coverage, just confirms that the core pipeline is working.
Summary: Installation Isn't Hard — The Environment Is What Matters
Installing and configuring Claude Code isn't a complex engineering task. What really needs to be checked and confirmed comes down to three things:
- Can the command launch — Is the PATH configured correctly?
- Can the current directory be read and written to — Are file permissions in order?
- Can common system commands execute normally — Are toolchains like Git and Node ready?
When you encounter issues, don't start randomly changing configurations. Troubleshoot in order of priority: directory permissions → terminal PATH → Git availability → network and certificates. Get these fundamentals solid, and your subsequent project work won't be interrupted by environment issues.
Related articles

AI Coding Agents Developing Decompilers: Lessons and Insights from the Kuna Project
How AI coding agents are transforming decompiler development. Using the Kuna project as a case study, exploring AI-assisted iteration, generate-verify loops, and the lowering barriers to complex system tool development.

Gemini Pro Job Search Quality Plummets: Model Degradation or Backend Adjustment?
Reddit users report Gemini Pro job search quality dropping drastically in one week, returning expired listings and aggregator junk instead of quality active positions with direct employer links.

AI Emotional Dependency: A Reddit Help Post Reveals a Deeper Crisis
A Reddit user's emotional breakdown over sudden AI output changes reveals deep issues around AI emotional dependency, silent model updates, and product responsibility boundaries.