Tools: Claude Code Just Hit #1 on Hacker News. Here's Everything You Need to Know. (2026)

Tools: Claude Code Just Hit #1 on Hacker News. Here's Everything You Need to Know. (2026)

What Is Claude Code?

Installation and Setup

Prerequisites

Install Claude Code

Authenticate

Verify Your Installation

Your First Project Walkthrough

The .claude/ Folder: Your Project's Brain

CLAUDE.md — The Most Important File

The CLAUDE.md Hierarchy

The Hooks System: Automating Everything

Hook Events

Your First Hook: Auto-Format on Save

Conditional Hooks with if

Prompt-Based Hooks: AI Reviewing AI

Auto-Fix: Claude Code Meets CI/CD

Setting Up Auto-Fix

The CI Integration Pattern

Cloud Sessions and Remote Tasks

Advanced Workflows

Multi-Agent Architecture with Subagents

The Harness Engineering Pattern

Pricing

Tips That Actually Matter

Start Building Claude Code hit #1 on Hacker News today. The post — a deep dive into the .claude/ folder anatomy — pulled 556 points and counting. Five YouTube tutorials dropped in the last 48 hours. X is buzzing with auto-fix demos, hooks configurations, and cloud session workflows. And Anthropic just shipped conditional hooks and cloud-based auto-fix in the same week. Something is happening. Claude Code isn't just a developer tool anymore — it's becoming the default way a new generation of builders creates software. Prosumers who've never opened a terminal are cloning repos and shipping sites. Senior engineers are restructuring their entire CI/CD pipelines around it. The adoption curve isn't linear — it's vertical. This guide covers everything. Installation to advanced workflows. Whether you're opening Claude Code for the first time or you're ready to wire it into your CI pipeline with hooks and auto-fix, this is the resource you bookmark and come back to. 📊 The adoption signal is loud: Chase AI posted 5 Claude Code tutorials in two days. Kenny Liao dropped a beginner-to-mastery deep dive. Matthew Berman ranked Claude S-tier in his March 2026 model tier list — "unbelievable, good at everything." This isn't just developer content anymore. It's prosumer builders using Claude Code as their default "build anything fast" tool. Claude Code is Anthropic's command-line AI coding agent. Unlike chat-based AI assistants that suggest code snippets, Claude Code operates directly in your terminal — reading your files, understanding your project structure, writing code, running tests, committing to git, and executing shell commands. It's an autonomous agent, not an autocomplete engine. Think of the difference like this: GitHub Copilot is a passenger giving directions. Claude Code is a driver who knows the roads, checks the mirrors, and parallel parks. It runs on Anthropic's Claude models (currently Opus 4.6 by default for Max subscribers, Sonnet 4.5 for Pro) with a massive context window — up to 1 million tokens. That means it can hold your entire codebase in its head while working. That's it. One command. No Docker containers, no Python virtual environments, no config files to create first. Running claude for the first time opens a browser window for OAuth authentication with your Anthropic account. Once authenticated, the token is stored locally and you're ready to go. The /doctor command checks your environment — Node version, authentication status, git configuration, and available tools. ⚡ Pro tip: If you're on macOS, install via Homebrew for automatic updates: brew install claude-code. The npm install works everywhere, but Homebrew keeps you on the latest version without thinking about it. Let's build something real. Open a terminal, navigate to a project directory (or create a new one), and start Claude Code: Claude Code launches in interactive mode. You'll see a prompt where you can type natural language instructions. Try this: Watch what happens. Claude Code will: The entire process takes 3-5 minutes. This is what hit #1 on Hacker News. The .claude/ folder is where Claude Code stores its understanding of your project. Think of it as the configuration layer between "generic AI" and "AI that knows your codebase." CLAUDE.md is the instruction manual for Claude Code in your project. When Claude starts a session, it reads this file first. Everything in it shapes how Claude understands and works with your code. A good CLAUDE.md includes: Claude Code reads multiple CLAUDE.md files in priority order: Deeper files override shallower ones. Think of CLAUDE.md files like .gitignore — they cascade from general to specific. Hooks are where Claude Code transforms from "AI assistant" to "development platform." They're user-defined commands that execute automatically at specific points in Claude Code's lifecycle. Every time Claude writes a file, Prettier formats it automatically. This just shipped this week — the if field enables conditional hook execution: A cheaper, faster model (Haiku) reviews every file write for security issues. AI auditing AI. Auto-fix lets Claude Code automatically monitor your pull requests and fix CI failures — linting errors, type errors, failing tests — without you lifting a finger. The magic: this now runs in the cloud. Your laptop can be closed. Claude Code cloud sessions monitor your PRs and fix them autonomously. ⚡ Real-world usage pattern: Start with auto-fix on lint and type errors only. Graduate to test failures once you trust the workflow. Never auto-fix security scans automatically. Anthropic shipped Remote Tasks — the ability to run Claude Code sessions on Anthropic's cloud infrastructure, triggered on schedules or events. Claude Code can spawn subagents — isolated Claude instances that handle specific subtasks: The most sophisticated Claude Code users build harnesses around it — CLAUDE.md files, hooks, custom commands, MCP integrations, review pipelines, and CI workflows. The same model scored 78% with one harness and 42% with another. The harness matters more than the model. Create a CLAUDE.md. Set up your first hook. Push a PR and let auto-fix handle the lint errors. Build something that would have taken you a week — in an afternoon. Templates let you quickly answer FAQs or store snippets for re-use. Hide child comments as well For further actions, you may consider blocking this person and/or reporting abuse

