Claude Code guides
Practical, free, and checked against the official docs.
- Claude Code hooks: block dangerous commands
Build a PreToolUse hook for Claude Code that blocks rm -rf, force pushes and DROP TABLE. Exit code 2, JSON deny, settings.json and tests.
- CLAUDE.md best practices with @imports
Where CLAUDE.md files live, how to keep them under 200 lines, how @path imports and .claude/rules work, and a starting template.
- Running Claude Code safely on a server
Permission modes, a non-root user, deny rules, hooks, backups and a restore test: the safeguards for letting Claude Code work on a server.
- Run Claude Code unattended with cron or systemd
claude -p in a scheduled job: JSON output, budget cap, tool allowlist, a systemd timer, and the usual first-run failures (login, PATH, hooks).
- Keep Claude Code running after an SSH disconnect
Claude Code dies when SSH drops? Run it in tmux, reattach from anywhere, resume with --continue after a reboot, and keep a detached session safe.
- Claude Code costs: see usage, keep context small, cap spend
How to check what a Claude Code session costs (/usage), why it grows, how /clear and /compact help, and how --max-budget-usd caps unattended runs.
- Add an MCP server to Claude Code
claude mcp add explained: HTTP vs stdio, local, user and project scope, .mcp.json, approval, login, and keeping servers safe on a server.
- Claude Code subagents and skills
Subagent or skill? Working .claude/agents and SKILL.md examples, every frontmatter field checked in Claude Code 2.1.327, and how to keep both safe.
- Run Claude Code in the background with claude --bg
claude --bg, agents, logs, attach, stop, rm and respawn explained, checked in Claude Code 2.1.328, and when tmux is still the better choice.
- Claude Code permissions and settings: allow, ask, deny
How Claude Code permission rules work: allow, ask and deny order, settings file precedence, Bash patterns, permission modes and a safe starting file.
- Claude Code with git worktrees: run parallel sessions safely
Run several Claude Code sessions side by side without overwriting each other: claude --worktree, plain git worktree commands, what is not shared, and cleanup.