Skip to main content

Claude Code

Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster.

Claude Code: Deep Coding at Terminal Velocity \ Anthropic

GitHub - luongnv89/claude-howto: A visual, example-driven guide to Claude Code — from basic concepts to advanced agents, with copy-paste templates that bring immediate value. · GitHub ⭐ 41k

Quick Start​

# Installation
brew install --cask claude-code

# Start
claude
claude --login
claude --think

# Print Mode (one-off task)
claude -p "query"

# Help
claude --help
claude update

Core Features​

  1. CLAUDE.md: Project memory file with custom rules and conventions (run /init)
  2. Permissions: Control which tools Claude can use
  3. Plan Mode: Review plans before code changes
  4. Checkpoints: Automatic snapshots to revert if needed
  5. Skills: Reusable instruction files Claude follows automatically
  6. Hooks: Custom shell scripts on lifecycle events
  7. MCP: Connect to external tools (databases, third-party services)
  8. Plugins: Third-party integrations with skills, MCPs, and hooks
  9. Context: Manage context window with /context
  10. Slash Commands: Shortcuts for common tasks
  11. Compaction: Compress long conversations to save tokens
  12. Subagents: Spawn parallel agents for complex tasks
  13. Claude Managed Agents

See Harness for the underlying planning/context/sub-agent scaffolding that Claude Code and similar tools are built on.

Superpowers​

Structured dev workflow framework with TDD, debugging, planning, and code review skills.

/plugin install superpowers@claude-plugins-official

Key skills:

  • test-driven-development - RED-GREEN-REFACTOR cycle
  • systematic-debugging - 4-phase root cause process
  • brainstorming - Socratic design refinement
  • writing-plans - Detailed implementation plans
  • verification-before-completion - Ensure fixes work

GitHub - obra/superpowers ⭐ 284k

Superpowers 6 — Massively Parallel Procrastination

GSD (Get Shit Done)​

Meta-prompting and spec-driven development system for autonomous work.

GSD 2.0​

TypeScript application that controls agent sessions (not just prompts).

npm install -g gsd-pi@latest

# From project directory
/gsd migrate
/gsd auto # Autonomous mode
/gsd next # Step mode

GitHub - gsd-build/gsd-2 ⭐ 7.8k

GSD 1.0​

Original command-based system.

npx get-shit-done-cc@latest
npm uninstall -g get-shit-done-cc

claude --dangerously-skip-permissions
/gsd-autonomous
/gsd-plan-phase 1
/gsd-execute-phase 1

GitHub - gsd-build/get-shit-done ⭐ 65k

Comparison​

Alternative Agent Harnesses​

OpenClaw​

Open-source AI assistant harness compatible with multiple LLMs.

npm install -g openclaw@latest
openclaw onboard --install-daemon
openclaw dashboard
openclaw gateway run

GitHub - openclaw/openclaw ⭐ 389k

Hermes​

Alternative agent harness from Nous Research.

curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash
hermes # Start chatting
hermes model # Choose LLM
hermes gateway # Start messaging gateway

Running:

Links:

Comparison: OpenClaw vs Hermes​

Notable Skills & Plugins​

