Skip to content

Appendix

Cheatsheet · Claude Code

Structural reference, not a tutorial — dense, lookup-first. Commands and flags drift with releases; treat this as a starting point and confirm against…

Structural reference, not a tutorial — dense, lookup-first. Commands and flags drift with releases; treat this as a starting point and confirm against the live docs when something here feels stale. This is the mechanical-layer half of the course; the lasting layer (the six parts, the four layers) doesn't change even when these commands do.

Install & entry points

CommandDoes
claudeinteractive session in the current directory
claude -p "<prompt>"headless, one-shot — the shape every schedule/cron wrapper uses
claude --resumereattach to the most recent session
claude --model <name>pin a model for the session
claude mcp add <name> ...register an MCP server

Config file shapes

FileRole
CLAUDE.mdthe rules file — context layer; read every session, mandatory in this repo
.claude/settings.jsonproject harness config — permissions, hooks; committed, shared
.claude/settings.local.jsonpersonal overrides — gitignored
.claude/commands/*.mdcustom slash commands
.claude/skills/<name>/SKILL.mda skill — see Step 9
.claude/agents/*.mdsubagent definitions (tools, model, prompt)
.mcp.jsonproject-scoped MCP server declarations

The loop primitives

MechanismShape
/loop <interval> <prompt>in-session heartbeat; interval syntax like 5m, 1h
/loop <prompt> (no interval)self-paced, run-until-done — the conditional shape
CronCreate / CronList / CronDeletescheduled-task tools behind Routines; 50-task cap, 3-day expiry, jitter applied, no catch-up on a missed fire
CLAUDE_CODE_DISABLE_CRONenv var to hard-disable scheduling — the kill switch's harness layer
--worktree / isolation: worktreerun a task in an isolated git worktree

Permissions & harness guarantees

DirectiveEffect
/permissionsinteractive permission editor for the session
permissions.allow / permissions.deny in settings.jsonthe enforced list — this is where "never touch main" or "never read .env*" actually lives, not in CLAUDE.md prose
Hooks (PreToolUse, PostToolUse, etc.)shell commands the harness runs around tool calls — the lowest-level guarantee short of denying the tool outright

Sub-agents & MCP

ConceptShape
Agent toolspawns a sub-agent with its own tool subset, model, and context — used for research/parallel work, never as a call between two independently-scheduled loops
MCP serversconnectors for external systems; declared in .mcp.json or via claude mcp add; keep the tool count small and each write idempotent (Step 10)

Gotchas

  • CLAUDE.md is a request, not a guarantee — anything safety-critical belongs in settings.json permissions or a hook, per safety.md.
  • The 50-task cron cap and 3-day expiry are silent unless you check them — a Routine that "stopped working" is often just expired, not broken.
  • --resume reattaches to session memory, not your spine — the spine is still the file you wrote, not the transcript.

Sources: Claude Code mechanics — /loop, Cron* tools, permissions, hooks, skills, subagents, MCP — from Panaversity's Agentic Coding Crash Course (S2) and Scheduled Tasks: The Loop Skill & Cron Tools (S4); live reference: docs.claude.com/en/docs/claude-code. Full attribution: resources/sources.md.