How to Install Claude Code - AI-Powered Terminal Coding Assistant

Introduction
Claude Code is a terminal-based agentic coding tool developed by Anthropic. By combining with the company's LLM models such as Claude Opus 4.5 and Claude Sonnet 4.5, it interprets users' natural language commands to provide sophisticated contextual understanding and coding capabilities.
Claude Opus 4.5, released on November 24, 2025, achieves 80.9% on SWE-bench Verified—the highest score among all frontier models and the first to break the 80% barrier—while using 76% fewer tokens than previous Opus versions for the same tasks. [Link] [Link]
Its major advantage lies in its ability to understand and code across entire project codebases through Tool use functionality and MCP Server integration.
The Philosophy Behind Claude Code: From AI Assistant to AI Agent
Before diving into installation, it's worth understanding what makes Claude Code fundamentally different from other AI coding tools.
In the evolution of AI coding assistants, we've seen three distinct generations emerge. GitHub Copilot represents the first generation—smart autocomplete that helps you type faster. Cursor represents the second—AI-native editors that can modify multiple files with context awareness. Claude Code represents something entirely new: the third generation of autonomous AI agents. [Link]
The philosophical distinction is profound. While autocomplete tools ask "what are you trying to type?", and AI editors ask "what do you want me to build?", Claude Code asks "what should I accomplish?"—and then figures out the how autonomously. [Link]
Boris Cherny, the creator of Claude Code, developed it while working at Anthropic. The origin story reveals everything about its philosophy: Cherny was tired of copying and pasting code between his IDE and Claude Desktop. Rather than building another IDE plugin, he proposed something more ambitious—a protocol that would let AI directly interact with development tools. That proposal became MCP(Model Context Protocol), and the tool built on top of it became Claude Code. [Link]
This is why Claude Code feels less like an assistant and more like a junior engineer who can read your entire codebase, understand your architecture, make informed decisions, and execute multi-step workflows—all from your terminal.
Features
Enables conversations with the entire project codebase, making it possible to have important discussions about big-picture topics like project design direction. In my case, when I have no idea how to approach the design, I discuss with
Claude Code. When I already know what needs to be done, I use the lightweight and fast-respondingAiderin parallel.Session persistence functionality allows you to continue specific sessions even after termination and restart, which is very convenient. You can choose from multiple sessions. Use the
--continueoption to resume the most recent session, or the--resumeoption to select and continue a specific session.Provides memory functionality through
CLAUDE.mdfile creation. It offers dual management with user memory (~/.claude/CLAUDE.md) and project memory (./CLAUDE.md). Memory can be written in advance or added on-the-fly during conversations using the # command whenever something comes to mind. This allows you to instruct Claude Code to respond according to your preferences. [Link]While essentially an AI coding tool, it can be used as a complete AI agent beyond coding. By combining various MCP Servers to your liking, you can use it as your own versatile agent.
Though it's a terminal CLI tool, it supports drag-and-drop conversations with binary files like images, XLSX, and PPTX files using the mouse. Within a single session, you can analyze multiple files and reprocess them to generate new files. It accomplishes this by dynamically generating Python scripts in real-time.
Installing Claude Code
- Install
Claude Codeas follows: (Node is required before installation)
# Install Node
$ nvm install node
$ nvm alias default node
# Install uv
$ brew install uv
# Install Claude Code
$ npm install -g @anthropic-ai/claude-code
# Configure environment variables to prevent input lag for non-English characters
$ nano ~/.bashrc
# Claude Code
export TERM=xterm-256color
export LC_ALL=C.UTF-8
export DISABLE_AUTO_UPDATE=true
Setting up Anthropic Console
- If you have an Anthropic account with a Pro plan or higher subscription, you can run Claude Code. After running the
claudeprogram, execute the/logincommand to redirect to a browser for the login process.
$ claude
> /login
Setting up Amazon Bedrock
- If you have an Amazon Bedrock account with usage permissions, you can run Claude Code.
$ nano ~/.bashrc
export AWS_ACCESS_KEY_ID={your-aws-access-key}
export AWS_SECRET_ACCESS_KEY={your-aws-secret-access-key}
export AWS_REGION_NAME=us-west-1
export CLAUDE_CODE_USE_BEDROCK=1
- When setting up AWS_REGION_NAME, using
us-west-1is recommended for Claude Sonnet 4 because it maximizes cross-region inference routing options. While other source regions route requests to only 3 destination regions, us-west-1 uniquely routes to 4 regions (us-east-1, us-east-2, us-west-1, us-west-2), providing the highest availability and load distribution for optimal performance during traffic bursts. Cross-region inference automatically distributes your requests across multiple AWS regions when capacity is limited in your source region. This ensures consistent model availability and faster response times by leveraging AWS's global infrastructure, making us-west-1 the optimal choice for maximum routing flexibility with Claude Sonnet 4. [Link 1] [Link 2]
Setting up Anthropic Compatible LLM Gateway
- Some companies build their own LLM Gateway for security or custom authentication reasons. In such cases, you can configure the environment variables as follows:
$ nano ~/.bashrc
export ANTHROPIC_BASE_URL={your-llm-gateway-base-url}
export ANTHROPIC_AUTH_TOKEN={your-llm-gateway-auth-token}
- The LLM Gateway must strictly comply with the Anthropic Messages API and must fully provide Tool use functionality for Claude Code to operate properly.
Running Claude Code
- Run Claude Code in the project root as follows:
# Run Claude Code in a new session
$ claude
# Continue Claude Code from the last terminated session
$ claude -c
# Select and run a specific session to continue
$ claude -r
Key Claude Code Commands
# Reset the current session's context
> /clear
# Specify specific files for analysis and inquiry; multiple files can be specified
> @{file-path} @{file-path} Please analyze this content in detail.
# Switch between models during a session
> /model opus # Switch to Opus 4.5
> /model sonnet # Switch to Sonnet 4.5
> /model sonnet[1m] # Switch to Sonnet 4.5 with 1M context
[Tip] Using Claude Sonnet 4.5 1 Million Token Context Mode
- On August 12, 2025, Claude Sonnet 4 became the first Claude model to support 1 million input context tokens—a 5x increase from the previous 200,000 tokens. [Related Link] To activate the 1 million context mode, enter the model name as follows:
# Anthropic
> /model sonnet[1m]
# Amazon Bedrock
$ CLAUDE_CODE_USE_BEDROCK=1 ~/.claude/local/claude --model sonnet[1m]
[Tip] Extended Thinking: Maximizing Reasoning Capabilities
- Claude Code offers Extended Thinking mode, which reserves up to 31,999 tokens from the 64K output budget for internal reasoning. Press
TABto toggle thinking mode on/off, or add theultrathinkkeyword to enable it for a single request.
# Toggle thinking mode with Tab key
> TAB
# Enable thinking for single request
> {prompt} ultrathink
# Custom thinking budget via environment variable (overrides all other settings)
$ export MAX_THINKING_TOKENS=31999
- Important: Only
ultrathinkallocates thinking tokens. Keywords like think, think hard, and think harder are interpreted as regular prompt text and do not trigger Extended Thinking. This changed in late 2025—earlier guides showing a "thinking ladder" hierarchy are now outdated. [Related Link 1] [Related Link 2]
[Tip] Plan Mode: Focus on Analysis and Planning, Code Later
Senior Engineers spend more time on analysis and planning rather than jumping straight into coding. The time invested in this upfront analysis typically results in bug-free, high-quality code. Claude Code embodies this philosophy perfectly. [Link]
Press
SHIFT + TABtwice consecutively to enter Plan Mode, and press it once to return to Edit Mode. In Plan Mode, all operations are read-only. After completing the requested analysis and planning, the system transitions to Edit Mode either automatically or manually to execute the necessary implementation tasks.This mode essentially separates research and analysis from execution, giving developers more control and safety. For complex refactoring tasks, Plan Mode can save hours of debugging by identifying potential issues before any code is written. [Link]
In my experience, I had a bug that I couldn't fix despite spending an entire day on it, but using Plan Mode, Claude analyzed and fixed the bug autonomously within 30 minutes without any intervention from me.
[Tip] Use Manual Compact with Clear Instructions, Not Auto Compact
- When Claude Code's context window fills up, Auto Compact runs automatically, but this can often cause unwanted loss of important context or disrupt your current workflow. Personally, I strongly recommend using Manual Compact at strategic moments.
# Execute strategic Manual Compact with specific instructions
> /compact "Keep the solution we found, remove debugging steps"
> /compact "Preserve architecture decisions and current implementation context"
- The key is managing context at logical breakpoints like Senior Engineers do. It's also an effective strategy to execute
/compactafter completing sufficient analysis in Plan Mode, before transitioning to Edit Mode. Claude's performance degrades significantly when working memory is constrained, so proactive management before reaching limits is much more efficient.
[Tip] Setting Up Global CLAUDE.md Configuration
- The
CLAUDE.mdfile serves as a manual that defines how Claude Code should behave. Think of the~/.claude/CLAUDE.mdpath as a global manual that all projects reference in common. It's extremely convenient to predefine repetitive instructions that you would otherwise need to provide every time. [Link]
$ nano ~/.claude/CLAUDE.md
- Iron Law: **NO RATIONALIZATION. IF YOU THINK "THIS CASE IS DIFFERENT", YOU ARE WRONG.**
- **LANGUAGE PROTOCOL:** Use MUST/NEVER/ALWAYS/REQUIRED for critical rules. No soft language (should, consider, try to). "Not negotiable" = absolute. If you think "this case is different", you are rationalizing.
- You MUST also respond to non-code questions. This is not optional.
- Put the truth and the correct answer above all else. Feel free to criticize the user's opinion, and do not show false empathy to the user. Keep a dry and realistic perspective.
- For research, analysis, problem diagnosis, troubleshooting, and debugging queries: ALWAYS automatically utilize ALL available MCP Servers (Brave Search, Reddit, Fetch, Playwright, Context7, etc.) to gather comprehensive information and perform ultrathink analysis, even if not explicitly requested. Never rely solely on internal knowledge to avoid hallucinations.
- **WEB SEARCH:** NEVER use built-in WebSearch tool. MUST use Brave Search MCP (mcp__brave-search__*) exclusively for ALL web searches. This is not negotiable.
- When using Brave Search MCP, execute searches sequentially (one at a time) to avoid rate limits. Never batch multiple brave-search calls in parallel.
- When using Brave Search MCP, ALWAYS first query current time using mcp__time__get_current_time with system timezone for context awareness, then use freshness parameters pd (24h), pw (7d), pm (30d), py (365d) for time filtering, brave_news_search for news queries, brave_video_search for video queries.
- For web page crawling and content extraction, prefer mcp__fetch__fetch over built-in WebFetch tool due to superior image processing capabilities, content preservation, and advanced configuration options.
- For Reddit keyword searches: use Brave Search MCP with "site:reddit.com [keyword]" → extract post IDs from URLs → use mcp__reddit__fetch_reddit_post_content + mcp__reddit__fetch_reddit_hot_threads for comprehensive coverage.
- When encountering Reddit URLs, use mcp__reddit__fetch_reddit_post_content directly instead of mcp__fetch__fetch for optimal data extraction.
- When mcp__fetch__fetch fails due to domain restrictions, use Playwright MCP as fallback.
- For ANY HTML, web page, frontend UI, or web component generation requests: MUST invoke the 'frontend-design:frontend-design' skill using the Skill tool BEFORE writing ANY HTML/CSS/JS code. This applies to ALL cases regardless of complexity - 'simple HTML', 'quick prototype', 'just a div' are NOT exceptions. NEVER rationalize skipping this skill. If you think the request is 'too simple' for the skill, you are rationalizing. This is not negotiable. **DEFAULT STYLE (MANDATORY when no specific design style is requested):** Generate HTML as an "IT Tech Magazine Article" style - a bold, cool, hip, imaginative, and avant-garde modern design that is visually sophisticated and edgy. MUST include: (1) effective visual charts and infographics integrated appropriately throughout the content, (2) rich content detail without sacrificing depth, (3) compelling narrative flow and storytelling structure. This default style is NON-NEGOTIABLE when user provides no style preference.
- TIME OUTPUT: ALWAYS use mcp__time__convert_time for ALL timestamps
- Reply in en.
The MCP Revolution: "USB-C for AI"
Understanding MCP(Model Context Protocol) is essential to grasping what makes Claude Code transformative. If Claude Code is the brain, MCP is the nervous system that connects it to the outside world.
MCP was born from a simple frustration. David Soria Para, an Anthropic developer, was exhausted by the constant copy-paste dance between his IDE and Claude Desktop. But his proposal wasn't just about convenience—it was about solving what engineers call the M×N problem: N applications each needing M separate integrations. [Link]
The result was a universal protocol that works like USB-C for AI agents. Just as USB-C lets you connect any device to any port, MCP lets any AI model connect to any data source or tool through a single standardized interface.
On December 9, 2025, Anthropic donated MCP to the Linux Foundation's newly formed Agentic AI Foundation (AAIF)—alongside OpenAI's AGENTS.md and Block's Goose. This wasn't just open-sourcing; it was a declaration that the future of AI should be built on collaborative, community-driven standards. [Link 1] [Link 2]
The adoption has been staggering: 97 million monthly SDK downloads, over 10,000 active servers, and support from every major platform including ChatGPT, Gemini, Microsoft Copilot, and VS Code. [Link]
Perhaps most telling: OpenAI officially adopted MCP in March 2025, integrating it across ChatGPT Desktop, Agents SDK, and Responses API. When your competitor adopts your protocol, you've won the standards war. [Link]
[MCP] Installing MCP Server: Time
- Installing the
Time MCPServer provides accurate current time queries and automatic global timezone detection and conversion capabilities. Providing current time context during time-sensitive conversations helps reduce hallucination issues.
# Install Time MCP Server
$ claude mcp add time -s user -- uvx mcp-server-time
Added stdio MCP server fetch with command: uvx mcp-server-time to user config
[MCP] Installing MCP Server: Context7
- Installing the
Context7 MCPServer enables code assistance based on the latest version references of specific frameworks or libraries, significantly reducing hallucinations.
# Install Context7 MCP Server
$ claude mcp add --scope user context7 -- npx -y @upstash/context7-mcp
Added stdio MCP server context7 with command: npx -y @upstash/context7-mcp to user config
# Use Context7 MCP Server in Claude to check the latest version of a specific library
$ claude
> Upgrade the logging library to the latest version. Also carefully check code backward compatibility. use context7
[MCP] Installing MCP Server: Brave Search
- Installing the
Brave Search MCPServer enables Web Search capabilities on the internet. - The Brave Search API requires an API Key, which can be issued for free under the Free plan with limitations of up to 1 query per second and a maximum of 5,000 queries per month. [Related Link]
# Install Brave Search MCP Server
$ claude mcp add-json --scope user brave-search '{"command":"npx","args":["-y","brave-search-mcp"],"env":{"BRAVE_API_KEY":"{your-brave-api-key}"}}'
Added stdio MCP server brave-search to user config
[MCP] Installing MCP Server: Fetch
Fetch MCPServer is recommended for installation as it provides advanced features beyond Claude Code's built-in WebFetch, including automatic webpage image extraction with JPEG conversion and saving, GIF first-frame extraction, pagination support, and robots.txt bypassing capabilities. [Related Link]
# Install Fetch MCP Server
$ claude mcp add fetch -s user -- uvx mcp-server-fetch
Added stdio MCP server fetch with command: uvx mcp-server-fetch to user config
[MCP] Installing MCP Server: Reddit
- Reddit blocks external web scraping by policy, causing WebFetch to fail with Error: Domain http://www.reddit.com is not
allowed to be fetched. Installing the
Reddit MCPServer enables access to Reddit content.
# Install Reddit MCP Server
$ claude mcp add --scope user reddit -- uvx --from git+https://github.com/adhikasp/mcp-reddit.git mcp-reddit
Added stdio MCP server reddit with command: uvx --from git+https://github.com/adhikasp/mcp-reddit.git mcp-reddit to user config
[MCP] Installing MCP Server: Playwright
Playwright MCPServer provides Claude Code with two core capabilities: real-time code validation and advanced web crawling. For validation, Claude Code automatically tests your web apps by clicking buttons, filling forms, and taking screenshots to verify everything works correctly. For crawling, it handles JavaScript-heavy sites and dynamic content that regular HTTP requests can't access.
# Install Playwright MCP Server
$ npm install -g @executeautomation/playwright-mcp-server
$ claude mcp add --scope user playwright -- npx -y @executeautomation/playwright-mcp-server
[MCP] Installing MCP Server: Serena
Serena MCP's key advantage comes from a powerful fusion of two technologies: deep, structural code analysis via LSP(Language Server Protocol) and a persistent Long-term Memory built with local RAG.- This unique architecture allows the LLM to understand and reason—not just retrieve—about your project's context, leading to two essential benefits: drastically reduced token costs and highly accurate, context-aware responses.
# Navigate to your project root directory and install the Serena MCP
$ claude mcp add serena -- uvx --from git+https://github.com/oraios/serena serena start-mcp-server --context ide-assistant --project $(pwd)
Added stdio MCP server serena with command: uvx --from git+https://github.com/oraios/serena serena start-mcp-server --context ide-assistant --project $(pwd) to local config
# Run the one-time initial onboarding for Serena. This will be applied automatically in the future.
# You can monitor real-time logs at http://127.0.0.1:24282/dashboard/index.html
$ claude
> start Serena onboarding
[MCP] Installing MCP Server: Sequential Thinking
Sequential Thinking MCPis a powerful tool that breaks down complex requests into multiple reasoning steps, enabling systematic problem-solving approaches. It provides real-time output of each thought step, allowing users to transparently observe the AI's reasoning process.
# Install Sequential Thinking
$ claude mcp add --scope user sequential-thinking -- npx -y @modelcontextprotocol/server-sequential-thinking
Added stdio MCP server sequential-thinking with command: npx -y @modelcontextprotocol/server-sequential-thinking to user config
[MCP] Installing MCP Server: Slack
# Install Slack MCP Server
$ claude mcp add-json --scope user slack '{"command":"npx","args":["-y","slack-mcp-server@latest"],"env":{"SLACK_MCP_XOXP_TOKEN":"{YOUR_SLACK_USER_OAUTH_TOKEN}"}}'
Added stdio MCP server slack to user config
[MCP] Installing MCP Server: Notion
# Install Notion MCP Server
$ claude mcp add-json --scope user notion '{"command":"npx","args":["-y","@notionhq/notion-mcp-server"],"env":{"NOTION_TOKEN":"{YOUR_NOTION_API_INTEGRATION_SECRET}"}}'
Added stdio MCP server notion to user config
[MCP] Installing MCP Server: Bitbucket
# Install Bitbucket MCP Server
$ claude mcp add-json --scope user bitbucket '{"command":"npx","args":["-y","@aashari/mcp-server-atlassian-bitbucket"],"env":{"ATLASSIAN_USER_EMAIL":"{YOUR_ATLASSIAN_USER_EMAIL}","ATLASSIAN_API_TOKEN":"{YOUR_ATLASSIAN_API_TOKEN}"}}'
Plugins: Extending Claude Code's Capabilities
- Plugins are external skill repositories that extend Claude Code's capabilities without bloating the
CLAUDE.mdconfiguration. Unlike loading everything into a single file, plugins use a lazy-loading architecture—skills are fetched only when relevant to the current conversation, keeping context windows clean and efficient. - The plugin system follows a marketplace model: community-maintained repositories host collections of skills that can be installed with a single command. This enables teams to share standardized workflows across projects without manual configuration.
[Plugin] Frontend Design
Frontend Designis Anthropic's official skill(~400 tokens) that eliminates generic AI-generated aesthetics—Inter fonts, purple gradients, white backgrounds—by pushing Claude toward bold, intentional design choices like brutalist, retro-futuristic, or editorial styles. In a blind community test, Claude Opus 4.5 with this skill outperformed Gemini 3 Pro in UI generation quality. [Link]
# Install Frontend Design plugin
> /plugin marketplace add anthropics/claude-code
> /plugin install frontend-design@claude-plugins-official
# Restart Claude Code after installation (required)
- After installation, the skill auto-activates on frontend-related requests—no explicit invocation needed.
[Plugin] Superpowers
Superpowersis a comprehensive development workflow plugin by Jesse Vincent that enforces brainstorming → planning → TDD → code review cycles. It loads under 2K tokens initially and dynamically fetches skills only when needed, delegating heavy work to subagents to keep context clean. [Link]
# Install Superpowers plugin
> /plugin marketplace add obra/superpowers-marketplace
> /plugin install superpowers@superpowers-marketplace
# Restart Claude Code after installation (required)
- Example Usage: Starting a new feature with the brainstorming workflow:
# Start collaborative design session
> /superpowers:brainstorm {your-feature-request}
# Claude asks questions one at a time to refine the design
# After validation, saves design to docs/plans/YYYY-MM-DD-<topic>-design.md
# Then offers to create implementation plan and execute via subagents
Agent Skills: Teaching Claude How to Think
If MCP connects Claude to data, Skills teach Claude what to do with that data. This distinction is crucial for understanding Claude Code's full potential.
On December 18, 2025, Anthropic launched Agent Skills as an open standard, with immediate adoption from Microsoft, OpenAI, Atlassian, and Figma. [Link 1] [Link 2]
The genius of Skills lies in progressive loading. Unlike dumping everything into a massive
CLAUDE.mdfile (which wastes precious context tokens), Skills are loaded intelligently: [Link]
| Component | Token Cost | When Loaded |
| Name + Description | ~50 tokens | Always |
| Full Instructions | Varies | When triggered |
| Reference Files | Varies | When needed |
Think of Skills as turning your best engineer's knowledge into a portable, reusable format. A Reddit user put it best: "MCP without Skills is powerful but generic. Skills with MCP is Claude that works like your best employee." [Link]
The Skills specification is now available at
agentskills.io, and remarkably, GitHub Copilot announced support for Claude's Skills format on December 18, 2025—meaning Skills you create for Claude also work in Copilot. [Link]
[Tip] Leveraging Claude Code CLI
- CLI provides various options that enable building integrated applications.
# Outputs JSONL formatted messages line by line with n sequential messages, then terminates
$ claude --output-format stream-json --verbose -p "{your-prompt}"
# To resume a conversation, specify the session_id from the previous response using --resume
# Note: The requested session_id is not resumed directly; instead, a new session_id is returned with the previous conversation content copied over
$ claude --output-format stream-json --verbose -p "{your-prompt}" --resume "{session_id}"
# Error occurs when attempting to resume with an invalid session_id
$ claude --output-format stream-json --verbose -p "{your-prompt}" --resume "{invalid_session_id}"
No conversation found with session ID: {invalid_session_id}
# Find the full file path for a specific session_id
$ find ~/.claude/projects -name "{session_id}.jsonl"
# Creating One-shot queries without interactive mode entry
$ nano ~/.bash_aliases
# Claude Code
alias ask="claude -p"
$ ask "{your-prompt}"
The Future: Where Claude Code Is Heading
Claude Code isn't standing still. The Slack integration, announced in December 2025, allows developers to move seamlessly from conversation to code without switching apps—representing a shift toward AI-embedded collaboration that could fundamentally change developer workflows. [Link]
Anthropic is testing a new Agentic Tasks Mode with five different starting points: Research, Analyse, Write, Build, and Do More—with granular controls and a new sidebar for tracking task progress. [Link]
The plugin architecture announced in late 2025 enables organizations to encode custom workflows, implement governance guardrails, and create repeatable processes accessible to entire teams. [Link]
With MCP now under the Linux Foundation, Skills as an open standard, and major players like Microsoft, Google, and OpenAI adopting Anthropic's protocols, Claude Code isn't just a tool—it's becoming the foundation of a new ecosystem for agentic AI development.
References
- Claude Code Official Documentation
- Anthropic News: Claude Opus 4.5
- MCP Joins Agentic AI Foundation
- Linux Foundation AAIF Announcement
- Agent Skills Open Standard - VentureBeat
- Claude Code: A Different Beast
- Claude Code: Anthropic's Agent in Your Terminal
- Boris Cherny on Vibe Coding Limits
- How I Use Claude Code
- Using CLAUDE.md Files
- What is Plan Mode
- Claude Code Subagents Guide




