Skip to content

Day 2: Skills: Memory & Automation

Day 1 got Claude Code installed and making commits. Today is about the four systems that turn it from a fast code-generating assistant into something you can automate: custom slash commands and skills, hooks that fire on events, piping and scripting for non-interactive workflows, model selection and cost controls, and the settings hierarchy that ties it all together.

These are the features that distinguish someone who uses Claude Code from someone who has bent it around their own workflow. By the end of today you'll have written your own slash commands, wired up hooks that block or transform tool calls, scripted Claude Code into a pipeline, and locked in a model-and-cost strategy you can trust.

What you'll have by the end of today

  • At least two custom slash commands or skills loaded and working, one project-scoped and one personal
  • A hook that fires on a real tool event and either logs it, blocks it, or transforms the input
  • A pipe-and-script workflow that runs Claude Code headlessly in a shell pipeline and produces structured output
  • A cost-management setup with per-task budgets, fallback models, and the /cost command used to verify your choices
  • A settings file that layers project defaults under personal preferences, with permissions that match your risk tolerance

Lessons

  1. Custom Commands and Skills, the two extension mechanisms Claude Code provides for teaching it reusable procedures: slash commands invoked with /name and skills loaded automatically from .claude/skills/. Bundled commands, the CLAUDE.md relationship, and dynamic context injection.
  2. Hooks, event-driven automation that fires on tool use, session boundaries, and user prompts, blocking, transforming, logging, or redirecting Claude's behavior. The event catalog, exit-code semantics, and the permission decision hook.
  3. Pipe, Script & Automate, running Claude Code headlessly in shell pipelines, extracting structured JSON output, resuming long sessions, and making it a composable Unix tool in your scripts.
  4. Model Selection & Cost Management, choosing models by capability and price, reasoning effort controls, fallback chains, budget caps, and reading the /cost and /context dashboards.
  5. Settings and Configuration, the full settings hierarchy from CLI flags to global defaults, the permissions system (allow/ask/deny), and how settings files compose across project, local, and personal scopes.

Prerequisites: Claude Code installed, authenticated, and completing real work (Day 1). You should be comfortable with the CLAUDE.md file, print mode, and interactive sessions.

Next: Day 3, Subagents & Teams, where Claude Code starts coordinating parallel workstreams.