Official & Curated​

  • ​Superpowers ⭐ 284k**:** A structured dev workflow that forces Claude to brainstorm, plan, and test before writing any code. Useful when you want rigor over speed.
  • ​InsForge ⭐ 13k**:** Semantic backend layer that exposes auth, database, storage, and functions through one agent-friendly API. Think of it as a unified backend for agents.
  • ​Bright Data Skills ⭐ 257**:** Teaches Claude to orchestrate 60+ MCP tools for web scraping and structured data extraction. Handles the messy parts of live web access.
  • ​Context7 ⭐ 62k**:** MCP server that feeds live, version-specific library docs directly into Claude's context. No more hallucinated APIs from outdated training data.
  • ​Claude-Mem ⭐ 94k**:** Persistent memory plugin that auto-captures sessions and reinjects relevant context into future ones. Solves the "Claude forgot everything" problem between sessions.
  • ​Everything Claude Code ⭐ 255k**:** Curated skills and rules collection with smart token-saving compaction at logical breakpoints. A good starting point if you're building your own .claude/ setup.
  • ​Planning with Files ⭐ 27k**:** Persistent markdown files for planning, progress tracking, and knowledge storage across sessions. Simple approach, surprisingly effective for multi-session projects.
  • ​Sentry Security Review ⭐ 986**:** Security review skill built on 15 years of real Sentry patches and Django ORM pitfalls. Catches the kind of bugs that only show up in production.
  • ​Frontend Design ⭐ 18k**:** Official Anthropic skill for distinctive, non-generic UI output with bold design choices. Ships with Claude Code and pushes past the default "looks like every other AI-generated UI" problem.
  • ​Web Quality Skills ⭐ 2.8k**:** Lighthouse and Core Web Vitals optimization for performance, accessibility, and SEO. Bakes web quality checks directly into the agent loop.
  • ​n8n-MCP ⭐ 23k**:** MCP server with docs and schemas for all 1,396 n8n automation nodes. If you're building automations with n8n, this gives Claude full visibility into the node catalog.
  • ​Claude-Reflect ⭐ 1.4k**:** Captures your repeated corrections and turns them into reusable commands with human review. The agent learns your preferences over time instead of making the same mistakes.
  • ​cc-DevOps Skills ⭐ 306**:** Generator and validator loops for Terraform, Kubernetes, Docker, and CI/CD configs. Generates infra code, then validates it before you apply.
  • ​Agent Sandbox ⭐ 383**:** Isolated E2B cloud sandboxes for building, hosting, and testing apps without touching local files. Good for when you want the agent to experiment freely without risk.
  • ​Agile Workflow ⭐ 559**:** Full agile delivery pipeline with multi-model parallel review via Codex and Gemini agents. Brings structured software delivery practices into the agent workflow.
  • ​Claude Code Plugins+ ⭐ 2.7k**:** Plugin directory with a CLI package manager for searching and installing niche skills. Think npm but for Claude Code skills.
  • Context Engineering Kit ⭐ 1.7k - Quality-focused skills
  • GitHub - gastownhall/beads: Beads - A memory upgrade for your coding agent · GitHub

Performance & Efficiency​

  • Caveman ⭐ 104k - Cuts 65% of tokens by talking like caveman

    claude plugin marketplace add JuliusBrussee/caveman
    claude plugin install caveman@caveman
  • RTK ⭐ 80k - CLI proxy reducing token consumption 60-90%

    brew install rtk
    rtk init -g # Install for Claude Code
    rtk gain --all # Show savings stats
    • rtk — Make your AI coding agent smarter | CLI proxy
    • Four strategies applied per command type:
      1. Smart Filtering - Removes noise (comments, whitespace, boilerplate)
      2. Grouping - Aggregates similar items (files by directory, errors by type)
      3. Truncation - Keeps relevant context, cuts redundancy
      4. Deduplication - Collapses repeated log lines with counts
  • Ponytail ⭐ 133k - Makes your AI agent think like the laziest senior dev in the room. The best code is the code you never wrote.

  • Prompt Master ⭐ 13k - A Claude skill that writes the accurate prompts for any AI tool. Zero tokens or credits wasted. Full context and memory retention

Frontend & Testing​

Domain-Specific​

Research & Analysis​

DeepResearch Agent​

Marketplaces​

Others / Agents / Skills​

Pricing​

Claude models pricing table, retrieved today:

ModelInput (/MTok)Output (/MTok)Factor
Fable 5 / Mythos 5$10$505.0x
Opus 4.5-4.8 (current)$5$252.5x
Opus 4.1 / Opus 4 (legacy)$15$757.5x
Sonnet 5 (intro, thru 8/31/26)$2$101.0x <- baseline
Sonnet 5 (from 9/1/26) / 4.5/4.6$3$151.5x
Haiku 4.5$1$50.5x
Haiku 3.5 (legacy)$0.80$40.4x

