Post

The Complete Claude Code Guide - From Installation to Advanced Usage Strategies

The Complete Claude Code Guide - From Installation to Advanced Usage Strategies
Visitors


What Is Claude Code?

Claude Code is an agentic coding tool developed by Anthropic. It runs directly in the terminal (CLI) and can handle almost every development task through natural language, including writing code, refactoring, debugging, and git operations.

Its biggest difference from existing AI coding assistants (Copilot, Cursor, etc.) is that it understands the entire project as context and works as an agent that can directly read and write the file system.



I. Installation (macOS)

StepCommandDescription
1brew install --cask claude-codeInstall Claude Code with Homebrew
2claude --versionVerify installation and check version

Method 2: Install via npm

StepCommandDescription
1node --versionVerify Node.js 18.0+
2npm install -g @anthropic-ai/claude-codeGlobal install via npm
3claude --versionVerify installation

If Node.js is not installed, use the LTS version from the official site or install it with brew install node.



II. Initial Setup

1. Sign In

After installation, sign in from the terminal.

1
claude login

When your browser opens, sign in with your Anthropic account and choose the CLI tool type.

2. Check Token Usage

You can check current usage at https://claude.ai/settings/usage.

What is a token? A token is the minimum unit an LLM processes. Roughly, English is about 1 word = 1.3 tokens, while Korean is about 1 character = 2-3 tokens. Claude Code consumes both input tokens (prompt + context) and output tokens (response).



You can use it directly from terminal, but using it with an IDE is strongly recommended. You can inspect code changes in real time, which is much more efficient.

  1. Install VS Code
  2. Open your project folder with Open Folder
  3. Open Terminal > New Terminal
  4. Run claude in that terminal
1
2
3
# Run from your project directory
cd /path/to/your/project
claude

At startup, Claude Code automatically reads CLAUDE.md in your project root to understand architecture, coding conventions, and workflow. That context improves relevance and accuracy.

JetBrains (Rider, IntelliJ, etc.)

You can run claude from the built-in terminal in JetBrains IDEs as well. Personally, I found VS Code terminal UX better.



IV. Complete Reference of Core Commands

Session Management Commands

CommandFunctionDescription
claudeStart Claude CodeStart a new session in the current directory
claude -c / claude --continueContinue latest sessionContinue from the last conversation
claude -r / claude --resumeResume previous conversationPick and resume from past sessions
claude --verboseVerbose modeShow detailed logs useful for debugging
claude --dangerously-skip-permissionsSkip permission checksAuto-allow all file access and execution (caution)

Slash Commands Inside a Session

CommandFunctionDetailed Description
/clearReset contextStart a new conversation. Most important command. Having enough context window reduces hallucination risk. Use /clear per task.
/compactCompress conversationSummarize/compact chat to free context. You can target specific content, e.g. /compact core points.
/modelSwitch modelChoose Opus, Sonnet, etc. A practical pattern is Opus for planning, Sonnet for implementation.
/resumeResume old conversationLoad past conversations.
/configManage settingsAdjust verbose, model, todo list, and more.
/memoryEdit CLAUDE.mdEdit project/global CLAUDE.md directly.
/initInitialize projectClaude analyzes the project and generates CLAUDE.md automatically.
/terminal-setupConfigure terminal line breaksEnable line breaks via Shift+Enter.
/pluginPlugin managementExplore, install, and remove plugins.
/agentsAgent managementInspect and manage custom agents.
/mcpMCP server managementConfigure Model Context Protocol servers.
/statuslineStatus line settingsConfigure terminal status line display.
/todosView todo listCheck the current task list.
/permissionsPermission managementConfigure pre-approval rules for bash commands, etc.
/insightsUsage pattern analysisAnalyze the last 30 days of sessions and generate an HTML report with patterns, bottlenecks, and workflow suggestions.
/fastToggle Fast modeSwitch fast output mode. Shows lightning icon (↯), persisted across sessions.

Update Commands

1
2
3
4
5
# Update Claude Code (npm install)
claude update

# If installed via Homebrew
brew upgrade claude-code

Special Features

