Claude Code Guides and Tutorials
27 guides about Claude Code, newest first. The first one published was “Why Claude Code Stops Mid-Automation (and How to Fix It)”. Last updated .
· 14 min read
Claude Code Hooks Not Working: 8 Fixes and a Debug Script
Claude Code hooks not working? Fix settings location, JSON, matchers, exit codes, permissions and claude -p, then log every payload with a debug script.
· 17 min read
Claude Code PreToolUse Hook: Copy-Paste Block Scripts
Claude Code PreToolUse hook guide: exact JSON input, allow/deny/ask output, exit codes, error fixes, copy-paste scripts that block risky headless runs.
· 19 min read
Claude Code GitHub Actions Permissions: Least-Privilege YAML
Claude Code GitHub Actions permissions explained: exact permissions blocks, claude_args tool limits and secret setup for unattended PR review and cron runs.
· 17 min read
Claude Code Stop Hook: Block Early Exit Without Loops
Claude Code stop hook guide: block early exit until tests pass, cap retries with stop_hook_active and a counter, and fix JSON validation errors.
· 17 min read
Claude Code MCP Servers: Setup, Config & Cron-Safe Template
Claude Code MCP servers: add, configure, and remove them, pick a scope, run them safely in cron jobs with permission rules, timeouts, and failure checks.
· 15 min read
Claude Code Sandbox Mode: Exact Config and What It Blocks
Claude Code sandbox mode, explained from Anthropic's docs: the exact settings.json keys, what it blocks on disk and network, and what slips through.
· 18 min read
Claude Code Output Format JSON: Fields, jq & Python Parsing
Claude Code output format JSON explained: result fields, stream-json events, jq and Python parsing, and pitfalls when monitoring headless runs.
· 21 min read
Claude Code Regression Testing After Prompt Changes: Steps
Claude Code regression testing after prompt changes: capture a baseline, grade both versions, and set a flaky-run threshold before you trust a CLAUDE.md edit.
· 19 min read
AI Agent Evaluation Metrics: Pass Rate Across Repeat Runs
AI agent evaluation metrics for Claude Code: compute pass@k, pass^k, variance across N reruns and judge-score drift to catch flaky or silently wrong runs.
· 15 min read
CLAUDE.md Best Practices: A Template for Unattended Agents
CLAUDE.md best practices for headless and scheduled Claude Code runs: a ready template, the --bare trap, and rules that stop overnight agents stalling.
· 18 min read
AI Agent Evaluation Framework: Claude Code Eval Loop Steps
An AI agent evaluation framework for Claude Code: write tasks and graders, run each several times, and track pass rate and pass^k. Includes a harness.
· 17 min read
AI Agent Monitoring in Claude Code: Catch Silent Failures
AI agent monitoring for solo builders: use Claude Code hooks, a cron wrapper and a free heartbeat check to catch silent failures without a monitoring stack.
· 18 min read
Claude Code Headless Mode: Flags, Auth and Cost (2026)
Claude Code headless mode explained: the -p flags, output formats, API key vs setup-token auth, and cost caps you need for unattended cron and CI runs.
· 18 min read
Claude Code on VPS: systemd Setup That Survives Reboots
Run Claude Code on a VPS unattended: install on Ubuntu or Hostinger, store a token safely, schedule jobs with systemd timers, and harden SSH and firewall.
· 16 min read
Claude Code Subagents Model Selection: Role-by-Role Table
Claude Code subagents model selection made practical: when to give each subagent Haiku, Sonnet, Opus or inherit, with official prices, steps and fixes.
· 19 min read
Claude Code Stuck on Compacting Conversation: Cron Watchdog
Claude Code stuck on compacting conversation? Why it hangs in headless and cron runs, the real auto-compact defaults, and a watchdog script that recovers.
· 17 min read
Claude Code Subagent allowed-tools: Syntax, Examples, Fixes
Claude Code subagent allowed-tools explained: the real field is tools, plus disallowedTools, MCP wildcards, inherit vs restrict, and hooks that enforce it.
· 16 min read
AI Agent vs Automation: A 5-Question Test for Claude Code
AI agent vs automation, settled with a 5-question test: when a Claude Code agent is worth its cost and when a plain script or cron job is the better choice.
· 16 min read
Claude Code Permissions Best Practices: Headless Template
Claude Code permissions best practices for unattended runs: a settings.json allow/deny template, mode picks, and pre-flight checks so overnight jobs finish.
· 10 min read
AI Agent Guardrails Example: Copy-Paste Claude Code Rules
An AI agent guardrails example for Claude Code: copy-paste permission rules, hooks and CLI caps that stop runaway loops, destructive commands and cost spikes.
· 10 min read
Claude Code Rate Limit Reached: Retry Setup for Cron Jobs
Claude Code rate limit reached? Tell a 429 throttle from a plan or spend cap, read the retry-after headers, and set safe auto-retries for headless cron jobs.
· 10 min read
Claude Code Hooks Examples: 7 Copy-Paste Scripts
Claude Code hooks examples you can copy: 7 working scripts for guardrails, Stop-hook stall prevention, and usage logging, with settings.json and fixes.
· 10 min read
Claude Code: How to See Token Usage (and Reduce It)
Claude Code how to see token usage: run /usage in a session, read total_cost_usd from headless JSON runs, check the Console Usage page, and set cost alerts.
· 9 min read
Claude Code Hooks Lifecycle: Every Event, Explained
Claude Code hooks lifecycle explained: when each hook event fires in an automation run, and which ones stop runaway token use or silent failures.
· 10 min read
Claude Code Cron Job Setup: Run Automations Overnight
Claude Code cron job setup: auth tokens, PATH, working directory, permissions, locks and log rotation, so overnight claude -p runs don't fail silently.
· 13 min read
Claude Code Checkpoints: How Rollback Works in Automations
How Claude Code checkpoints work in headless jobs (claude -p, Agent SDK): enable file checkpointing, save UUIDs, roll back runs, and know rewind's limits.
· 9 min read
Why Claude Code Stops Mid-Automation (and How to Fix It)
Why does Claude Code stop running headless automations? Map the turn, budget, timeout and permission triggers in claude -p runs, plus a fix checklist.