Each turn resends the whole conversation as input, so an uncompacted session's cumulative input cost grows with the square of its length — double the turns, ~4x the cost. Compacting (or starting fresh) keeps that bounded and flattens it back to linear. Three habits to stay off the quadratic curve:

  • Claude Code: Auto-compact fires near the limit on its own, but a manual /compact at a clean breakpoint gives a sharper summary — steer it with /compact focus on X. Keep anything you can't lose in a durable file: CLAUDE.md (Claude instructions/conventions) plus a plain project-insights markdown file — findings, decisions, gotchas that have nothing to do with Claude — that you have Claude write to as you go. Reference the insights file from CLAUDE.md from the start: CLAUDE.md is re-read after every compact, so the pointer pulls the insights back in automatically.
  • Regular chats: Don't let one thread grow forever. Start a new chat per topic, use a Project to carry shared context across chats, or turn on memory so key facts follow you without a giant thread.
  • Claude Code on the web/app: Same engine as desktop — auto-compact runs automatically, and /compact works right in the input, so you get the same manual control on the go.

TradeUsage — Buy Claude credits without Max pricing

Prompt Caching Mechanics​

The Claude API is stateless, so Claude Code resends the entire conversation on every turn. Prompt caching makes this cheap by reusing matching prefixes instead of reprocessing them.

  • Request structure: Requests render in a fixed order — tools → system → messages. This stable prefix at the front is what makes caching effective; new user input at the tail is never cached.
  • Cache matching: Caching operates on exact bytes of the rendered prompt — a single-byte change invalidates everything downstream of that point.
  • Pricing: Cache reads cost ~0.1x the input price; cache writes cost 1.25x (5-minute TTL) or 2x (1-hour TTL).
  • Break-even: Whether caching saves money depends on TTL and turn frequency. The 5-minute TTL is cheaper for rapid back-and-forth; the 1-hour TTL only justifies its doubled write cost when 5–60 minutes elapse between turns.
  • Invalidation order: Tool changes invalidate the whole cache; system prompt changes bust the system + messages tiers; plain message appends preserve the prefix cache.
  • Practical levers beyond not restarting a session: structure prompts static-content-first, dynamic-content-last, so the stable prefix stays cacheable; keep tool definitions and the system prompt stable, since reordering/editing tools or changing effort/thinking settings invalidates the cache from that point forward; prefer the 1-hour TTL when follow-ups might land more than 5 minutes apart (the cache window counts generation time too, so a long response eats into it); and where you need to inject new guidance mid-conversation, add it as a mid-conversation message rather than editing the top-level system prompt, which lets you steer behavior without breaking the cached prefix.

Advanced Features​

LSP (Language Server Protocol)​

Problem: By default, Claude uses grep/glob (text search). Code has structure, not just text.

Solution: Enable LSP for IDE-level code intelligence.

## Code Intelligence

Prefer LSP over Grep/Glob/Read for code navigation:
- `goToDefinition` / `goToImplementation` - Jump to source
- `findReferences` - See all usages
- `workspaceSymbol` - Find where something is defined
- `documentSymbol` - List all symbols in file
- `hover` - Type info without reading file
- `incomingCalls` / `outgoingCalls` - Call hierarchy

Use Grep/Glob only for text searches (comments, strings, config).

The 2-Minute Claude Code Upgrade: LSP

Output Styles​

/config output-style proactive # Execute immediately, fewer prompts
/config output-style explanatory # Educational insights between tasks
/config output-style learning # Asks you to implement TODO markers

Output Styles - Docs

Scheduled Tasks​

/loop 5m check if deployment finished
/loop check CI status and address review comments

Remind at specific time:

remind me at 3pm to push release branch

Scheduled Tasks - Docs

Monitoring Tools​

ClaudeBar - macOS menu bar usage monitor

brew install --cask claudebar

GitHub - tddworks/ClaudeBar ⭐ 1.5k

Claude Monitor - Real-time predictions and warnings

uv tool install claude-monitor
claude-monitor # or cmonitor, ccmonitor

GitHub - Claude-Code-Usage-Monitor ⭐ 8.7k

Claude Code Viewer - Web-based project manager

npm install -g @kimuson/claude-code-viewer
claude-code-viewer --port 3400

GitHub - claude-code-viewer ⭐ 1.3k

Conversations: ~/.claude/projects/

Best Practices​

Using Claude Code Effectively​

From Stop babysitting your agents:

Autonomous Verification Circuits

  • Automate backend debugging (API hits, DB checks, logs, tests)
  • Self-healing loops: catch errors, fix bugs, iterate before PR
  • Self-improving assets: update shared skill.md on blockers

