Guides

Claude Code guides

Practical, tested configuration for Claude Code. Free to read and copy.

How to stop Claude Code from running rm -rf and other dangerous commandsUse a PreToolUse hook to block rm -rf ~, git reset --hard, force-push to main, curl | sh, DROP DATABASE and more in Claude Code. Tested regexes and a copy-paste script.Running Claude Code in CI and GitHub Actions safelyRun claude -p headlessly in any CI runner, or wire up the official Claude Code GitHub Action. Covers --bare, --allowedTools, --permission-prompts none, exit codes, and keeping an unattended run from doing damage.Using Claude Code for code reviewHow to get useful code reviews from Claude Code: review local diffs and GitHub PRs, use a reviewer subagent, and get verified, severity-ranked findings with file:line instead of noise.Reducing Claude Code token usagePractical ways to cut Claude Code costs: check what's filling context with /context, clear and compact deliberately, offload noisy work to subagents and hooks, and pick cheaper models.Using Claude Code for safe database migrationsA practical workflow for writing and reviewing database migrations with Claude Code: giving it real schema context, expand-contract changes, rollback checks, keeping it off production, and a review checklist.A systematic debugging workflow with Claude CodeA repeatable debugging process for Claude Code — lock in a reproduction first, force ranked hypotheses instead of guessing, bisect with git and subagents, then recover safely with checkpoints. Copy-paste prompts included.A safe git workflow with Claude CodeA practical git workflow for Claude Code: a branch per task, small commits, diff review, git worktrees for parallel sessions, secret scanning before commits, and a PR checklist.Claude Code setup for Go servicesSet up Claude Code for a Go service: a copy-paste CLAUDE.md, a PostToolUse hook that runs gofmt on every edited file, and a prompt for idiomatic table-driven tests.Claude Code hooks: 6 practical examples you can copyWorking Claude Code hook examples — block dangerous commands, protect .env files, auto-format after edits, scan for secrets, and get desktop notifications. Copy-paste settings.json included.Adding and using MCP servers in Claude CodeHow to add, list and remove MCP servers with claude mcp add, the difference between local, project and user scope, and what goes in a committed .mcp.json file.Setting up Claude Code in a monorepoHow to lay out CLAUDE.md files, package-level settings.json, and scoped skills so Claude Code only loads the conventions for the package you're touching, with copy-paste examples for a multi-package repo.Claude Code setup for Next.jsSet up Claude Code for a Next.js App Router project: a CLAUDE.md with commands and server component conventions, path-scoped rules, and hooks that run ESLint, Prettier and tsc automatically. Copy-paste files included.Get notified when Claude Code finishes or needs your inputSet up desktop notifications, sounds or a terminal bell for Claude Code on macOS and Linux using the Notification and Stop hooks. Copy-paste settings.json, plus fixes for when nothing shows up.Claude Code permissions: stop clicking "Allow" 100 timesSet up Claude Code permission modes and allow/ask/deny rules so safe commands run automatically, secrets stay unreadable, and risky actions still prompt. Includes a starter allowlist.Using plan mode in Claude Code for large changesHow to use Claude Code plan mode for large changes: enter it with Shift+Tab, /plan or a CLI flag, write prompts that produce reviewable plans, edit the plan before approving, and make plan mode the default for risky projects.Claude Code setup for Python projectsSet up Claude Code for a Python project: a CLAUDE.md with uv commands, a PostToolUse hook that runs ruff and mypy after every edit, and a pytest workflow. Copy-paste files included.Refactoring a large codebase with Claude CodeHow to refactor a large codebase safely with Claude Code: write characterization tests first, break the work into small verifiable steps, isolate sessions with git worktrees, and use plan mode to review structural changes before they touch disk.Generating changelogs and release notes with Claude CodeGenerate a changelog or release notes from git history with Claude Code: a reusable /release-notes slash command, a one-line claude -p script for CI, and how to keep the output accurate.Keeping secrets safe with Claude CodeStop Claude Code from reading or leaking your .env files and API keys. Deny rules for secrets, a copy-pasteable pre-commit secret-scanning hook, and env var hygiene in settings.json.Claude Code settings.json explainedWhere Claude Code's settings.json files live, which one wins, and how to configure permissions, environment variables, hooks and the default model, with copy-paste examples.How to write Claude Code skills that actually triggerA practical guide to Claude Code skills: SKILL.md structure, frontmatter fields, writing descriptions that trigger reliably, and a complete free example skill.Custom slash commands in Claude Code, and how skills replaced themHow .claude/commands/*.md slash commands work, why Claude Code merged them into skills, and how to migrate a command to a SKILL.md without losing anything.Claude Code subagents: setup and three useful examplesHow to define Claude Code subagents in .claude/agents, what the frontmatter fields do, and three practical examples: a code reviewer, a test runner on Haiku, and a security auditor.Test-driven development with Claude CodeHow to do TDD with Claude Code: write a failing test first, confirm it fails, implement, then mutation-check. Copy-paste prompts, and how to stop Claude editing tests to make them pass.CLAUDE.md: a template and what actually belongs in itWhat to put in CLAUDE.md for Claude Code, what to leave out, and a copy-paste template. Covers commands, conventions, landmines, @imports and file locations.

Skip the setup: get the tested versions

Keelwork bundles 10 workflow skills, 5 tested safety hooks (including a full guard-bash and a secret scanner), 3 subagents and 5 CLAUDE.md templates, with a one-command installer that safely merges into your settings.

Get Keelwork — $24 →