AI & Development Tools
Jitendra's Blog
COMPLETE DEVELOPER GUIDE 2026 • HD INFOGRAPHIC INCLUDED

Claude Code: The Complete Guide

Master Anthropic's AI-powered CLI tool - from basic setup to advanced MCP servers, subagents, Git workflows, and IDE integrations. Includes downloadable HD infographic!

In This Guide
12
In-Depth Sections
Product Feature
7
Parallel Subagents
In This Guide
5
FAQs Answered
Product Feature
200K
Context Window

Complete Visual Guide

Download or save this comprehensive infographic covering all Claude Code features, commands, and best practices.

Claude Code Complete Infographic 2026 - Installation, MCP Servers, Subagents, Commands, Best Practices, Pricing Comparison
Claude Code Complete Infographic - Click to view full size (2400 x 7100px HD)
Right-click and "Save Image As" to download

1 What is Claude Code?

According to Anthropic's official documentation, Claude Code represents a paradigm shift in how developers interact with AI assistants. Unlike web-based chatbots, Claude Code operates within your actual development environment, understanding your codebase context and executing real actions.

Why Claude Code Matters

Traditional AI coding assistants require you to copy-paste code snippets back and forth. Claude Code eliminates this friction by:

Terminal Native

Runs in your terminal with full shell integration and command execution

Context Aware

Understands your entire codebase with 200K token context window

Git Integrated

Create commits, branches, and PRs without leaving the conversation

Extensible

Connect to databases, APIs, and external tools via MCP

Claude Code vs Other AI Assistants

Feature Claude Code Cursor / Windsurf GitHub Copilot Web-based AI
Environment Terminal/CLI + IDE Custom IDE (VS Code fork) IDE Plugin Browser
File System Access Full read/write Full read/write Read only None
Command Execution Full terminal access Integrated terminal Limited No
Git Operations Full support (commits, PRs) Basic support None None
External Integrations MCP servers (open standard) Built-in tools only Limited None
Context Window 200K tokens Varies by model Limited Varies
Subagents/Parallel Up to 7 parallel agents Single agent No No
Model Choice Claude (Opus/Sonnet/Haiku) Multiple (GPT-4, Claude, etc.) GPT-4 based Varies
Pricing $20-200/mo or API $20-40/mo $10-19/mo Free-$20/mo

2 Installation & Setup

According to the Claude Code getting started guide, the recommended installation method is using the native binary installer, which provides the most stable experience.

System Requirements

Requirement Specification
Operating Systems macOS 13.0+, Ubuntu 20.04+/Debian 10+, Windows 10+ (WSL or Git Bash)
RAM 4GB minimum (8GB+ recommended)
Node.js 18+ (only for deprecated NPM installation)
Network Stable internet connection required
Shell Bash or Zsh (recommended)

Installation Methods

macOS / Linux / WSL (Recommended)

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

Windows PowerShell

irm https://claude.ai/install.ps1 | iex

Alternative Methods

brew install --cask claude-code

Homebrew (macOS) - Does not auto-update

winget install Anthropic.ClaudeCode

WinGet (Windows) - Does not auto-update

Note: NPM installation (npm install -g @anthropic-ai/claude-code) is deprecated. Use the native binary installer for the best experience.

Authentication Setup

After installation, run claude to start the authentication process. Claude Code supports multiple authentication methods:

1
Claude Pro/Max Subscription (Recommended)

Subscribe to Claude's Pro ($20/mo) or Max ($100-200/mo) plan for unified billing

2
Claude Console (API Billing)

Connect through Claude Console with OAuth for pay-as-you-go API usage

3
Teams/Enterprise

Centralized billing and team management for organizations

4
Cloud Providers

Configure with Amazon Bedrock, Google Vertex AI, or Microsoft Foundry

Verify Installation

# Check installation
claude doctor

# Start Claude Code
claude

# Start with initial prompt
claude "explain this codebase"

# Resume last conversation
claude -c