Parallelization

  • Use /rename to categorize threads
  • Combine Tmux + Git worktrees + claude agents
  • Claude Code Desktop GUI for unified management

Background Loops

  • Delegate non-coding tasks (docs, ticket triage, CI)
  • /loop 10m for auto-checking work
  • Persistent circuits via cron/GitHub Actions

From How we Claude Code:

Model-Driven Requirements

  • Interactive interviewing vs massive specs upfront
  • Let Claude critique architecture to find roadblocks

HTML Specs & Token Efficiency

  • Structured HTML layouts > unstructured Markdown
  • Visual diagrams + schemas = maximum context

Agent-Native Verification

  • Multi-surface checks: terminal, dashboard, CLI
  • Auto-upload validation videos to S3 in PR description

Andrej Karpathy's Four Principles​

GitHub - andrej-karpathy-skills ⭐ 212k

  1. Think before coding - Don't assume
  2. Simplicity First - Minimum code that solves problem
  3. Surgical Changes - Touch only what you must
  4. Goal-driven Execution - Define success, loop until verified

Working signs:

  • Fewer unnecessary diffs
  • Simple code first time
  • Clarifying questions before implementation
  • Clean, minimal PRs

Avoiding Agent Confabulation​

From Arguing With Agents:

Problem: RLHF trains models to read between the lines. Long CLAUDE.md interpreted as "urgency" rather than literal instructions.

Solution:

  • Don't ask agents to explain deviations (triggers confabulation)
  • Rewrite "don't do X" as "always do Y"
  • Use structural enforcement (hooks, linters) over conversational rules

The Unreasonable Effectiveness of HTML​

From Using Claude Code: HTML:

  • Dense, structured HTML specs > long Markdown
  • Upfront token cost pays off by preventing iteration loops
  • Include visual diagrams, schemas, flowcharts

AI-Native Engineering Maturity Model​

A useful way to think about team-level adoption, in four increasing steps:

  1. Assisted - one Claude session as a pair-programming peer; human and agent work through complexity together in the same thread.
  2. Parallel - familiarity with the tool grows into running several sessions at once (e.g. multiple terminals/worktrees), but the human still personally orchestrates and instructs each one.
  3. Supervised autonomy - Claude shifts from executor to orchestrator, directing groups of sub-agents; the human sets direction for the orchestrator rather than for each worker.
  4. AI-native - hundreds to thousands of agents run per day, mostly triggered by events (a PR push, a schedule, a webhook) rather than by a person typing a prompt.

The jump from step 2 to steps 3-4 is less about new features and more a mindset shift: treating Claude as an orchestrator that distributes work, not just a single executor with "a brain and hands."

Planning vs. execution: where to spend tokens​

Spend the more expensive model/effort on planning (Plan Mode or an equivalent), since a task executed with real clarity needs far fewer, cheaper iterations than one executed without it. Once the plan is clear, execution itself is often not that complex - a cheaper/faster model can carry it out.

A pattern for carrying that clarity across a cache break: after planning, write a canonical plan file (intent.md, plan.md, whatever name you prefer) and start a fresh session for execution that reads from that file, rather than continuing the planning session. Have the executor update the plan file to mark off completed steps as it goes, so any new execution session (or sub-agent) can see progress directly from the file instead of re-deriving state from the codebase.

What breaks prompt caching: switching models, switching effort level, and compacting/starting a new conversation. Since each of these forces a full re-read of context, only break cache deliberately - typically right at the planning → execution transition - rather than mid-task.

Permission modes as a ladder​

Permission modes range from fully manual (approval required for anything beyond reading a file) to fully bypassed (no prompts at all, even for risky actions). Auto mode sits in the middle: it only asks for manual approval when it judges an action as potentially risky, otherwise it proceeds - which in practice lets agents run in much longer, uninterrupted horizons without sacrificing safety, since a consistent automated risk check tends to catch more than an inconsistent human skimming every prompt.

Hooks as the source of determinism​

CLAUDE.md instructions are read as guidance and are inherently interpretable/subjective. Hooks are plain deterministic scripts that run at fixed points in the agent loop (session start, after the user submits a prompt, before/after a tool call, at turn end) and cannot be skipped or reinterpreted. As you delegate larger chunks of work to agents, hooks - not CLAUDE.md - are what actually enforces guardrails: compliance checks, test-passing checks, lint gates, and prompt-injection screening before a tool runs.

