惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

月光博客
月光博客
Martin Fowler
Martin Fowler
博客园_首页
量子位
T
Tailwind CSS Blog
博客园 - Franky
G
Google Developers Blog
D
DataBreaches.Net
Vercel News
Vercel News
B
Blog
Recent Announcements
Recent Announcements
S
SegmentFault 最新的问题
M
MIT News - Artificial intelligence
爱范儿
爱范儿
博客园 - 【当耐特】
The Cloudflare Blog
H
Help Net Security
云风的 BLOG
云风的 BLOG
P
Proofpoint News Feed
C
Check Point Blog
有赞技术团队
有赞技术团队
Microsoft Security Blog
Microsoft Security Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
Claude Code: The Complete Setup Guide for macOS, Windows,...
Dev Daily · 2026-05-10 · via DEV Community

Claude Code is Anthropic's official command-line agent for software engineering. It lives in your terminal, reads your repository, runs commands on your behalf, and edits files with a level of context awareness that no autocomplete can match. This guide walks you through installing it on macOS, Windows, and Linux, signing in, configuring your first project, and getting to a productive flow before lunch.

We'll skip the marketing and focus on the parts that actually matter — the install steps that fail silently if you skip them, the settings worth tweaking on day one, and the workflow patterns that make Claude Code feel like a senior engineer pairing with you instead of a fancier autocomplete.

What you'll learn

  • Installing Claude Code via the official installer or npm
  • Signing in with an Anthropic account or API key
  • Trusting your first project and running your first prompt
  • Configuring permissions, hooks, and MCP servers
  • A workflow checklist for daily use

Prerequisites

You need a working terminal, Node.js 18 or newer if you choose the npm install path, and an Anthropic account. A paid Claude.ai subscription gets you generous usage; otherwise an API key works the same way and bills per token.

  • macOS: any modern Mac (Apple Silicon or Intel) with Terminal or iTerm2.
  • Windows: Windows 10 or 11 with WSL2 strongly recommended for the Linux-flavored tooling.
  • Linux: any major distro with a recent shell.

Install on macOS

The fastest path on macOS is the official one-liner. It downloads the binary, places it in ~/.local/bin, and adds the directory to your shell PATH if it isn't already there.

# Official installer (recommended)
curl -fsSL https://claude.ai/install.sh | sh

# Verify
claude --version

Enter fullscreen mode Exit fullscreen mode

If you prefer to keep all your CLIs managed by a package manager, you can use Homebrew or npm:

# Homebrew (community formula)
brew install anthropic/claude/claude

# Or via npm (works on every OS)
npm install -g @anthropic-ai/claude-code

Enter fullscreen mode Exit fullscreen mode

Install on Windows

On Windows you have two reasonable options: native PowerShell or WSL2. Most teams pick WSL2 because the rest of the developer experience — Docker, Git, Node — works more smoothly there. Inside WSL2, follow the Linux steps below. For native Windows, install Node 18+ and run:

# In an Admin PowerShell
npm install -g @anthropic-ai/claude-code
claude --version

Enter fullscreen mode Exit fullscreen mode

Note: If claude isn't found after install, restart your shell so the new PATH entry takes effect.

Install on Linux

# Recommended
curl -fsSL https://claude.ai/install.sh | sh

# Or with npm
npm install -g @anthropic-ai/claude-code

# Confirm
claude --version

Enter fullscreen mode Exit fullscreen mode

Sign in for the first time

Run claude inside any terminal and follow the browser prompt. You'll authenticate against Anthropic, your local CLI will receive a session token, and subsequent runs won't need to log in again.

claude
# → opens a browser tab → sign in → return to the terminal

Enter fullscreen mode Exit fullscreen mode

Prefer using a raw API key (e.g., for headless servers or CI)? Export it before launching:

export ANTHROPIC_API_KEY=sk-ant-...
claude

Enter fullscreen mode Exit fullscreen mode

Trust your first project

Open a real repository — not your home folder — and start claude from inside it. The first time, Claude Code asks for permission to read and edit files in that directory. Approve it for the project root and you're ready to prompt.

cd ~/code/my-project
claude

Enter fullscreen mode Exit fullscreen mode

Try a small, observable task first. Ask Claude to summarize the project, identify the entry points, or fix a tiny bug. The point is to see Claude read files, run commands, and propose edits before you trust it with larger work.

Configure on day one

Three settings pay for themselves immediately:

  1. Permissions: in ~/.claude/settings.json, allow safe shell tools by default and require confirmation for destructive ones (anything that touches Git history, deletes files, or pushes to remotes).
  2. Hooks: add a hook that runs your formatter and tests after every edit. The model gets immediate feedback when it breaks something.
  3. MCP servers: wire up a database MCP server so Claude can read your schema, and a docs MCP server for your framework of choice.

A first-day workflow

Once installed, the actual productivity move is treating Claude Code like a junior engineer who happens to be very fast. Brief it like a colleague: explain the goal, point at the right files, share constraints, and review its diffs the way you'd review a teammate's pull request. Don't dump bare instructions and expect magic — context is what makes this work.

  • Start each session by orienting Claude: "Here is what we're working on, here is the relevant file, here is what success looks like."
  • Have it write tests before the implementation when you can — it forces the spec into the open.
  • Run a tight feedback loop: edit, test, commit. Don't let it stack ten changes without verification.

Troubleshooting

Most install failures fall into three buckets — corporate proxies blocking the install script, stale shell cache hiding the new PATH, or Node version mismatches when using the npm install path. Restart the shell, check which claude, and try the official installer if npm misbehaves.

Where to go next

Once you're set up, learn three concepts: slash commands for repeatable workflows, hooks for automatic verification after edits, and MCP servers for giving Claude access to data sources beyond the file system. We cover each in dedicated tutorials on the blog.


Originally published on DevDaily — practical engineering tutorials, daily.