Claude Code is Anthropic's AI coding agent. It runs in a terminal, reads your codebase, edits files and executes commands, steered by plain-language instructions and a permission system with you as the gate. The CLI is the core of it, and the same engine now shows up in a VS Code extension, a JetBrains plugin, a desktop app and cloud sessions in the browser. Every paid Claude plan includes it, or you can pay per token with a Console API key.
This article is the map of the whole tool, from install to third-party routers, with a pointer to a deeper guide wherever a topic earns one. I've used Claude Code daily on Ubuntu 24.04 through most of its 2.x life, and the shift it caused in my week is concrete: I type less code and review more of it. The hours moved from writing functions to specifying work, reading diffs and building guardrails so the agent can run longer between check-ins. Once that clicks, most of the configuration covered below stops looking like setup chores and starts looking like the actual job.
What Claude Code is and how the agent loop works
Underneath the branding sits a loop wrapped around a language model. You state a goal. The agent gathers context by searching and reading files, acts by editing code or running a command, then verifies the outcome before deciding its next move. Ask it to fix a failing test and you can watch the cycle happen: it runs the test, reads the failure, opens the implementation, proposes a diff for your approval and reruns the test afterwards. That verify step is what separates an agent from autocomplete. An unchecked patch never counts as done, and Claude Code behaves like it knows that.
Nothing heavy runs on your machine. The CLI sends prompts and relevant file contents to Anthropic's API for inference, so there's no GPU requirement and a modest laptop or a small server copes fine. Model choice sits behind the /model command with aliases like sonnet, opus, haiku and fable, and the current flagship models carry a 1M-token context window. That number matters more than benchmark scores once a task spans forty files, because the difference between an agent that remembers the constraint you set an hour ago and one that doesn't is the difference between delegation and babysitting.
My working mental model: a fast, tireless mid-level engineer who has never seen your project before this week. Everything else in this guide (memory files, permissions, hooks, subagents) exists to close that gap between raw capability and project knowledge.
Install Claude Code
The native installer is the right choice on every platform. It bundles its own runtime, needs no Node.js and keeps itself updated:
curl -fsSL https://claude.ai/install.sh | bash
That one line covers macOS, Linux and WSL; on Windows, PowerShell users run irm https://claude.ai/install.ps1 | iex instead. The binary lands at ~/.local/bin/claude, so a "command not found" after install nearly always means that directory isn't on your PATH yet. There's also an npm package (@anthropic-ai/claude-code, needs Node 22 or newer, never install it with sudo), plus Homebrew, WinGet and native apt and dnf repos. None of those update themselves, which turns into a real argument for the native route once you see the release pace on the claude-code GitHub repository. The 2.1 line is current as I write this; claude --version tells you where you stand, claude update moves you forward and claude doctor diagnoses a broken install.
Per-OS specifics have their own walkthroughs. The guide to installing Claude Code on Ubuntu 24.04 covers the PATH fix, the apt repo and headless login, and the Claude Code on Windows guide settles the native-versus-WSL question (short version: native works well now, WSL still wins for Linux-targeted projects). System requirements and every install channel are listed on Anthropic's official setup page.
Your first session
Claude Code operates on the current directory, so start it where the code lives:
cd ~/projects/your-repo
claude
First launch signs you in through the browser with your Claude account. After that you're at a prompt inside your repo, and the best first move is asking questions rather than requesting changes: "where is auth handled?", "what would break if I renamed this field?". Reading and searching need no approval, so exploration is free and fast, and it doubles as onboarding onto any codebase you didn't write. When you do hand over a real task, watch the first permission prompt come up before it runs a command; that prompt is the whole safety model in miniature. A full worked example, from failing test to commit, is in the guide on how to use Claude Code.
Plans, cost and usage limits
There's no free tier. Claude Code comes with the paid plans (Pro, Max in 5x and 20x tiers, Team and Enterprise) or runs pay-as-you-go against an API key, with Bedrock, Vertex and Foundry as the enterprise cloud routes. Subscription usage is metered on a rolling 5-hour window plus a separate weekly limit, shared with your claude.ai and desktop usage, so a heavy agent afternoon draws from the same pool as your chats. Inside a session, /usage shows where tokens went and /context visualizes what's occupying the window right now.
I'd start on Pro and let real usage tell you if you need more; the people who hit limits are running agents in parallel or feeding enormous contexts, and both habits respond well to trimming before they respond to upgrading. The mechanics, and the choice between subscription and API billing, get full treatment in the Claude Code cost and usage limits guide. No dollar figures here or there, deliberately, since they change faster than articles do.
CLAUDE.md and project memory
The file with the biggest payoff in the whole system is CLAUDE.md, the memory file loaded at the start of every session in a project. Run /init once and Claude analyzes the repo and generates a starter version with your build commands, test instructions and conventions; it even folds in existing Cursor or Copilot rules files. From then on, every session starts already knowing that tests run with npm test and that you never touch the generated client by hand.
The hierarchy goes deeper than one file: a user-level ~/.claude/CLAUDE.md for personal preferences, the project file in the repo, a gitignored CLAUDE.local.md for machine-specific notes and path-scoped rules in .claude/rules/ that only load when matching files are read. Every line costs context tokens on every session, which is the argument for keeping it lean. Writing a good one is a craft of its own, covered in the CLAUDE.md and /init guide. If you adopt one practice from this whole article, adopt that file. It's the difference between an agent that knows your project and one you re-brief daily.
Permission modes and safety
By default, Claude Code asks before editing files or running commands, and each prompt can grant that action for the rest of the session. Six modes adjust that dial: the manual default, an auto mode where a classifier waves through clearly safe actions (now the default for Pro, Max and Team accounts in the terminal and VS Code), acceptEdits for trusting file changes while gating commands, a dontAsk mode for CI, plan mode and bypassPermissions. Shift+Tab cycles between them mid-session, and allow and deny rules in settings.json let you pre-approve specific patterns like Bash(npm run test *).
Two of those modes deserve their own reading. Plan mode makes Claude research and propose before touching anything, which changes the quality of large refactors enough that I start every non-trivial task there; the plan mode guide covers when it earns its keep. At the other end, the --dangerously-skip-permissions flag removes every check, which is fine inside a disposable container and reckless on the machine holding your SSH keys. The flag's own refusal to run as root outside a container tells you what Anthropic thinks of casual use.
MCP servers, subagents, hooks and plugins
Out of the box the agent has your shell and your files. The extension surface is how it reaches everything else, and the four mechanisms divide up cleanly by what they change.
MCP servers
MCP (Model Context Protocol) servers add tools: your Postgres database, Sentry, Stripe, a browser, an internal API. One command wires up a remote server, and a checked-in .mcp.json shares the setup with your whole team. Scopes, authentication and the security judgment calls (an MCP server is an execution surface, treat it like one) are in the MCP configuration guide. Not every server is a vendor API either; some add pure reasoning structure, like the sequential thinking server, and some add whole methodologies, like the spec-driven Requirements, Design and Tasks flow in the spec-workflow guide.
Subagents
Subagents are markdown-defined workers in .claude/agents/ with their own context window, tool list and model. Built-ins like Explore already handle read-only research without polluting your main session's context; custom ones let you build a code reviewer pinned to a cheaper model or a migration runner locked out of production paths. The subagents guide covers the frontmatter and the delegation patterns.
Hooks
Hooks run your own scripts on agent events: format every file after Claude edits it, block any bash command touching .env, log every permission prompt. They're deterministic where prompts are probabilistic, which makes them the right tool for rules with no acceptable failure rate. Configuration, events and exit-code semantics are in the hooks guide.
Skills and plugins
Skills are folders with a SKILL.md holding reusable instructions, invoked as slash commands or picked up automatically when relevant. Plugins bundle all of the above (skills, agents, hooks, MCP config) into one installable directory, managed with /plugin and shareable through marketplaces. Map level is enough here: reach for a skill when you keep pasting the same instructions, reach for a plugin when a whole team needs the same setup. Community projects package this layer wholesale; the biggest, covered in the SuperClaude framework guide, ships thirty commands and twenty personas in one install, with all the context cost that implies.
Sessions and long-running work
Every conversation persists on disk per project. claude --continue reopens the latest session in the current directory with full history, claude --resume offers a picker and /export writes a plain-text transcript. Storage, forking and what a resumed session does and doesn't restore are laid out in the sessions guide. For visibility while a session runs, a configurable status line keeps the model, git branch and context usage on screen, which sounds cosmetic until the first time you notice the context bar at 90% before an important request instead of after.
Longer-running work pushes you off the laptop. An always-on server changes what you ask of the agent: multi-hour refactors in tmux that survive your SSH connection dropping, scheduled claude -p jobs from cron, an agent still working while your laptop sleeps. The Claude Code on a VPS guide builds that setup end to end; if you'd rather skip the manual install, LumaDock's Claude Code VPS hosting deploys the one-click template with the CLI preinstalled on Ubuntu.
Anthropic's own answer to the same need is Claude Code on the web: cloud sessions at claude.ai/code running on managed VMs against a GitHub repo, returning their work as branches and pull requests. You can start one from the terminal with claude --cloud "task" and pull it down later with /teleport. I use the web sessions for parallel background chores and my own server for anything needing tools or data Anthropic's VMs don't have.
Troubleshooting Claude Code
Most failures trace back to a small set of causes. PATH problems produce "command not found" right after a successful install. A stray ANTHROPIC_API_KEY in your shell silently overrides subscription login and produces confusing billing or "organization disabled" errors, and it's the first thing I check when auth misbehaves. IDE users get their own special case: the VS Code extension's "process exited with code 1" message, which nearly always means the underlying CLI is broken in a way a plain terminal will reveal in seconds. The wider catalog of errors and fixes lives in the common errors guide.
One habit worth stating plainly: keep the CLI updated. CVE-2026-54316, a WebFetch data-exfiltration flaw fixed in 2.1.163, is the standing reminder that an agent with network access has a real attack surface, and auto-updates are the cheapest defense you'll ever deploy.
Claude Code vs Cursor and other IDE tools
The comparison people ask about most puts Claude Code against Cursor, and after using both my answer is that they occupy different points on a delegation spectrum. Cursor keeps you in the editing loop with inline suggestions and fast feedback; Claude Code assumes you'll hand over a task and review the result. Small fixes favor the IDE feel, long multi-file jobs favor the agent, and running Claude Code inside Cursor's terminal is a legitimate answer rather than a compromise. The Claude Code vs Cursor comparison tests both on three real tasks if you want the receipts.
Two neighbors round out the picture. Against OpenAI's terminal agent the question is closer to a coin flip decided by which subscription you already pay for, argued properly in Codex vs Claude Code. And you don't have to choose between terminal and editor at all: official extensions put the same agent inside VS Code, JetBrains IDEs and Zed, with the setup and account gotchas collected in the VS Code, JetBrains and Zed guide.
Third-party providers and routers
The edges of the system: Claude Code speaks to any endpoint implementing Anthropic's API shape, which is how ANTHROPIC_BASE_URL plus an auth token points it at OpenRouter, and how the open-source claude-code-router project routes it to other model providers entirely with fallbacks and cost tracking. You give up subscription auth and some polish in exchange for provider flexibility, a trade the OpenRouter and Claude Code Router guide weighs honestly. The furthest edge is programmatic: the same harness ships as a library for building your own agent products, renamed along the way, which the Claude Code SDK guide untangles.
That's the full territory. If you're starting from zero, the order that works is: install, log in, run /init in a real repo and give it one genuine task with plan mode on. Once the basics feel routine, the opinionated workflow layer, which habits compound and which ones look clever and cost money, is condensed in Claude Code best practices. The configuration depth is there when you need it, and the tutorials linked above go section by section as far as you want to take it.

