Logo Vincent
Back to all posts

Claude Code in 2026: The Only Setup Guide You Need

Claude
Claude Code in 2026: The Only Setup Guide You Need

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:

CommandPurpose
/helpShow help information
/compactCompress context to free up token space
/clearClear the current conversation
/costShow token usage and cost for the current session
/doctorDiagnose Claude Code configuration and health
/initGenerate a CLAUDE.md file for the current project
/loginSwitch accounts or re-authenticate
/logoutLog out
/modelSwitch models (Opus / Sonnet / Haiku)
/permissionsView and manage tool permissions
/reviewCode review the current git diff
/terminal-setupConfigure 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):

  1. ~/.claude/CLAUDE.md — Global config, applies to all projects
  2. CLAUDE.md in the project root — Project-level config
  3. CLAUDE.md in subdirectories — More granular config
  4. .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:

  1. Which files need to be modified
  2. What each step involves
  3. 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.

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.”

© 2026 vincentqiao.com . All rights reserved.