Configuration Files

File Location Purpose
~/.claude/settings.json Home directory User-level settings
.claude/settings.json Project root Project-specific settings (shared with team)
.claude/settings.local.json Project root Per-machine overrides (gitignored)
~/.claude.json Home directory MCP server configurations
.mcp.json Project root Project-scoped MCP servers

3 Core Features & Commands

Claude Code provides a rich set of slash commands that enable powerful interactions. Here are the essential commands every user should know.

Essential Slash Commands

Command Description Use Case
/help Show all available commands Discover features
/init Scan project and create CLAUDE.md Bootstrap new projects
/clear Clear conversation history Start fresh context
/compact Summarize conversation to save context Long sessions
/memory Edit CLAUDE.md memory files Configure project context
/config Open configuration interface Change settings
/model Switch between Claude models Opus/Sonnet selection
/cost Check current token usage Monitor spending
/mcp Manage MCP server connections External integrations
/rewind Rewind to previous checkpoint Undo changes
/export Export conversation to file Save sessions

Keyboard Shortcuts

Pro Tip: Master these keyboard shortcuts to work efficiently with Claude Code.
Shortcut Action
Escape Stop Claude's current response (not Ctrl+C which exits)
Escape + Escape Open rewind menu / navigate previous messages
(Up Arrow) Navigate through past chats
Ctrl + V Paste images (not Cmd+V on macOS)
Tab Autocomplete file paths and commands

File References with @

Use the @ symbol to reference files directly in your prompts:

# Reference specific files
> Analyze @src/auth.ts and suggest improvements

# Compare multiple files
> Compare @package.json with @package-lock.json

# Reference directories
> Explain the architecture in @src/components/

# Reference with line ranges (VS Code)
> Fix the bug in @src/utils.ts:42-58

Checkpointing & Recovery

Claude Code automatically tracks file edits, allowing you to undo changes. Access the checkpointing feature by pressing Escape twice or using /rewind.

Make Changes
Claude edits files
Auto-saved checkpoint
Rewind
Press Esc+Esc or /rewind
Select restore point
Restore
Choose what to restore
Code, conversation, or both
Important: Bash commands (rm, mv, cp) are NOT tracked by checkpointing. Only edits through Claude's file editing tools are captured.

4 File Operations

Claude Code provides specialized tools for file operations that are more reliable than bash commands. Understanding these tools helps you work more effectively.

Built-in File Tools

Read

Read file contents with line numbers, supports images and PDFs

Write

Create or overwrite entire files

Edit

Make targeted string replacements in existing files

Glob