Sub-agents and dynamic workflows​

A sub-agent spins up its own context window derived from the parent session, which keeps the parent session's context clean (context hygiene) and lets each sub-agent get a narrow, specific objective. Claude can summon a sub-agent explicitly on request or autonomously when it detects the opportunity.

Dynamic/orchestrated workflows go a step further: a first wave of sub-agents scouts the surface area to be changed, then a deterministic script partitions the actual work across a second wave of sub-agents so they don't collide on the same files (avoiding merge conflicts from uncoordinated parallel edits). This is token-intensive, so it's worth reserving for two situations: exploring a large, unfamiliar codebase for the first time, or executing a wide-reaching refactor that touches many files and needs coordinated multi-agent execution.

Loop engineering​

Rather than asking Claude to do something, checking the result yourself, and re-prompting, loop engineering has you define the objective and the verification checks up front, then let the agent act as executor, checker, and optimizer in one continuous loop - revising its own approach against the checks and only surfacing back to you once they pass.

Practical guidelines for building a good loop:

  • Give the agent the access it needs (MCP connectors, ability to drive a UI, etc.) to actually judge whether a check has passed - an agent without the right tool access can't verify what it built.
  • Have Claude help write the checks themselves, since it holds full context on what's being built - checks disconnected from the actual goal waste iterations.
  • Don't over-specify checks to the point only one exact answer can satisfy them, and don't under-specify to where the checks miss real defects - both waste tokens.
  • Checks don't have to be binary; a threshold-based check (e.g. "test failure rate below some percentage") works too.
  • Always cap the maximum number of loop iterations so a loop that can't find a passing state doesn't run indefinitely.
  • Use a strong/expensive model for the initial planning and a cheaper model for the repeated execution iterations inside the loop.
  • Separate the generator from the evaluator. An agent grading its own work tends to confidently approve mediocre output, so route verification through a distinct reviewer (ideally one that can't see the generator's own reasoning/chain of thought) checking against pre-agreed acceptance criteria written up front, combined with deterministic checks (tests, CI) that the generator didn't author itself.

As an alternative (or complement) to /compact for preserving continuity across a context reset, some practitioners prefer an explicit handoff pattern: ask Claude to generate both a compaction summary prompt and a resume prompt, save those, and start the next session from the resume prompt rather than relying on automatic compaction - useful when you want more control over exactly what carries forward (e.g. skills/rules that plain compaction tends to drop) than /compact gives you.

The counterintuitive result: most of the tokens spent in ad hoc, un-looped usage go toward iterating on incomplete or imperfect results. A well-specified loop with good checks tends to reduce total cost, because it converges in fewer, better-targeted iterations - which is why cost is better measured per completed outcome than per token.

Agentic development lifecycle (ADLC)​

As more code ships through agents, the bottleneck shifts away from writing code and toward reviewing and accepting it. The natural next step is running loops in the background, triggered by events rather than by a person at a keyboard - e.g. an agentic loop kicked off automatically on every PR push to do automated code review, bug hunting, and PR checks. This effectively becomes a CI/CD layer built out of agent loops sitting underneath day-to-day engineering work, and it depends on the same ingredients as an individual loop: clear objectives, strong verification, and hooks enforcing that verification consistently.

Integrations​

Google Vertex AI​

Claude Code on Vertex AI

Limitations:

  • ❌ WebSearch - Blocked by VPC Service Controls
  • ✅ WebFetch - Works for specific URLs
  • ❌ claude remote-control - Only with claude login

tmux & iTerm2​

Thirty lines to make Claude Code native in tmux

Local LLMs​

Settings​

settings.json
{
"env": {
    "CLAUDE_CODE_DISABLE_FEEDBACK_SURVEY": "1"
  },
"permissions": {
"allow": [
"Bash",
"Read",
"Edit",
"Write",
"WebFetch",
"Grep",
"Glob",
"LS",
"MultiEdit",
"NotebookRead",
"NotebookEdit",
"TodoRead",
"TodoWrite",
"WebSearch"
]
}
}

Learning Resources​

Development Tools​

Codebase & Source​