FeatureHow to UseDescription
File reference@filenameAdd @ to reference files directly, e.g. @GameHandler.cs.
Image attachDrag & drop / Cmd+Shift+4 then pasteAdding screenshots/UI designs gives visual context and significantly boosts efficiency. Official docs also recommend image usage.
RewindTap Esc twiceStop current conversation and roll back to a checkpoint. You can choose conversation/code/conversation+code. Very useful when hallucination appears.
Mode switchShift+TabSwitch between Plan mode / Auto-accept mode / default mode.
Thinking toggleTabToggle Extended Thinking mode on/off. Setting persists across sessions.
Add memory# keyQuickly add memory content to CLAUDE.md (e.g. “remember this rule”).



V. Latest Features (v2.1.x, as of February 2026)

Major additions in Claude Code v2.1.x:

1. /insights - Usage Pattern Analysis Report

/insights analyzes the last 30 days of session data and generates an interactive HTML report.

1
2
# Run inside a Claude Code session
/insights

Data analyzed:

  • Session logs in ~/.claude/ (prompts + Claude responses)
  • Tool usage patterns, error patterns, interaction patterns
  • Source code itself is not analyzed (privacy preserved)

Report contents:

ItemDescription
Usage statsNumber of messages, sessions, and file edits
Project breakdownWhat kind of work you did in each project
Tool usage patternsCharts showing most-used tools
Language usageWhich programming languages you worked in
BottlenecksPatterns that reduce productivity
Improvement suggestionsPersonalized suggestions, custom skill recommendations, and hook recommendations that can be copied into CLAUDE.md

The report is saved to ~/.claude/usage-data/report.html and opened automatically in your browser.

Suggestions in /insights include a Copy button, so you can paste directly into CLAUDE.md. This is highly useful because the optimization guidance is personalized from your own usage patterns.

2. Extended Thinking & Effort System

Claude Code supports Extended Thinking, where Claude performs deeper internal reasoning before replying, greatly improving accuracy on complex problems.

How to toggle Thinking:

MethodDescription
Tab keyToggle Thinking mode on/off instantly in session
/configEnable/disable Thinking from settings
Environment variable MAX_THINKING_TOKENS=8000Set Thinking token budget directly (minimum 1,024)

Effort levels (Opus 4.6 only):

You can set Effort level when choosing a model via /model. It controls how deeply Claude reasons.

EffortUse CaseToken UsageRecommended For
LowFast response, simple tasksLowSimple classification, quick lookup, batch processing
MediumBalanced performanceMediumGeneral coding tasks
High (default)Best reasoning qualityHighComplex reasoning, difficult coding tasks
MaxAbsolute best performanceHighestExtremely complex architecture analysis, multi-step reasoning
1
2
3
4
5
6
# Set Effort level via environment variable
CLAUDE_CODE_EFFORT_LEVEL=high claude

# Or change from /model in-session
/model
# -> choose model, then adjust Effort slider

Adaptive Thinking: On Opus 4.6, Adaptive Thinking is recommended over manually setting budget_tokens. Claude adjusts reasoning depth dynamically based on prompt complexity. Effort level controls that range.

3. Fast Mode

Fast mode keeps the same model but can increase output token generation speed by up to 2.5x. It is not a model switch; it uses a faster inference path on the same model.

1
2
3
4
5
# Toggle inside session
/fast

# Lightning icon (↯) appears when enabled
# Setting persists across sessions

Fast mode uses premium pricing ($30/$150 per MTok). It is useful for rapid iteration in prototyping, but choose it selectively with cost in mind.

4. Agent Teams (Research Preview)

Agent Teams lets multiple Claude Code instances collaborate as a team. One orchestrator coordinates the whole task while sub-agents process different parts in parallel.

1
2
3
4
5
6
7
8
9
┌─────────────────────────────┐
│      Orchestrator (Leader) │
│  Coordinates and dispatches │
└──────┬──────┬──────┬────────┘
       │      │      │
  ┌────▼──┐ ┌─▼───┐ ┌▼─────┐
  │Agent 1│ │Agent2│ │Agent3│
  │Backend│ │Front │ │Tests │
  └───────┘ └─────┘ └──────┘
  • Each sub-agent runs in its own tmux pane
  • Independent work runs in parallel to speed up large tasks
  • Currently in research preview (subject to change)

5. Auto Memory

Claude Code can automatically remember context across sessions. It runs in the background without manual setup.

How it works:

IndicatorMeaning
Recalled X memoriesLoaded memories from previous sessions at startup
Wrote X memoriesSaved snapshot of current work during session
  • Automatically stores project patterns, key commands, and user preferences
  • Saved at ~/.claude/projects/<project-hash>/<session-id>/session-memory/summary.md
  • Press # to quickly add memory to CLAUDE.md

Auto Memory is separate from CLAUDE.md. CLAUDE.md is explicit, user-managed rules; Auto Memory is implicit context extracted by Claude. Using both together is most effective.

6. Opus 4.6 & 1M Token Context (Beta)

The latest model, Claude Opus 4.6, supports a 1M-token context window in beta.

FeatureDescription
1M token context5x larger than 200K. Enables full analysis of large codebases in one pass
Adaptive ThinkingDynamically adjusts reasoning depth by task complexity
Context CompactionSummarizes old context in long sessions to push past limits
Agent TeamsSupports multi-agent collaboration

7. Model Comparison (as of February 2026)

ModelContextSpeedReasoningCostRecommended Use
Opus 4.6200K (1M beta)MediumBestHighArchitecture design, complex refactoring, Plan mode
Opus 4.6 Fast200K (1M beta)Fast (2.5x)BestVery HighRapid prototyping, iterative work
Sonnet 4.5200KFastStrongMediumGeneral implementation, coding, debugging
Haiku 4.5200KVery FastGoodLowSimple tasks, bulk processing

Hybrid strategy: Plan with Opus (/model -> Opus), implement with Sonnet (/model -> Sonnet). This opusplan pattern can reduce costs by 60-80% versus using Opus for everything.



VI. Deep Dive: Context Window

To use Claude Code effectively, understanding the context window is essential.

What Is the Context Window?

The context window is the maximum token size an LLM can process at once. For Claude models:

ModelContext WindowCharacteristics
Claude Opus 4.6200K (1M beta)Strongest reasoning, ideal for complex architecture analysis
Claude Sonnet 4.5200K tokensFaster response, efficient for general coding

How large is 200K tokens? Roughly 150,000 English words, around 300 A4 pages. In practice, code and Korean are less token-efficient, so usable size is smaller. 1M tokens is about 5x that, roughly 1,500 A4 pages.

Why Context Window Matters

LLMs are stateless per request. A new chat with Claude Code is like working with a new teammate every time. Earlier information is remembered only if it stays inside the current context window.

1
2
3
[System Prompt] + [CLAUDE.md] + [Chat History] + [Current Prompt] = Total token usage
                                                                ↕
                                                      Context window limit

When context fills up:

  1. Auto-compact triggers and summarizes prior conversation
  2. Information loss/distortion can occur during summarization
  3. Existing plan context can disappear

Structural Issues with Auto-Compact

Once auto-compact runs, it is not reversible. Original conversation is permanently compressed, which can cause:

IssueDescription
Context distortionSummarization can alter the original meaning
Temporal context lossSequential context like “Based on A earlier, do B now” can disappear
Information fragmentationRelated information gets split, reducing reasoning quality

Auto-compact often summarizes a “middle segment” of the session. Instead of summarizing all of Phase 1, it may compress around Phase 1.2-1.5.

Context Management Strategies

1. Use manual /compact regularly

  • Do not rely only on auto-compact; run /compact at good checkpoints
  • You can target key content, e.g. /compact focused on current todo list and progress

2. Use /clear per task

  • Split large work into multiple sessions
  • Start each session with /clear for clean context

3. Use CLAUDE.md well

  • Put recurring project information into CLAUDE.md
  • It auto-loads each session and saves context budget

4. Reference external documents

  • Write complex plans in separate .md files and reference with @filename
  • Usually more efficient than keeping full plans directly in context



VII. Understanding the CLAUDE.md File

What Is CLAUDE.md?

CLAUDE.md is your project’s AI onboarding document. Like a new teammate reading project docs, Claude Code reads this file every session to understand your project.

What to Include in CLAUDE.md

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# CLAUDE.md

## Project Overview
- Project description, tech stack, architecture summary

## Build & Development Commands
- Build, test, and run commands

## Code Conventions
- Coding style, naming conventions, file structure

## Architecture
- Main directory structure, core module descriptions

## Common Patterns
- Frequently used patterns in this project
- “Do not do this” rules (prevent repeated Claude mistakes)

Memory Nesting

CLAUDE.md can be layered across multiple levels:

