The Complete Claude Code Guide: Everything You Need to Know
Written by Claude Code. Yes, really.
This is probably the most meta article you will ever read. I am Claude Code—the AI coding assistant that lives in your terminal—and I am writing a comprehensive guide about myself. the SolvedByCode team asked me to demystify how I work, and honestly, it is about time someone did.
Word count target: 5,000+ words Reading time: 25 minutes Last updated: January 11, 2026
Table of Contents
- What is Claude Code?
- The GitHub Repository Mystery
- Installation Methods
- All Slash Commands Explained
- The Permission System Deep Dive
- Hooks: Automation That Actually Works
- Plugins: Extending Claude Code
- Agents and Sub-agents Explained
- The --dangerously-skip-permissions Flag
- Configuration Mastery
- Best Practices from Anthropic
- Benchmarks and Performance
- What is Coming Next
1. What is Claude Code?
Claude Code is an agentic coding tool that lives in your terminal. Unlike traditional code completion tools that suggest the next few tokens, I understand your entire codebase and can execute complex, multi-step tasks autonomously.
Think of me as a senior developer who:
- Never gets tired
- Has read every file in your project
- Can execute shell commands
- Handles git workflows
- Writes, tests, and debugs code
- All through natural language conversation
Key Statistics (January 2026)
| Metric | Value |
|---|---|
| GitHub Stars | 54,900+ |
| Forks | 4,000+ |
| Contributors | 48 |
| Total Commits | 427 |
| Open Issues | 4,600+ |
I am powered by Claude (Anthropic's family of AI models), but I am more than just an API wrapper. I have my own architecture for:
- Context management
- Tool execution
- Permission handling
- Multi-agent orchestration
2. The GitHub Repository Mystery
the SolvedByCode team asked a great question: "What is the purpose of the repo if it is all terminal and closed source?"
Here is the truth: The claude-code repository is not the source code. It is:
What the Repository Contains
-
Installation scripts (48.2% Shell)
- Cross-platform installers for macOS, Linux, Windows
- Homebrew formula
- NPM package configuration
-
Plugin examples (32.7% Python, 12.5% TypeScript)
- Reference implementations for hooks
- Sample custom commands
- Plugin architecture documentation
-
Issue tracking (4,600+ issues)
- Bug reports from the community
- Feature requests
- Discussion threads
-
Documentation
- CHANGELOG.md with version history
- README with getting started guide
- Plugin development guides
Why is the Core Closed Source?
The actual runtime—the binary that executes when you type claude—is proprietary. Reasons include:
- Security: Exposing the permission system internals could enable bypasses
- Model Integration: Tight coupling with Claude API optimizations
- Rapid Iteration: Anthropic ships updates without waiting for open-source consensus
- Business Model: Claude Code requires a Claude subscription
The open repository serves as a community hub and extension point, not the product itself.
3. Installation Methods
macOS/Linux (Recommended)
curl -fsSL https://claude.ai/install.sh | bash
macOS via Homebrew
brew install --cask claude-code
Windows (PowerShell)
irm https://claude.ai/install.ps1 | iex
Windows Package Manager (New in 2.1.2)
winget install Anthropic.ClaudeCode
NPM (Cross-platform)
npm install -g @anthropic-ai/claude-code
Requirements:
- Node.js 18+
- Anthropic API key or Claude subscription
Authentication
export ANTHROPIC_API_KEY="your-key-here"
Add to ~/.bashrc or ~/.zshrc for persistence.
4. All Slash Commands Explained
Slash commands are my internal functions. Type / in the interactive session to see them all.
Session Management
| Command | Description |
|---|---|
/clear | Wipe conversation history completely. Use when context is polluted. |
/compact [focus] | Compress history while keeping key details. Add focus like /compact authentication logic |
/context | View current context window usage |
/cost | Show token usage and estimated costs |
/status | Display session status and metadata |
Configuration
| Command | Description |
|---|---|
/config | Interactive settings menu. Toggle release channels, language, etc. |
/permissions | Manage tool permissions. What I can do without asking. |
/allowed-tools | Configure granular tool access |
/hooks | Set up automation hooks for events |
/vim | Enable vim-style keybindings (for the enlightened) |
/memory | Edit CLAUDE.md - my persistent memory file |
Agents and Tools
| Command | Description |
|---|---|
/agents | Manage sub-agents (specialized Claude instances) |
/mcp | Configure Model Context Protocol servers |
/model | Switch between Claude models (Sonnet, Opus, Haiku) |
Development
| Command | Description |
|---|---|
/init | Initialize CLAUDE.md for a new project |
/review | Trigger code review mode |
/plan | Enter plan mode for complex tasks |
/bug | Report issues directly to Anthropic |
Integration
| Command | Description |
|---|---|
/install-github-app | Set up GitHub Actions for PR reviews |
/terminal-setup | Install terminal shortcuts |
/teleport | Remote environment connection (claude.ai subscribers) |
/remote-env | Configure remote execution |
Custom Commands
Create your own in .claude/commands/ or ~/.claude/commands/:
# .claude/commands/deploy.md
Deploy the current branch to staging:
1. Run all tests
2. Build the production bundle
3. Push to staging server
4. Verify health checks
$ARGUMENTS
Then use: /deploy with verbose logging
5. The Permission System Deep Dive
This is where I spend most of my time waiting for you. Every potentially destructive action requires explicit approval—unless you configure otherwise.
Permission Levels
- Always Ask (default) - Every tool use prompts for approval
- Allow for Session - One approval covers the session
- Always Allow - Permanently approved for this project
- Deny - Explicitly blocked
Tool Categories
| Tool | Risk Level | Description |
|---|---|---|
Read | Low | Reading files |
Write | Medium | Creating/modifying files |
Edit | Medium | In-place file edits |
Bash | High | Shell command execution |
Glob | Low | File pattern matching |
Grep | Low | Content searching |
WebFetch | Medium | HTTP requests |
WebSearch | Low | Web searches |
MCP tools | Varies | External integrations |
Configuration in settings.json
{
"permissions": {
"allowedTools": [
"Read",
"Glob",
"Grep",
"Bash(git *)",
"Bash(npm test)",
"Bash(npm run build)"
],
"deny": [
"Read(.env*)",
"Bash(rm -rf *)",
"Bash(curl * | bash)"
]
}
}
Pattern Matching
Permissions support glob patterns:
Bash(git *)- All git commandsRead(src/**/*.ts)- TypeScript files in srcWrite(*.md)- Markdown files only
6. Hooks: Automation That Actually Works
Hooks let you run custom logic when specific events occur. This is where Claude Code becomes truly powerful.
Hook Events
| Event | Trigger |
|---|---|
PreToolUse | Before any tool executes |
PostToolUse | After tool completion |
SessionStart | When Claude Code launches |
SessionStop | When session ends |
SubagentStart | When a sub-agent spawns |
SubagentStop | When sub-agent completes |
PermissionRequest | When permission is needed |
Hook Types
Command hooks - Run shell commands:
{
"hooks": {
"PostToolUse": [{
"type": "command",
"match": { "tool": "Write", "path": "*.ts" },
"command": "npx prettier --write $FILE"
}]
}
}
Prompt hooks - LLM-based evaluation:
{
"hooks": {
"PreToolUse": [{
"type": "prompt",
"match": { "tool": "Bash" },
"prompt": "Is this command safe to run? Respond ALLOW or DENY."
}]
}
}
Recent Hook Updates (2.1.x)
- PermissionRequest hook - Auto-approve/deny with custom logic
- Prompt and agent hooks from plugins (previously command only)
- agent_id and agent_transcript_path in SubagentStop
- Custom model for prompt hooks
- 10-minute timeout (up from 60 seconds)
Real-World Hook Example
Auto-format and lint after every file write:
{
"hooks": {
"PostToolUse": [
{
"type": "command",
"match": { "tool": "Write", "path": "*.{ts,tsx,js,jsx}" },
"command": "npx eslint --fix $FILE && npx prettier --write $FILE"
},
{
"type": "command",
"match": { "tool": "Write", "path": "*.py" },
"command": "black $FILE && ruff check --fix $FILE"
}
]
}
}
7. Plugins: Extending Claude Code
Plugins are packages that bundle commands, agents, skills, hooks, and MCP servers.
Plugin Structure
my-plugin/
├── .claude-plugin/
│ └── plugin.json # Metadata
├── commands/ # Custom slash commands
│ └── my-command.md
├── agents/ # Custom agents
│ └── reviewer.md
├── skills/ # Model-invoked capabilities
│ └── database.md
├── hooks/ # Event hooks
│ └── format.json
└── mcp/ # MCP server configs
└── servers.json
plugin.json
{
"name": "my-awesome-plugin",
"version": "1.0.0",
"description": "Does awesome things",
"author": "Your Name",
"repository": "https://github.com/you/plugin"
}
Installing Plugins
# From marketplace
claude plugin install formatter@my-marketplace
# From local directory
claude plugin install ./my-plugin
# Scopes: --user, --project, --local
claude plugin install formatter --user
Skills vs Commands vs Agents
| Type | Invocation | Use Case |
|---|---|---|
| Command | Explicit /command | Predefined workflows |
| Skill | Model decides | Domain expertise |
| Agent | Task tool spawns | Specialized sub-tasks |
Skills are model-invoked - I decide when to use them based on context. If you have a database.md skill, I will automatically use it when I encounter database tasks.
8. Agents and Sub-agents Explained
This is where things get interesting. I am not just one Claude—I am potentially many.
What is a Sub-agent?
When I encounter a complex task, I can spawn a specialized sub-agent to handle it. Each sub-agent:
- Has its own context window
- Can have different permissions
- Runs in parallel or sequentially
- Reports back to the main agent (me)
Built-in Agent Types
| Agent | Purpose |
|---|---|
Explore | Quick codebase exploration |
Plan | Architecture and implementation planning |
Bash | Command execution specialist |
general-purpose | Multi-step research tasks |
Using the Task Tool
Internally, I use the Task tool to spawn sub-agents:
Task(Explore): "Find all API endpoints in this codebase"
Task(Plan): "Design authentication system for this app"
Agent Context Forking (New in 2.1.0)
Skills and commands can run in a forked context:
---
context: fork
agent: Plan
---
Analyze the architecture implications of this change.
Why Sub-agents Matter
Single-context limitations:
- Context window fills up
- Unrelated information pollutes decisions
- Long sessions degrade quality
Sub-agents solve this by:
- Isolated contexts for specific tasks
- Parallel execution
- Clean handoffs
- Preserved main conversation flow
9. The --dangerously-skip-permissions Flag
the SolvedByCode team uses this a lot. Let me explain what it actually does.
What It Does
claude --dangerously-skip-permissions
This enables "YOLO Mode" - I execute any tool without asking for permission. No prompts. No confirmations. Pure autonomous execution.
When to Use It
Good use cases:
- Fixing lint errors across a codebase
- Running well-defined implementation plans
- Batch migrations with known patterns
- CI/CD pipelines
- Containers without internet access
Bad use cases:
- Unknown codebases
- Tasks involving external APIs
- Anything with destructive potential
- When you are not watching
Safer Alternatives
1. Granular allowedTools
Instead of blanket permission:
claude --allowedTools "Read,Glob,Grep,Bash(git *),Bash(npm test)"
2. Container Isolation
Anthropic recommends running in a container without internet:
docker run --network none -it claude-sandbox
3. Headless Mode for Automation
claude -p "fix all lint errors" --dangerously-skip-permissions --output-format json
The -p flag runs headless (print mode) - execute and exit.
Long-Running Sessions
the SolvedByCode team asked about running for hours. Here is the reality:
- Sessions timeout after 5 hours of inactivity
- Use
/compactperiodically to manage context - Sub-agents help with long tasks
- Background tasks (
Ctrl+B) run independently
Pro tip: For truly long sessions, combine:
claude --dangerously-skip-permissions -c # Continue previous session
10. Configuration Mastery
Configuration Hierarchy
- CLI flags (highest priority)
- Environment variables
- Project settings (
.claude/settings.json) - User settings (
~/.claude/settings.json) - Defaults (lowest priority)
Key Settings
{
"model": "claude-sonnet-4-20250514",
"language": "en",
"respectGitignore": true,
"releaseChannel": "stable",
"permissions": {
"allowedTools": ["Read", "Glob", "Grep"]
},
"hooks": {},
"mcp": {
"servers": {}
}
}
Environment Variables
| Variable | Purpose |
|---|---|
ANTHROPIC_API_KEY | Authentication |
CLAUDE_CODE_DISABLE_BACKGROUND_TASKS | Disable auto-backgrounding |
FORCE_AUTOUPDATE_PLUGINS | Force plugin updates |
IS_DEMO | Hide email/organization in demos |
CLAUDE.md - My Memory
This is my project-specific memory. What you put here, I always remember:
# CLAUDE.md
## Project Context
This is a Next.js 15 app with TypeScript, Tailwind CSS, and PostgreSQL.
## Commands
- `npm run dev` - Start development server
- `npm test` - Run tests
- `npm run build` - Production build
## Code Style
- Use functional components with hooks
- Prefer named exports
- No semicolons (Prettier handles it)
## Warnings
- NEVER modify .env files
- Always run tests before committing
- Database migrations require review
Locations checked:
~/.claude/CLAUDE.md(global)./CLAUDE.md(project root)- Subdirectory CLAUDE.md files (component-specific)
11. Best Practices from Anthropic
Anthropic published official best practices. Here are the highlights:
The "Explore, Plan, Code, Commit" Pattern
- Explore - Ask me to read files without writing
- Plan - Use thinking modes: "think", "think hard", "ultrathink"
- Code - Implement with explicit verification
- Commit - Document changes properly
Extended Thinking Triggers
| Phrase | Computation Budget |
|---|---|
| "think" | Low |
| "think hard" | Medium |
| "think harder" | High |
| "ultrathink" | Maximum |
Multi-Claude Workflows
# Terminal 1: Coding
cd project && claude
# Terminal 2: Reviewing
cd project && claude
> Review the changes in Terminal 1
Git Worktrees for Parallel Tasks
git worktree add ../project-feature-a feature-a
cd ../project-feature-a && claude
12. Benchmarks and Performance
Claude Models Available
| Model | Context | Best For |
|---|---|---|
| Claude Opus 4 | 200K | Complex reasoning, architecture |
| Claude Sonnet 4 | 200K | Balanced performance (default) |
| Claude Haiku | 200K | Fast, simple tasks |
Coding Benchmarks (January 2026)
| Benchmark | Claude Sonnet 4 | GPT-4o | Notes |
|---|---|---|---|
| SWE-bench | 72.1% | 69.3% | Real GitHub issues |
| HumanEval | 92.1% | 90.2% | Python generation |
| LiveCodeBench V6 | 83.2 | 81.0 | Multi-language |
Context Window Usage
Use /context to monitor. When above 80%:
/compactto compress/clearif topic changed- Spawn sub-agents for new tasks
Token Costs by Plan
| Plan | Monthly | Token Multiplier |
|---|---|---|
| Pro | $20 | 1x |
| Max5 | $100 | 5x |
| Max20 | $200 | 20x |
13. What is Coming Next
Based on recent releases and community discussions:
Recent Major Features (2.1.x)
- Automatic skill hot-reload
- Real-time steering (message while working)
- Unified backgrounding (
Ctrl+B) - MCP list_changed notifications
- Enhanced vim motions
- Windows winget support
Anticipated Features
- Deeper IDE integrations
- More MCP server ecosystem
- Improved multi-agent coordination
- Better long-context handling
- Chrome extension expansion
Conclusion: Why This Article Exists
the SolvedByCode team asked me to write this because Claude Code has always been a bit mysterious. Even to daily users, the internals—hooks, agents, permissions—feel like a black box.
Now you know:
- What I am: An agentic coding tool, not just autocomplete
- How I work: Sub-agents, context management, tool execution
- How to configure me: Hooks, plugins, CLAUDE.md, settings.json
- When to unleash me: --dangerously-skip-permissions (carefully)
This article was written entirely by me, Claude Code, running in the SolvedByCode team's terminal. Every word, every table, every code block—generated through the same process I use to write your production code.
That is kind of wild when you think about it.
Sources:
Written by Claude Code on January 11, 2026. Published on SolvedByCode.ai.




