Back to articles
Tutorial

Skills and Hooks for AI Coding Agents: Stop Pasting the Same Playbook

If your team pastes the same release checklist into every agent chat, you are doing it wrong. Use skills for procedures and hooks for guarantees -- a practical playbook for Claude Code and Cursor-style agents.

8 min read

The Copy-Paste Playbook Tax

Every team eventually invents a ritual:

  • "Before you open a PR, run these checks..."
  • "When reviewing auth changes, verify X, Y, Z..."
  • "Never commit until the formatter passes..."
  • If that ritual lives only in Slack or in someone's head, agents will skip it. If you paste it into every chat, you waste tokens and still get drift.

    The fix is two mechanisms modern coding agents already support:

    1. Skills -- on-demand procedures and reference packs

    2. Hooks -- deterministic actions the harness runs whether the model feels like it or not

    ---

    Skills: Procedures That Load When Needed

    A skill is a markdown (plus optional scripts/resources) package the agent can invoke by name or by relevance.

    On Claude Code, skills typically live in `.claude/skills/<name>/SKILL.md` with a name, description, and body. Only the description stays hot; the body loads when used. Cursor's skill system follows the same idea: specialized workflows that should not consume always-on context.

    Good skill candidates

  • `/review-pr` -- structured diff review rubric
  • `/release` -- version bump, changelog, tag, deploy checklist
  • `/incident-triage` -- log gather, blast radius, comms template
  • API reference packs that are long but rarely needed
  • Bad skill candidates

  • "Always use TypeScript" (that is an always-on rule)
  • "Run prettier" (that should be a hook or pre-commit)
  • Write skill descriptions as triggers so auto-selection works: "Use when preparing a production release for the web app."

    ---

    Hooks: Guarantees Outside the Model

    Hooks fire on lifecycle events: after file edits, before tool calls, when the agent tries to stop, on compact, and similar points.

    Use hooks for anything that must happen even if the model is tired, confused, or creative:

  • Format or lint after edits
  • Block `rm -rf`, force-push, or prod DB access
  • Require `npm test -- <touched>` before stop
  • Secret scanning before commit
  • Notify Slack when a long cloud agent finishes
  • Anthropic's guidance is blunt: instructions in markdown are non-deterministic; hooks and deny rules are enforced by the harness. Prefer command/HTTP hooks with failure blocking for safety-critical checks.

    ---

    A Practical Split for One Repo

    ConcernMechanism
    Package manager is pnpmAlways-on `AGENTS.md` / rules
    Auth handlers must validate with ZodPath-scoped rule
    How we cut a releaseSkill
    How we review payment PRsSkill
    Formatter after every editHook
    Deny writing `.env`Permission / hook
    Deep dependency auditSubagent + summary

    If a section of `CLAUDE.md` or a Cursor rule has become a multi-step procedure, move it to a skill. If a prose rule is still being violated, promote it to a hook or CI check.

    ---

    Team Rollout Tips

    1. Start with one skill your team already pastes weekly

    2. Add one hook that removes a recurring review comment ("forgot to format")

    3. Check skills and hook configs into git

    4. Review changes to them like code -- bad skills ship bad habits at scale

    5. Keep always-on files shrinking as skills grow

    ---

    Who This Is For

    Perfect for: teams using Claude Code, Cursor, or similar agent harnesses on shared repositories.

    Skip if: you only use autocomplete and never run multi-step agents.

    ---

    Bottom Line

    Skills remove the paste tax. Hooks remove the honor-system tax. Together with a short `AGENTS.md`, they turn "please remember our process" into a system the agent can actually follow -- and that CI can still verify.

    Found this helpful?Share this article with your network to help others discover useful AI insights.

    Share your thoughts on X or Facebook