Claude Code in 2026: The Only Setup Guide You Need
Table of Contents
- What is Claude Code
- Installation
- Prerequisites
- Install
- Verify Installation
- Basic Usage
- Interactive Mode
- One-Shot Mode
- Pipe Mode
- Core Commands
- Slash Commands
- CLI Flags
- CLAUDE.md — The Onboarding Doc for Claude Code
- Why You Need CLAUDE.md
- How to Write One
- Real-World Example
- CLAUDE.md Hierarchy
- Permission System
- Plan Mode
- Practical Tips
- 1. Let It Read Before It Writes
- 2. Use /compact Liberally
- 3. Code Review with git diff
- 4. The Debug Loop
- 5. Use —continue to Keep Context
- 6. Switch Models as Needed
- IDE Integration
- Pricing
- The Complete Claude Code Series Map
- Getting Started
- Configuration
- Daily Commands (Most-Read)
- Advanced Capabilities
- Observability and Retrospective
- Productivity Tips
- Integration in Practice
- Final Thoughts
What is Claude Code
Claude Code is an AI coding agent built by Anthropic that runs directly in your terminal.
It’s not a VS Code extension or a web chat interface — it’s a command-line tool. You talk to it in your terminal, and it can read your code, edit your files, run your commands, and fix your bugs.
Unlike tools like GitHub Copilot that autocomplete a few lines, Claude Code is a true agent — it understands the full context of your codebase and can autonomously plan and execute multi-step development tasks.
Installation
Prerequisites
- Node.js 18+
- A Claude account (Pro, Max, Team, or Enterprise subscription)
Install
npm install -g @anthropic-ai/claude-code
Once installed, run it in any project directory:
claude
On first launch, it will guide you through logging into your Claude account. After authentication, you’re good to go.
Verify Installation
claude --version
Basic Usage
Interactive Mode
Just run claude to start an interactive session:
cd your-project
claude
Then talk to it in natural language:
- “Give me an overview of this project’s architecture”
- “There’s a bug in the token refresh logic in src/utils/auth.ts, fix it”
- “Add pagination to this API”
One-Shot Mode
Don’t want to enter interactive mode? Pass your prompt directly:
claude "Explain the directory structure of this project"
Pipe Mode
Claude Code supports Unix pipes — feed output from other commands into it:
cat error.log | claude "Analyze this error log and find the root cause"
git diff | claude "Review these changes for potential issues"
npm test 2>&1 | claude "Tests are failing, analyze and fix"
Core Commands
Slash Commands
These slash commands are essential in interactive mode:
| Command | Purpose |
|---|---|
/help | Show help information |
/compact | Compress context to free up token space |
/clear | Clear the current conversation |
/cost | Show token usage and cost for the current session |
/doctor | Diagnose Claude Code configuration and health |
/init | Generate a CLAUDE.md file for the current project |
/login | Switch accounts or re-authenticate |
/logout | Log out |
/model | Switch models (Opus / Sonnet / Haiku) |
/permissions | View and manage tool permissions |
/review | Code review the current git diff |
/terminal-setup | Configure terminal integration (Shift+Enter for newlines, etc.) |
CLI Flags
# Specify a model
claude --model claude-sonnet-4-6
# Continue the last conversation
claude --continue
# Pick from recent conversations to resume
claude --resume
# Non-interactive mode, plain text output (great for scripting)
claude -p "your prompt"
# Specify output format
claude -p "your prompt" --output-format json
# Allow all tool permissions (skip confirmation prompts)
claude --dangerously-skip-permissions
CLAUDE.md — The Onboarding Doc for Claude Code
This is one of Claude Code’s most powerful features. Create a CLAUDE.md file in your project root, and Claude Code will automatically read it every time it starts.
Why You Need CLAUDE.md
Without CLAUDE.md, Claude Code has to re-learn your project every time. With it, Claude Code immediately knows:
- What tech stack you’re using
- How to build, test, and deploy
- What your coding conventions are
- What pitfalls to watch out for
How to Write One
Running /init generates a basic version, but I recommend writing it manually for more precision. A good CLAUDE.md should include:
# CLAUDE.md
## Project Overview
Brief description of the project and tech stack.
## Commands
List build, test, lint, and deploy commands.
## Architecture
Directory structure, core modules, data flow.
## Coding Conventions
Indentation, naming, formatting rules.
## Notes
Known gotchas, special conventions, files not to touch.
Real-World Example
Here’s what I put in the CLAUDE.md for my monorepo:
# CLAUDE.md
## Project Overview
x-vq is a private frontend monorepo using Lerna + Nx.
## Commands
| Command | Purpose |
| --------------- | ------------------------------------ |
| `npm run build` | Build all packages |
| `npm run test` | Test all packages |
| `npm run lint` | Full pipeline: build -> lint -> test |
## Monorepo Rules
- Install deps: `npm i <pkg> -w <sub-package>`
- Run scripts: `npm run <script> -w <sub-package>`
- Never cd into sub-packages to install or run.
With this file, Claude Code knows it’s a monorepo, knows not to cd into sub-packages to install dependencies, and knows how to run builds and tests. No need to explain the same things every session.
CLAUDE.md Hierarchy
Claude Code reads CLAUDE.md from multiple locations, in order of priority (low to high):
~/.claude/CLAUDE.md— Global config, applies to all projectsCLAUDE.mdin the project root — Project-level configCLAUDE.mdin subdirectories — More granular config.claude/CLAUDE.md— Project-level, but not committed to git (for personal preferences)
Permission System
Claude Code requests permission when performing file operations and shell commands. You can choose:
- Allow once: Allow this time only
- Allow always: Permanently allow this operation
- Deny: Reject
You can also manage permissions via the /permissions command, or configure them in .claude/settings.json:
{
"permissions": {
"allow": ["Bash(npm run build)", "Bash(npm run test)", "Bash(git *)"],
"deny": ["Bash(rm -rf *)"]
}
}
Plan Mode
For complex tasks, you can ask Claude Code to plan before executing:
Migrate this Express project to Fastify, but plan it out first
Claude Code will enter Plan Mode and lay out:
- Which files need to be modified
- What each step involves
- Potential risks
It only starts executing after you confirm. This is invaluable for large refactors — review the plan, adjust if needed, and avoid wasted effort from a wrong direction.
Practical Tips
1. Let It Read Before It Writes
Don’t jump straight to “change this file.” Let it understand the context first:
Look at the implementation in src/services/payment.ts, then add refund functionality
2. Use /compact Liberally
Long conversations eat up tokens. Use /compact to compress the context — Claude Code keeps the key information and frees up space.
3. Code Review with git diff
/review
Or from the command line:
git diff main | claude "Review these changes"
4. The Debug Loop
One of the most satisfying workflows — let Claude Code run tests, read errors, fix bugs, and re-run:
Run the tests, and if any fail, fix them
It will execute the test command, analyze failures, modify the code, and re-run tests until everything passes.
5. Use —continue to Keep Context
Quit mid-session? Use claude --continue to pick up where you left off without re-explaining the background.
6. Switch Models as Needed
Sonnet is plenty for everyday development — fast and smart. Switch to Opus for complex architectural challenges:
/model claude-opus-4-6
IDE Integration
Claude Code is a CLI tool, but it works well alongside any IDE:
- VS Code: Install the Claude Code extension to use it directly in the editor
- JetBrains: Use it through the Terminal panel
- Vim/Neovim: A natural fit — the terminal is your IDE
Regardless of your editor, the workflow is the same: talk to Claude Code in the terminal, it edits your files, and you see the changes in real time in your editor.
Pricing
Claude Code is included in Claude subscription plans — no separate charge:
- Pro ($20/mo): Access with usage limits
- Max ($100 or $200/mo): Significantly higher usage limits
- Team / Enterprise: Team and enterprise-level usage
You can also use it with an API key, billed per token.
The Complete Claude Code Series Map
This blog has a full set of Claude Code guides. Here’s the map, grouped by learning path — jump to whatever interests you.
Getting Started
- This post: Claude Code usage guide
- /init — Generate CLAUDE.md in 10 seconds
- /memory — Make AI remember across sessions
- /doctor — Fix setup issues in 30 seconds
Configuration
- settings.json (1) Where config files live and who wins
- settings.json (2) The permissions system
- settings.json (3) The hooks system
- settings.json (4) env, models, auth, and other fields
- /config — Every setting explained
- /permissions — Fine-grained control over what AI can do
- /hooks — Make AI follow your rules
Daily Commands (Most-Read)
- /usage — Are you about to hit the rate limit
- /context — What’s eating your context window
- /compact — Free up context, keep progress
- /rewind — Undo any AI mistake in one command
- /effort — Make AI think harder (or faster)
- /fast — Same Opus, 2x speed
- /model — Opus vs Sonnet vs Haiku
- /resume — Pick up where you left off
- /btw — Ask a side question without losing context
Advanced Capabilities
- Agent Loop — Dissecting the heart of an AI coding assistant
- /agents — Give each task its own specialist AI
- Skills — Build reusable AI commands
- MCP — Give your AI access to any tool
- /plugin — Extend your AI with custom skills
- /plan — Let AI plan before it touches your code
Observability and Retrospective
- /cost — Track every dollar your AI spends
- /stats — See how much AI does for you
- /status — Your session at a glance
- /insights — Your personalized AI usage report
- /diff — See exactly what changed, turn by turn
- /tasks — Run multiple AI agents in parallel
- /review — Let AI do your code review
- /export — Save AI conversations before they’re gone
Productivity Tips
- /add-dir — The monorepo command you miss
- /theme — 6 built-in looks for your terminal
- /vim — Use hjkl in your AI terminal
- /rename — Find old sessions without guessing
- ! prefix — Run shell commands, save tokens
Integration in Practice
- GitHub MCP + Context7 — Best practice for external knowledge
- I built a bot that runs Claude Code from chat
Final Thoughts
Claude Code changed how I develop. It used to be “I write, AI assists.” Now it’s “I describe the requirements, AI executes, I review.”
It’s not a silver bullet — complex architectural decisions still need a human. But repetitive coding, tedious refactors, and endless error logs? Hand them to Claude Code.
If you’re a developer, I highly recommend giving it a try. Install it, run claude in your project, ask it anything — you’ll feel that moment of “oh, so this is what AI-powered coding is really about.”
Related Articles
Claude Code Agent Loop: Dissecting the Heart of an AI Coding Assistant
How does Claude Code understand your requests, invoke tools, and self-recover step by step? A source-code deep dive into the Agent Loop's core architecture — streaming responses, parallel tool execution, auto-compaction, and error recovery.
Claude Code settings.json Explained (1): Where Config Files Live and Who Wins
A complete guide to Claude Code's configuration file system — five config sources, their file paths, priority rules, array merging vs value overriding, and enterprise managed settings delivery.
Claude Code settings.json Deep Dive (Part 2): The Permissions System
A thorough breakdown of Claude Code's permissions configuration — allow/deny/ask rule arrays, wildcard syntax, MCP tool permissions, defaultMode options, and additionalDirectories.
Claude Code settings.json Deep Dive (Part 3): The Hooks System
A thorough breakdown of Claude Code's hooks configuration — four hook types, core events (PreToolUse/PostToolUse/Stop/Notification), stdin/stdout protocol, exit code semantics, and practical examples.
Claude Code settings.json Deep Dive (4): env, Models, Auth, and Other Useful Fields
A comprehensive guide to the remaining settings.json fields in Claude Code — env variable injection, model configuration, authentication helpers, Git attribution, session cleanup, language and UI, thinking depth, auto-updates, memory system, and more.