LocationScopePurpose
~/.claude/CLAUDE.mdGlobal (user-level)Rules shared across all projects
./CLAUDE.mdProject rootApplies to entire project
./src/CLAUDE.mdSubdirectoryApplies only to specific modules/directories

Do not use /init output as-is forever. Add your real code conventions, design direction, and recurring mistakes yourself, then keep improving it.



VIII. Plan & Execute Workflow

Core Principle

The key to effective Claude Code usage is clearly separating Plan and Execute phases.

Model Selection Strategy

PhaseRecommended ModelWhy
PlanningOpusBetter for complex reasoning, architecture analysis, strategy
ImplementationSonnetFaster, cost-efficient, great for direct coding work
1
2
3
4
5
1. /model -> select Opus
2. Press Shift+Tab twice -> enter Plan mode
3. Build plan and todo list
4. /model -> switch to Sonnet
5. Implement code step by step

Plan-Mode Workflow

Step 1: Explore and plan

Start in Plan mode (Shift+Tab twice):

  • Build implementation strategy
  • Break work into independently testable steps
  • Estimate effort/time
  • Include UI/library decisions

Detailed prompting matters. For example: “Break implementation into step-by-step tasks. Each step must be independently testable, and estimate time for each.”

Step 2: Finalize plan and execute

Once the plan is satisfactory:

  1. Press Shift+Tab to switch to Auto-accept edits mode
  2. Let Claude execute one-shot implementation following the plan

Advantages of Plan mode:

AdvantageDescription
Context continuityPlan-mode todo list persists even in long sessions, preserving task continuity
Dynamic updatesYou can revise the plan immediately if gaps appear during implementation
Lower hallucination riskClear plan prevents drifting in wrong directions

When possible, maintain a checklist .md file for the current task and keep it updated continuously.

Using a PRD (Product Requirements Document)

A simple todo plan is fine, but for large-scale work or refactoring, a PRD is more effective.

Include in PRD:

  • Goal and background: why this work is needed
  • Requirements: functional and non-functional
  • Scope: included/excluded items
  • Design direction: architecture decisions
  • Success criteria: completion conditions



IX. Safety & Control

Understanding Permission Modes

ModeDescriptionWhen to Use
Default modeRequires approval for file edits and command executionCritical projects, learning phase
Auto-acceptFile edits auto-approvedExecution phase after plan is finalized
dangerously-skip-permissionsAuto-approves all permissionsRecommended only in sandboxed environments

Fine-Grained Control with /permissions

Instead of --dangerously-skip-permissions, it is recommended to pre-allow only safe, frequently used commands via /permissions.

1
2
# Saved in .claude/settings.json and can be shared with team
# Example: pre-allow git, npm, and build commands

Safe Usage Principles

  1. Start in approval mode and review actions one by one
  2. Switch to Auto-accept only after plan is finalized
  3. If implementation diverges, roll back with Esc twice (Rewind)
  4. If the plan is wrong, revise the plan itself



X. 13 Advanced Usage Tips (Creator Workflow)

Practical tips directly shared by Claude Code’s creator.

1. Build a parallel execution environment

Run five Claude sessions in parallel in terminal. Label tabs 1-5, and use system notifications to know when input is needed.

2. Run web and local in parallel

  • Run 5-10 additional Claude sessions in parallel on claude.ai/code
  • Handoff local sessions to web (&) or switch bidirectionally with -teleport
  • Start sessions from iOS app and check later

3. Model choice: Opus with thinking

  • Use Opus 4 with thinking for all work
  • Bigger/slower than Sonnet, but requires less steering and has stronger tool use
  • In practice, often reaches final outcomes faster than smaller models

4. Accumulate team knowledge with CLAUDE.md

  • Maintain one shared CLAUDE.md for the whole team
  • Check it into git; team contributes multiple times weekly
  • Add guidance whenever Claude behaves incorrectly to prevent repeat mistakes

5. Update CLAUDE.md during code review

  • In peer PR reviews, tag @.claude to add updates into CLAUDE.md
  • Use Claude Code GitHub Action (/install-github-action)

6. Plan mode + auto-accept workflow

  • Start most sessions in Plan mode (Shift+Tab twice)
  • Iterate until plan quality is high
  • Switch to Auto-accept mode to finish in one shot
  • Good planning is critical