Search for files by pattern (e.g., **/*.ts)

Grep

Search file contents with regex patterns

Bash

Execute shell commands for system operations

When to Use Each Tool

Task Recommended Tool Why
View file contents Read Better than cat, includes line numbers
Create new file Write Safer than echo/cat with heredoc
Modify specific lines Edit Precise replacement, tracked by checkpoints
Find files by name Glob Faster than find command
Search in file contents Grep Regex support, better output format
Run git/npm/system commands Bash Terminal operations that need shell

Example Workflows

# Find all TypeScript files
> Find all .ts files in the src directory

# Search for function definitions
> Search for "function authenticate" in the codebase

# Read and analyze a file
> Read @src/auth/login.ts and explain the authentication flow

# Create a new component
> Create a new React component called UserProfile in src/components/

5 MCP (Model Context Protocol)

The Model Context Protocol (MCP) is an open standard introduced by Anthropic that allows Claude Code to connect to external tools, databases, and APIs without custom integrations.

What is MCP?

MCP Transport Types

Transport Use Case Example
HTTP Remote servers (recommended) Notion, GitHub, Sentry
Stdio Local processes PostgreSQL, Airtable
SSE Legacy (deprecated) Older integrations

Adding MCP Servers

HTTP Server (Recommended)

# Add Notion integration
claude mcp add --transport http notion https://mcp.notion.com/mcp

# Add GitHub integration
claude mcp add --transport http github https://api.githubcopilot.com/mcp/

# Add Sentry integration
claude mcp add --transport http sentry https://mcp.sentry.dev/mcp

Local Stdio Server

# Add PostgreSQL database
claude mcp add --transport stdio db -- npx -y @bytebase/dbhub --dsn "postgresql://user:pass@host/db"

# Add Airtable
claude mcp add --transport stdio --env AIRTABLE_API_KEY=YOUR_KEY airtable -- npx -y airtable-mcp-server

Managing MCP Servers

claude mcp list

List all configured MCP servers

claude mcp get <name>

Get details of a specific server

claude mcp remove <name>

Remove an MCP server

/mcp

Check MCP status within Claude Code

MCP Installation Scopes

Scope Storage File Purpose
local (default) ~/.claude.json Private to you, current project only
project .mcp.json Shared with team via version control
user ~/.claude.json Available across all your projects

Popular MCP Integrations

GitHub

PR reviews, issue management, code search

Notion

Read/write pages, search databases

PostgreSQL

Query databases, schema exploration

Sentry

Error tracking, issue analysis

Figma

Design system access, component info

Slack

Channel access via Zapier MCP

Context Management: Don't enable all MCPs at once. Your context window can shrink from 200K to 70K with too many tools. Keep under 10 MCPs enabled with under 80 tools active.

6 Agents & Subagents

According to Anthropic's subagents documentation, subagents are specialized AI assistants that operate independently for specific tasks, enabling parallel execution and isolated context management.

What Are Subagents?

Built-in Subagent Types

Subagent Purpose Characteristics
Explore File discovery, code search, codebase exploration Fast, read-only, perfect for research
Plan Codebase research for implementation planning Used in plan mode, architectural decisions
General-purpose Complex multi-step tasks Both exploration and modification
Bash Command execution specialist Git operations, builds, tests

The Task Tool

The Task tool is how Claude delegates work to subagents. It can run up to 7 agents simultaneously for operations like:

How Subagents Work

Main Claude
Receives your request
"Analyze this codebase"
Task Tool
Spawns subagents
Up to 7 parallel agents
Subagents
Execute independently
Explore, search, analyze
Results
Combined response
Synthesized findings

Creating Custom Subagents

You can create custom subagents by placing files in the .claude/agents/ directory:

# Create agents directory
mkdir -p .claude/agents

# View available subagents
/agents

# Create new subagent with guided setup
/agents create
Best Practice: Use subagents for read-heavy operations. They primarily handle file reads and searches to avoid conflicts when multiple agents might try to modify the same file.

7 Git Workflows

Claude Code has deep Git integration that makes version control seamless. According to the Git workflow documentation, you can manage branches, commits, and pull requests directly through natural language.

Common Git Operations

# Create and switch to a new branch
> Create a branch feature/rate-limiting and switch to it

# Implement a feature
> Implement rate limiting on auth endpoints

# Run tests
> Run the tests

# Commit changes
> Commit these changes

# Push and create PR
> Push and create a PR to main with a summary of changes

Pull Request Creation

Claude Code uses the gh CLI for GitHub operations. When you ask Claude to create a PR, it will:

1
Analyze Commits

Review all commits in the branch to understand changes

2
Generate Description

Create a comprehensive PR description with summary and test plan

3
Create PR

Execute gh pr create with proper formatting

4
Return URL

Provide the PR link for review

GitHub Actions Integration

Claude Code can be integrated with GitHub Actions for automated workflows:

# Install GitHub App
/install-github-app

Once installed, you can:

Git Worktrees for Parallel Work

Git worktrees allow checking out multiple branches in separate directories while sharing Git history. This is useful for parallel development tasks where you need to work on multiple features simultaneously.

Pro Tip: Configure your team's Git conventions in CLAUDE.md, including branch naming (e.g., feature/TICKET-123-description), commit message format, and common commands.

Commit Best Practices

Claude Code naturally respects Conventional Commits format:

# Good commit message format
feat: add rate limiting to auth endpoints
fix: resolve memory leak in connection pool
docs: update API documentation
refactor: simplify authentication flow
test: add unit tests for user service

8 Advanced Configuration

Claude Code offers extensive configuration options through settings files, hooks, and custom commands. Understanding these enables powerful automation and team-wide conventions.

Settings Hierarchy

Settings apply in order of precedence (higher overrides lower):

1
Managed Settings

Organizational policies (highest priority)

2
Project Shared Settings

.claude/settings.json - Team conventions

3
Project Local Settings

.claude/settings.local.json - Machine-specific

4
User Settings

~/.claude/settings.json - Personal defaults

Sample Local Settings (Whitelist MCP & Git)

Here's a sample .claude/settings.local.json file that whitelists MCP tools and common Git operations for uninterrupted workflow:

{
  "permissions": {
    "allow": [
      "Bash(git status)",
      "Bash(git add *)",
      "Bash(git commit *)",
      "Bash(git push *)",
      "Bash(git pull *)",
      "Bash(git checkout *)",
      "Bash(git branch *)",
      "Bash(git merge *)",
      "Bash(git log *)",
      "Bash(git diff *)",
      "Bash(gh pr *)",
      "Bash(gh issue *)",
      "Bash(npm *)",
      "Bash(npx *)",
      "Bash(yarn *)",
      "Bash(pnpm *)",
      "mcp__notion__*",
      "mcp__github__*",
      "mcp__postgres__*",
      "mcp__sentry__*"
    ],
    "deny": [
      "Bash(rm -rf /)",
      "Bash(sudo *)",
      "Bash(chmod 777 *)"
    ]
  },
  "enableAllProjectMcpServers": true
}
Pro Tip: Use wildcards (*) in permission patterns to allow variations of commands. For example, Bash(git commit *) allows git commit -m "message" and all other commit variations.

Hooks

Hooks allow you to run custom commands before or after Claude's tool execution. According to the hooks documentation, available hook events include:

Hook Event Description Use Case
PreToolUse Before tool execution Validation, logging
PostToolUse After tool completion Formatting, cleanup
SessionStart At session startup Environment setup
UserPromptSubmit When prompt is submitted Input processing
Notification When Claude sends notifications Alerts, logging
Stop When Claude finishes responding Post-processing

Example Hook Configuration

{
  "hooks": {
    "SessionStart": [{
      "matcher": "startup",
      "hooks": [{
        "type": "command",
        "command": "echo 'conda activate myenv' >> "$CLAUDE_ENV_FILE""
      }]
    }],
    "PostToolUse": [{
      "matcher": "Write",
      "hooks": [{
        "type": "command",
        "command": "prettier --write "$CLAUDE_FILE_PATH""
      }]
    }]
  }
}

Custom Slash Commands

Create custom slash commands by adding markdown files to .claude/commands/:

# Create commands directory
mkdir -p .claude/commands

# Create a custom command
echo "Analyze this code for performance issues and suggest optimizations:" > .claude/commands/optimize.md

# Now you can use /optimize in Claude Code

Skills Structure

For more complex custom behaviors, create skills in .claude/skills/:

.claude/skills/
├── SKILL.md          # Main instructions (required)
├── templates/        # Templates for Claude to fill
├── examples/         # Expected output examples
└── scripts/          # Executable scripts

Memory Management with CLAUDE.md

CLAUDE.md files provide persistent context that Claude remembers across sessions. The memory system uses a hierarchy:

File Location Scope Purpose
~/.claude/CLAUDE.md Global Personal preferences across all projects
/project/CLAUDE.md Project Project conventions, shared with team
/project/src/CLAUDE.md Directory Directory-specific context
/project/CLAUDE.local.md Personal Machine-specific, gitignored
Quick Memory Pattern: Prefix any instruction with # to add it to memory instantly. Example: # Always use 2-space indentation

9 IDE Integrations

Claude Code integrates with popular IDEs to provide a seamless development experience. The VS Code extension is the most feature-rich integration.

VS Code Extension

Installation

1
Open VS Code

Launch Visual Studio Code

2
Open Extensions

Press Cmd+Shift+X (Mac) or Ctrl+Shift+X (Windows/Linux)

3
Search & Install

Search "Claude Code" and click Install

Key VS Code Features

Inline Diffs

See real-time changes in the sidebar before accepting

Auto-Accept Mode

Let Claude make edits without confirmation prompts

Line Range References

Reference specific lines with @file.ts:42-58

Multiple Conversations

Open multiple Claude conversations in tabs

Permission Modes

Mode Behavior Best For
Normal Claude asks permission for each action Learning, careful editing
Plan Claude describes plan and waits for approval Complex changes
Auto-Accept Claude makes edits without asking Experienced users, trusted workflows

JetBrains Integration

Claude Code supports the entire JetBrains family including IntelliJ IDEA, PyCharm, WebStorm, and more:

1
Open JetBrains Marketplace

Go to Settings → Plugins → Marketplace

2
Search & Install

Search "Claude Code" plugin

3
Configure

Set up authentication and preferences

CLI to IDE Connection

Connect your terminal Claude session to VS Code:

# Connect to VS Code from external terminal
/ide

10 Best Practices & Tips

Based on Anthropic's best practices guide, here are proven strategies for getting the most out of Claude Code.

Performance Optimization

Use /clear Frequently

Clear context when switching tasks to maintain performance

Use /compact

Summarize long conversations to save context window

Delegate to Subagents

Use Task tool for verbose operations like tests and logs

Be Specific

Avoid vague requests; provide clear, detailed prompts

Cost Management

Strategy Implementation Impact
Monitor usage Use /cost command Track spending in real-time
Reduce thinking tokens MAX_THINKING_TOKENS=8000 Lower costs for simple tasks
Use Sonnet for most tasks /model sonnet 40% cost reduction vs Opus
Reserve Opus for complex work Architectural decisions only Optimize cost/quality tradeoff

Subscription Options

Recommendation: Claude Max ($100-200/month) provides unlimited usage and is recommended for heavy users. A hybrid approach using subscriptions for interactive work and API for automation can also be cost-effective.

Security Best Practices

Sandbox Mode

Enable sandbox mode for enhanced security:

/sandbox

Benefits of sandboxing:

Security Recommendations

1
Minimum Permissions

Only grant the permissions Claude actually needs

2
Use Deny Rules

Restrict network commands with explicit deny rules

3
External Scanning

Implement SAST/DAST scanning in your pipeline

4
Never Bypass in Production

Keep permission modes active in production environments

Effective Prompting Tips

Pro Tips for Better Results:
  • Use file references (@file.ts) instead of pasting code
  • Be explicit about what you want: "Refactor for readability" vs "Fix this"
  • Provide context: "This is a React component that handles..."
  • Break complex tasks into smaller steps
  • Use /init to bootstrap project context

Running Claude Uninterrupted (Auto-Accept Mode)

For experienced users who want Claude to work autonomously without confirmation prompts, there are several ways to enable uninterrupted execution:

Method 1: Dangerously Skip Permissions (CLI Flag)

# Start Claude with auto-accept all permissions
claude --dangerously-skip-permissions

# Shorter alias
claude -y
Warning: This mode bypasses all safety prompts. Only use in trusted environments and never in production systems.

Method 2: Allowlist Specific Commands

A safer approach is to pre-approve specific commands in your settings file:

// .claude/settings.local.json
{
  "permissions": {
    "allow": [
      "Bash(git *)",
      "Bash(npm run *)",
      "Bash(npx *)",
      "Read",
      "Write",
      "Edit",
      "Glob",
      "Grep"
    ]
  }
}

Method 3: VS Code Auto-Accept Mode

In the VS Code extension, you can enable auto-accept mode from the settings:

1
Open Claude Code Panel

Click the Claude Code icon in VS Code sidebar

2
Click Settings Gear

Find the settings icon in the panel header

3
Enable Auto-Accept

Toggle "Auto-accept edits" to allow Claude to make changes without prompts

Method 4: Headless Mode for CI/CD

For automation pipelines, use headless mode with streaming output:

# Run Claude in headless mode (non-interactive)
claude -p "run tests and fix any failures" --output-format stream-json

# With auto-accept for full automation
claude -p "refactor auth module" -y --output-format json
Mode Flag/Setting Use Case Safety Level
Full Auto -y or --dangerously-skip-permissions Trusted local dev Low
Allowlist permissions.allow in settings Team environments Medium
VS Code Auto Auto-accept toggle IDE workflow Medium
Headless -p with -y CI/CD pipelines Low
Normal Default (no flags) Production, learning High

11 Frequently Asked Questions

Claude Code is Anthropic's official CLI tool that runs directly in your terminal, providing AI-powered coding assistance with deep file system access, Git integration, and MCP server connections. Unlike ChatGPT, it operates locally in your development environment with full context of your codebase, can read and write files, execute commands, and manage Git operations without leaving the conversation.

Install Claude Code using the native binary installer. On macOS/Linux, run curl -fsSL https://claude.ai/install.sh | bash. On Windows PowerShell, run irm https://claude.ai/install.ps1 | iex. You can also use Homebrew on macOS with brew install --cask claude-code. After installation, run claude doctor to verify your setup.

MCP (Model Context Protocol) is an open standard by Anthropic that allows Claude Code to connect to external tools, databases, and APIs. It eliminates custom integrations by providing a standardized way to add capabilities like Notion, GitHub, PostgreSQL, and Slack. You can add MCP servers using commands like claude mcp add --transport http notion https://mcp.notion.com/mcp.

Subagents are specialized AI assistants that operate independently for specific tasks. Claude Code has built-in subagents like Explore (for file discovery), Plan (for codebase research), and General-purpose (for complex multi-step tasks). They enable parallel execution of up to 7 agents simultaneously, dramatically speeding up complex workflows like codebase exploration and multi-file analysis.

Claude Code requires a Claude Pro ($20/month), Max ($100-200/month for unlimited usage), or Teams/Enterprise subscription. Alternatively, you can use pay-as-you-go API billing through the Claude Console. Claude Max is recommended for heavy users who want unlimited usage without worrying about token costs.

Related Reading

Continue your AI and development tools learning journey with these related guides from JZ Blog:

12 Abbreviations & Glossary

Abbreviations & Glossary

Reference guide for technical terms and abbreviations used throughout this article.

API - Application Programming Interface
CI/CD - Continuous Integration/Continuous Deployment
CLI - Command Line Interface
FAB - Floating Action Button
HTTP - Hypertext Transfer Protocol
IDE - Integrated Development Environment
JSON - JavaScript Object Notation
LLM - Large Language Model
MCP - Model Context Protocol
NPM - Node Package Manager
OAuth - Open Authorization
PR - Pull Request
RAM - Random Access Memory
REST - Representational State Transfer
SAST - Static Application Security Testing
SSE - Server-Sent Events
Stdio - Standard Input/Output
VS Code - Visual Studio Code
WSL - Windows Subsystem for Linux
Link copied to clipboard!
Previous Post
GA4 & Tealium Implementation for Salesforce B2C Commerce: Complete Guide 2026
Next Post
ClawdBot Complete Guide: Open-Source AI Assistant 2026
Archives by Year
2026 7 2025 16 2024 2 2023 9 2022 8 2021 4 2020 18 2019 16 2018 21 2017 34 2016 44 2015 54 2014 30 2013 31 2012 46 2011 114 2010 162
Search Blog

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from Jitendra Zaa

Subscribe now to keep reading and get access to the full archive.

Continue Reading