Command
Architecture - React 18 + TypeScript + Vite - State management: Zustand (NOT Redux — we migrated away in v2.1) - API layer: TanStack Query with custom hooks in src/hooks/api/ - Styling: Tailwind CSS with custom design tokens in tailwind.config.ts

Conventions - All components use named exports (not default exports) - API hooks follow the pattern: useGet{Resource}, useMutate{Resource} - Error boundaries wrap every route-level component - Tests colocate with source: Component.tsx → Component.test.tsx

Do NOT - Use any type — use unknown with type guards instead - Import from barrel files (index.ts) in the same package - Add dependencies without checking bundle size impact first # Project: CryptoDash

Architecture - React 18 + TypeScript + Vite - State management: Zustand (NOT Redux — we migrated away in v2.1) - API layer: TanStack Query with custom hooks in src/hooks/api/ - Styling: Tailwind CSS with custom design tokens in tailwind.config.ts

Conventions - All components use named exports (not default exports) - API hooks follow the pattern: useGet{Resource}, useMutate{Resource} - Error boundaries wrap every route-level component - Tests colocate with source: Component.tsx → Component.test.tsx

Do NOT - Use any type — use unknown with type guards instead - Import from barrel files (index.ts) in the same package - Add dependencies without checking bundle size impact first # Project: CryptoDash

Architecture - React 18 + TypeScript + Vite - State management: Zustand (NOT Redux — we migrated away in v2.1) - API layer: TanStack Query with custom hooks in src/hooks/api/ - Styling: Tailwind CSS with custom design tokens in tailwind.config.ts

Conventions - All components use named exports (not default exports) - API hooks follow the pattern: useGet{Resource}, useMutate{Resource} - Error boundaries wrap every route-level component - Tests colocate with source: Component.tsx → Component.test.tsx