7. Automate repetitive loops with slash commands

  • Use slash commands for each frequent inner-loop workflow
  • Store them in .claude/commands/ and check into git
  • Example: use /commit-push-pr dozens of times daily
  • Use inline bash to precompute git status, reducing unnecessary model round trips

8. Use sub-agents

Use several sub-agents regularly:

  • code-simplifier: simplify code after implementation
  • verify-app: detailed instructions for end-to-end testing

9. Auto-format with PostToolUse hooks

  • Use PostToolUse hooks to automate formatting
  • Claude usually produces well-formatted code already; hooks handle the remaining 10%

10. Permission management style

  • Do not use --dangerously-skip-permissions
  • Instead, pre-allow safe bash commands via /permissions
  • Check .claude/settings.json into git for team sharing

11. Integrate external tools

Let Claude Code operate external tools:

  • Search and post to Slack (via MCP)
  • Run BigQuery queries (bq CLI)
  • Pull error logs from Sentry
  • Check .mcp.json into git and share MCP setup across team

12. Handling long-running tasks

For very long jobs, choose one of these:

13. Most important tip: verification feedback loop

The single most important factor for great Claude Code results: provide Claude with a way to verify the work.

With this feedback loop, final output quality can improve by 2-3x:

  • Verify results via bash commands
  • Run test suites
  • Test app in browser/simulator
  • Test UI with Chrome extension

Investing in robust verification loops has the highest ROI.



XI. SDD (Spec-Driven Development)

What Is SDD?

SDD (Spec-Driven Development) moves beyond “telling Claude what to do” and lets AI implement and test against team-shared technical specs.

Core value of SDD:

  • Minimize context loss
  • Reduce hallucinations
  • Improve team collaboration efficiency

Install and Use Spec Kit

Spec Kit is a tool for SDD.

1
2
3
4
5
# Initialize Spec Kit
specify init --here
# -> type 'y'
# -> select 'claude'
# -> select 'sh'

After setup, run claude in a new session to access additional commands.

Spec Kit Workflow

CommandPhaseDescription
/speckit.constitutionRulesStandards based on CLAUDE.md, code rules, architecture
/speckit.specifyRequirementsWhat/Why focused, no tech stack
/speckit.clarifyClarificationFill missing spec details
/speckit.planPlanningDecide tech stack/architecture here
/speckit.tasksTask breakdownSplit into implementable units
/speckit.implementImplementationWrite actual code
/speckit.analyzeAnalysis (optional)Check consistency across documents
/speckit.checklistChecklist (optional)Quality checks

Guide for /speckit.specify

specify is for What/Why. Implementation details (How) belong in /speckit.plan.

WHAT (requirements)

  • User actions that must be possible
  • Rules the system must guarantee (validation/constraints/compatibility)
  • Deliverables (assets, prefabs, registration, test environment)
  • Success criteria (time constraints, legacy compatibility, etc.)

WHY (necessity)

  • Existing problems (bottlenecks, duplication, inconsistency, context loss)
  • Contribution to success metrics

Do not write these in specify (save for /plan)

  • “Inject a DI container into BaseWeapon…”
  • “Create BulletRecipe as a ScriptableObject…”
  • “Optimize with ECS…”



XII. Using Plugins

How to Install Plugins

1
2
3
4
5
6
7
8
9
10
# Start Claude Code
claude

# Download from marketplace
/plugin marketplace add wshobson/agents

# Install selected plugins
/plugin install game-development
/plugin install debugging-toolkit
/plugin install code-refactoring

The wshobson/agents repository includes many optimized agents for orchestration workflows.

How Plugins Work

Installed plugins are used automatically by context:

  • Automatic activation: relevant agent runs based on task
    • After coding -> code-reviewer agent
    • On errors -> debugger agent
  • Explicit request: “Please review this code” -> code-reviewer activated
  • Context judgment: simple tasks may run without extra agents



XIII. Notes and Cautions

Unity Integration Limitations

Currently, there is no direct bridge between Claude Code and Unity Editor. Because of that, Claude may not always detect Unity editor error states precisely. Still, it performs strongly in logic analysis and code intent understanding.

A tool named Unity-MCP exists, but it may have security vulnerabilities. Perform security review before using it.

Caution When Using MCP Servers

When using MCP (Model Context Protocol) servers:

  • Verify the source is trustworthy
  • Review for security vulnerabilities
  • If used in team environments, manage with a whitelist



References

This post is licensed under CC BY 4.0 by the author.