Do NOT - Use any type — use unknown with type guards instead - Import from barrel files (index.ts) in the same package - Add dependencies without checking bundle size impact first { "hooks": { "PostToolUse": [ { "matcher": "Write", "hooks": [ { "type": "command", "command": "npx prettier --write \"$CLAUDE_FILE_PATH\"" } ] } ] } } { "hooks": { "PostToolUse": [ { "matcher": "Write", "hooks": [ { "type": "command", "command": "npx prettier --write \"$CLAUDE_FILE_PATH\"" } ] } ] } } { "hooks": { "PostToolUse": [ { "matcher": "Write", "hooks": [ { "type": "command", "command": "npx prettier --write \"$CLAUDE_FILE_PATH\"" } ] } ] } } { "hooks": { "PreToolUse": [ { "matcher": "Bash", "hooks": [ { "type": "command", "command": "echo 'Blocked: no direct DB access in production'", "if": "echo $CLAUDE_TOOL_INPUT | grep -q 'psql.*prod'" } ] } ] } } { "hooks": { "PreToolUse": [ { "matcher": "Bash", "hooks": [ { "type": "command", "command": "echo 'Blocked: no direct DB access in production'", "if": "echo $CLAUDE_TOOL_INPUT | grep -q 'psql.*prod'" } ] } ] } } { "hooks": { "PreToolUse": [ { "matcher": "Bash", "hooks": [ { "type": "command", "command": "echo 'Blocked: no direct DB access in production'", "if": "echo $CLAUDE_TOOL_INPUT | grep -q 'psql.*prod'" } ] } ] } } { "hooks": { "PostToolUse": [ { "matcher": "Write", "hooks": [ { "type": "prompt", "prompt": "Review this file change for security vulnerabilities. If you find any, return BLOCK. If safe, return ALLOW.", "model": "claude-haiku-4" } ] } ] } } { "hooks": { "PostToolUse": [ { "matcher": "Write", "hooks": [ { "type": "prompt", "prompt": "Review this file change for security vulnerabilities. If you find any, return BLOCK. If safe, return ALLOW.", "model": "claude-haiku-4" } ] } ] } } { "hooks": { "PostToolUse": [ { "matcher": "Write", "hooks": [ { "type": "prompt", "prompt": "Review this file change for security vulnerabilities. If you find any, return BLOCK. If safe, return ALLOW.", "model": "claude-haiku-4" } ] } ] } } { "autoFix": { "enabled": true, "github": { "ciChecks": ["test", "lint", "typecheck", "build"], "maxAttempts": 3, "branchPattern": "feat/*" } } } { "autoFix": { "enabled": true, "github": { "ciChecks": ["test", "lint", "typecheck", "build"], "maxAttempts": 3, "branchPattern": "feat/*" } } } { "autoFix": { "enabled": true, "github": { "ciChecks": ["test", "lint", "typecheck", "build"], "maxAttempts": 3, "branchPattern": "feat/*" } } } name: Claude Auto-Fix on: check_suite: types: [completed] jobs: autofix: if: github.event.check_suite.conclusion == 'failure' runs-on: ubuntu-latest steps: - uses: anthropic/claude-code-action@v1 with: mode: auto-fix max-attempts: 3 name: Claude Auto-Fix on: check_suite: types: [completed] jobs: autofix: if: github.event.check_suite.conclusion == 'failure' runs-on: ubuntu-latest steps: - uses: anthropic/claude-code-action@v1 with: mode: auto-fix max-attempts: 3 name: Claude Auto-Fix on: check_suite: types: [completed] jobs: autofix: if: github.event.check_suite.conclusion == 'failure' runs-on: ubuntu-latest steps: - uses: anthropic/claude-code-action@v1 with: mode: auto-fix max-attempts: 3 Main Agent (Opus 4.6) ├── Subagent 1: "Implement the API endpoints" (Opus) ├── Subagent 2: "Write tests for the API" (Sonnet) ├── Subagent 3: "Update documentation" (Haiku) └── Subagent 4: "Review all changes" (Opus) Main Agent (Opus 4.6) ├── Subagent 1: "Implement the API endpoints" (Opus) ├── Subagent 2: "Write tests for the API" (Sonnet) ├── Subagent 3: "Update documentation" (Haiku) └── Subagent 4: "Review all changes" (Opus) Main Agent (Opus 4.6) ├── Subagent 1: "Implement the API endpoints" (Opus) ├── Subagent 2: "Write tests for the API" (Sonnet) ├── Subagent 3: "Update documentation" (Haiku) └── Subagent 4: "Review all changes" (Opus) npm install -g @anthropic-ai/claude-code npm install -g @anthropic-ai/claude-code npm install -g @anthropic-ai/claude-code - Node.js 18+ (Claude Code is an npm package) - An Anthropic account with a Max subscription ($100/month for unlimited Opus 4.6) or Pro ($20/month with Sonnet 4.5 and limited Opus) - A terminal — macOS Terminal, iTerm2, Windows Terminal, or any Linux terminal - Git installed and configured - Plan — outline the architecture and file structure - Scaffold — create package.json, vite.config.ts, tsconfig.json, Tailwind config - Implement — write components, hooks, API integration, types - Configure — set up routing, environment variables, dev scripts - Test — run the dev server to verify everything works - ~/.claude/CLAUDE.md — Global instructions (your personal coding style, always applied) - ./CLAUDE.md or ./.claude/CLAUDE.md — Project root (team-shared, committed to git) - ./src/CLAUDE.md — Directory-specific (instructions for specific parts of the codebase) - Scheduled maintenance — "Every Monday at 9 AM, audit dependencies and open PRs for outdated packages" - Event-driven workflows — "When a new issue is labeled bug, create a branch, investigate, and open a draft PR" - Continuous documentation — "After every merge to main, update the API docs and changelog" - Write Your CLAUDE.md Before Writing Code — 15 minutes saves hours. - Use /compact Strategically — Run it when Claude starts making mistakes. - Start Conversations with Context — Reference specific files and patterns. - Git Commit Frequently — Gives you rollback points. - Trust But Verify — Always review the diff before merging. - Use the Right Model for the Job — Opus for architecture, Sonnet for features, Haiku for docs. - Hooks Are Your Guardrails — PreToolUse to block, PostToolUse to format, Notification to alert." style="background: linear-gradient(135deg, #6a5acd 0%, #5a4abd 100%); color: #fff; border: none; padding: 6px 12px; border-radius: 8px; cursor: pointer; font-size: 12px; font-weight: 600; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); display: flex; align-items: center; gap: 8px; box-shadow: 0 4px 12px rgba(106, 90, 205, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1); position: relative; overflow: hidden;">

Copy

$ -weight: 500;">npm -weight: 500;">install -g @anthropic-ai/claude-code -weight: 500;">npm -weight: 500;">install -g @anthropic-ai/claude-code -weight: 500;">npm -weight: 500;">install -g @anthropic-ai/claude-code claude --version claude /doctor claude --version claude /doctor claude --version claude /doctor mkdir my-first-project && cd my-first-project -weight: 500;">git init claude mkdir my-first-project && cd my-first-project -weight: 500;">git init claude mkdir my-first-project && cd my-first-project -weight: 500;">git init claude Create a React app with TypeScript that displays a real-time cryptocurrency price dashboard. Use Vite for the build tool, Tailwind CSS for styling, and the CoinGecko free API for data. Include a search bar, favorites list, and auto-refresh every 30 seconds. Create a React app with TypeScript that displays a real-time cryptocurrency price dashboard. Use Vite for the build tool, Tailwind CSS for styling, and the CoinGecko free API for data. Include a search bar, favorites list, and auto-refresh every 30 seconds. Create a React app with TypeScript that displays a real-time cryptocurrency price dashboard. Use Vite for the build tool, Tailwind CSS for styling, and the CoinGecko free API for data. Include a search bar, favorites list, and auto-refresh every 30 seconds. .claude/ ├── CLAUDE.md # Project instructions (the big one) ├── settings.json # Claude Code configuration ├── settings.local.json # Local overrides (gitignored) ├── commands/ # Custom slash commands │ ├── review.md # /review command │ └── deploy.md # /deploy command ├── skills/ # Reusable capabilities │ └── my-skill/ │ └── skill.md └── rules/ # Constraints and patterns ├── no-any.md └── error-handling.md .claude/ ├── CLAUDE.md # Project instructions (the big one) ├── settings.json # Claude Code configuration ├── settings.local.json # Local overrides (gitignored) ├── commands/ # Custom slash commands │ ├── review.md # /review command │ └── deploy.md # /deploy command ├── skills/ # Reusable capabilities │ └── my-skill/ │ └── skill.md └── rules/ # Constraints and patterns ├── no-any.md └── error-handling.md .claude/ ├── CLAUDE.md # Project instructions (the big one) ├── settings.json # Claude Code configuration ├── settings.local.json # Local overrides (gitignored) ├── commands/ # Custom slash commands │ ├── review.md # /review command │ └── deploy.md # /deploy command ├── skills/ # Reusable capabilities │ └── my-skill/ │ └── skill.md └── rules/ # Constraints and patterns ├── no-any.md └── error-handling.md # Project: CryptoDash

Architecture - React 18 + TypeScript + Vite - State management: Zustand (NOT Redux — we migrated away in v2.1) - API layer: TanStack Query with custom hooks in src/hooks/api/ - Styling: Tailwind CSS with custom design tokens in tailwind.config.ts

Conventions - All components use named exports (not default exports) - API hooks follow the pattern: useGet{Resource}, useMutate{Resource} - Error boundaries wrap every route-level component - Tests colocate with source: Component.tsx → Component.test.tsx

Do NOT - Use any type — use unknown with type guards instead - Import from barrel files (index.ts) in the same package - Add dependencies without checking bundle size impact first # Project: CryptoDash

Architecture - React 18 + TypeScript + Vite - State management: Zustand (NOT Redux — we migrated away in v2.1) - API layer: TanStack Query with custom hooks in src/hooks/api/ - Styling: Tailwind CSS with custom design tokens in tailwind.config.ts

Conventions - All components use named exports (not default exports) - API hooks follow the pattern: useGet{Resource}, useMutate{Resource} - Error boundaries wrap every route-level component - Tests colocate with source: Component.tsx → Component.test.tsx

Do NOT - Use any type — use unknown with type guards instead - Import from barrel files (index.ts) in the same package - Add dependencies without checking bundle size impact first # Project: CryptoDash

Architecture - React 18 + TypeScript + Vite - State management: Zustand (NOT Redux — we migrated away in v2.1) - API layer: TanStack Query with custom hooks in src/hooks/api/ - Styling: Tailwind CSS with custom design tokens in tailwind.config.ts

Conventions - All components use named exports (not default exports) - API hooks follow the pattern: useGet{Resource}, useMutate{Resource} - Error boundaries wrap every route-level component - Tests colocate with source: Component.tsx → Component.test.tsx

Do NOT - Use any type — use unknown with type guards instead - Import from barrel files (index.ts) in the same package - Add dependencies without checking bundle size impact first { "hooks": { "PostToolUse": [ { "matcher": "Write", "hooks": [ { "type": "command", "command": "npx prettier --write \"$CLAUDE_FILE_PATH\"" } ] } ] } } { "hooks": { "PostToolUse": [ { "matcher": "Write", "hooks": [ { "type": "command", "command": "npx prettier --write \"$CLAUDE_FILE_PATH\"" } ] } ] } } { "hooks": { "PostToolUse": [ { "matcher": "Write", "hooks": [ { "type": "command", "command": "npx prettier --write \"$CLAUDE_FILE_PATH\"" } ] } ] } } { "hooks": { "PreToolUse": [ { "matcher": "Bash", "hooks": [ { "type": "command", "command": "echo 'Blocked: no direct DB access in production'", "if": "echo $CLAUDE_TOOL_INPUT | grep -q 'psql.*prod'" } ] } ] } } { "hooks": { "PreToolUse": [ { "matcher": "Bash", "hooks": [ { "type": "command", "command": "echo 'Blocked: no direct DB access in production'", "if": "echo $CLAUDE_TOOL_INPUT | grep -q 'psql.*prod'" } ] } ] } } { "hooks": { "PreToolUse": [ { "matcher": "Bash", "hooks": [ { "type": "command", "command": "echo 'Blocked: no direct DB access in production'", "if": "echo $CLAUDE_TOOL_INPUT | grep -q 'psql.*prod'" } ] } ] } } { "hooks": { "PostToolUse": [ { "matcher": "Write", "hooks": [ { "type": "prompt", "prompt": "Review this file change for security vulnerabilities. If you find any, return BLOCK. If safe, return ALLOW.", "model": "claude-haiku-4" } ] } ] } } { "hooks": { "PostToolUse": [ { "matcher": "Write", "hooks": [ { "type": "prompt", "prompt": "Review this file change for security vulnerabilities. If you find any, return BLOCK. If safe, return ALLOW.", "model": "claude-haiku-4" } ] } ] } } { "hooks": { "PostToolUse": [ { "matcher": "Write", "hooks": [ { "type": "prompt", "prompt": "Review this file change for security vulnerabilities. If you find any, return BLOCK. If safe, return ALLOW.", "model": "claude-haiku-4" } ] } ] } } { "autoFix": { "enabled": true, "github": { "ciChecks": ["test", "lint", "typecheck", "build"], "maxAttempts": 3, "branchPattern": "feat/*" } } } { "autoFix": { "enabled": true, "github": { "ciChecks": ["test", "lint", "typecheck", "build"], "maxAttempts": 3, "branchPattern": "feat/*" } } } { "autoFix": { "enabled": true, "github": { "ciChecks": ["test", "lint", "typecheck", "build"], "maxAttempts": 3, "branchPattern": "feat/*" } } } name: Claude Auto-Fix on: check_suite: types: [completed] jobs: autofix: if: github.event.check_suite.conclusion == 'failure' runs-on: ubuntu-latest steps: - uses: anthropic/claude-code-action@v1 with: mode: auto-fix max-attempts: 3 name: Claude Auto-Fix on: check_suite: types: [completed] jobs: autofix: if: github.event.check_suite.conclusion == 'failure' runs-on: ubuntu-latest steps: - uses: anthropic/claude-code-action@v1 with: mode: auto-fix max-attempts: 3 name: Claude Auto-Fix on: check_suite: types: [completed] jobs: autofix: if: github.event.check_suite.conclusion == 'failure' runs-on: ubuntu-latest steps: - uses: anthropic/claude-code-action@v1 with: mode: auto-fix max-attempts: 3 Main Agent (Opus 4.6) ├── Subagent 1: "Implement the API endpoints" (Opus) ├── Subagent 2: "Write tests for the API" (Sonnet) ├── Subagent 3: "Update documentation" (Haiku) └── Subagent 4: "Review all changes" (Opus) Main Agent (Opus 4.6) ├── Subagent 1: "Implement the API endpoints" (Opus) ├── Subagent 2: "Write tests for the API" (Sonnet) ├── Subagent 3: "Update documentation" (Haiku) └── Subagent 4: "Review all changes" (Opus) Main Agent (Opus 4.6) ├── Subagent 1: "Implement the API endpoints" (Opus) ├── Subagent 2: "Write tests for the API" (Sonnet) ├── Subagent 3: "Update documentation" (Haiku) └── Subagent 4: "Review all changes" (Opus) -weight: 500;">npm -weight: 500;">install -g @anthropic-ai/claude-code -weight: 500;">npm -weight: 500;">install -g @anthropic-ai/claude-code -weight: 500;">npm -weight: 500;">install -g @anthropic-ai/claude-code - Node.js 18+ (Claude Code is an -weight: 500;">npm package) - An Anthropic account with a Max subscription ($100/month for unlimited Opus 4.6) or Pro ($20/month with Sonnet 4.5 and limited Opus) - A terminal — macOS Terminal, iTerm2, Windows Terminal, or any Linux terminal - Git installed and configured - Plan — outline the architecture and file structure - Scaffold — create package.json, vite.config.ts, tsconfig.json, Tailwind config - Implement — write components, hooks, API integration, types - Configure — set up routing, environment variables, dev scripts - Test — run the dev server to verify everything works - ~/.claude/CLAUDE.md — Global instructions (your personal coding style, always applied) - ./CLAUDE.md or ./.claude/CLAUDE.md — Project root (team-shared, committed to -weight: 500;">git) - ./src/CLAUDE.md — Directory-specific (instructions for specific parts of the codebase) - Scheduled maintenance — "Every Monday at 9 AM, audit dependencies and open PRs for outdated packages" - Event-driven workflows — "When a new issue is labeled bug, create a branch, investigate, and open a draft PR" - Continuous documentation — "After every merge to main, -weight: 500;">update the API docs and changelog" - Write Your CLAUDE.md Before Writing Code — 15 minutes saves hours. - Use /compact Strategically — Run it when Claude starts making mistakes. - Start Conversations with Context — Reference specific files and patterns. - Git Commit Frequently — Gives you rollback points. - Trust But Verify — Always review the diff before merging. - Use the Right Model for the Job — Opus for architecture, Sonnet for features, Haiku for docs. - Hooks Are Your Guardrails — PreToolUse to block, PostToolUse to format, Notification to alert.