Single logo
  • Courses
  • Blog
  • About
Join on SkoolJoin on Skool

In this topic

Claude
  • CLAUDE.md, settings.json and Plugins: Which Claude Code File Advises, Which Enforces, Which Packages
  • Authoring a Claude Skill: SKILL.md, Frontmatter, Progressive Disclosure and the Description That Triggers It
  • One Change, Four Environments: Where a Claude Config Edit Lands in Dev, Staging, Prod and CI
  • Claude in the SDLC: Prompts in Git, a Change Gate by Path, a Claude Review That Advises and a Person Who Merges
  • Hooks That Block Destructive Actions: a PreToolUse Gate That Allows, Asks or Denies
  • Choosing a Claude Code Extension: Skill, Hook, Rules File, Subagent, Slash Command or Plugin
  • Rolling Out Claude Code to a Team: Settings Precedence, dontAsk in CI, a Hook for Every-Time Rules and a Plugin for Five Repos
  • A Claude Code Review Bot in CI: Headless -p, JSON Findings, Team Rules in Git and a Person on the Merge
  • Lab: Three Planted Bugs in a Claude Code CI Repo, a Permission Mode, a Plugin Path and an MCP Token Variable
  • Configuring MCP Servers in Claude Code: A Command or a URL, Three Scopes, and Three Moves When One Breaks
  • The Claude Messages API: Your First Call, Field by Field
  • Claude Tool Use: How tool_use and tool_result Work in the Messages API
  • Claude Client SDKs Wrap One REST API: Raw HTTP, Python, TypeScript and Async Calls Compared
  • Anthropic SDK Timeouts, Retries and Error Classes: Configure the Client Once, Then Give 429, 529, 400 and Timeouts Their Own Move
  • Claude Streaming Events: The Event Order, message_stop, Tool Arguments, Stop Reasons and a WebSocket Relay
  • Images, PDFs and Thinking Blocks in the Claude Messages API: Typed Blocks In, Typed Blocks Out
  • Getting Data Into Claude: PDF Documents, the Files API, Search Results and Citations
  • Opus, Sonnet or Haiku: Pick the Claude Model per Job, and Test the Request When a New Release Arrives
  • Adaptive Thinking and Effort in Claude: Two Dials, Set per Workload, and the Thinking Block You Must Pass Back
  • Claude Cost Tracking From usage: Count Before, Cap During, Read After, Then Find the Line That Drives the Bill
  • Claude Cache Breakpoints: Where to Put cache_control, How to Move It With the Chat, and Why the Reads Stay at Zero
  • Claude Message Batches or Real Time: Choose by Who Is Waiting, Match by custom_id, Resend Only the Failures
  • Calling Claude Through Amazon Bedrock, Google Cloud and Microsoft Foundry: Same Call, Different Door
  • The Life Cycle of a Claude App: Six Phases, a Model That Retires, and a Release Gate for Every Change
  • Pinning Claude Model IDs and Upgrading Safely: One Change at a Time, a Golden-Set Replay and a Staged Rollout
  • Content Boundaries and Schema Design for Claude: Fence the Input in a Tag, Let the Output Say I Don't Know
  • The Agentic Loop and stop_reason: Keep Turning on tool_use, Stop on end_turn, Cap the Turns
  • The Claude Agent SDK: query(), ClaudeAgentOptions and @tool, in Python and TypeScript
  • Fix the Agent: Four Broken Claude Agent SDK Configs, From the Symptom to the One Wrong Line
  • Claude Managed Agents: Cloud Sandbox, Self-Hosted Sandbox or Self-Hosted Service
  • Agent SDK Hooks for Deterministic Actions: PreToolUse, PostToolUse, and Four Hooks That Fail Silently
  • Memory and Context-Window Patterns for Claude Agents: Context Editing, Compaction and the Memory Tool
  • Reading an Agent Trace: Five Signatures, Five Missing Patterns, and How Long a Fact Must Live
  • Tool Descriptions for Claude: How Claude Picks a Tool, and How to Stop It Picking the Wrong One
  • Tool Input Schemas and Error Responses for Claude: Required Fields, Enums, is_error and a Retry Flag
  • Tool Response Shaping and a Lean Tool Set: Give Claude a Sticky Note, Not the Filing Cabinet
  • Fix the Tool Schema: Read the Trace, Fix the Card, Re-Run (Four Real Schema Bugs)
  • Client Tools, Server Tools and Approval Gates: Who Runs the Tool, and Who Says Yes First
  • Built-in Tool, Custom Tool, Skill or MCP Server? Pick the Lightest One That Fits
  • System Prompt or User Turn: Where Each Instruction Goes, and Output Limits Your Code Enforces
  • Refine the Prompt One Line at a Time, Then Clean and Fence the Customer's Text
  • Prompt Revision Driven by Evals: Name the Cause, Change One Thing, Rerun the Whole Suite
  • Long-Running Sessions: Compact, Prune, Isolate or Start Fresh, Decided by Naming the Failure
  • Context Isolation Through Subagents: Read the Logs Elsewhere, Keep One Line
  • Defensive Parsing of Claude Replies: Check the Stop Reason, Read the Block or the Text, Then Validate the Values
  • Full Context or Retrieval: Choose by Corpus Size, Cost and Freshness
  • Skepticism Toward Confident Output: Check the Quote, the Record and the Sum Before You Send
  • Debugging a Claude App: Three Error Types, the Recovery Each One Earns, and the First Failing Row
  • Six Ways a 200 Can Still Be Wrong: Hallucination, Refusal, Under-Acting, Context Loss, Format Drift and Inconsistency
  • Fix the Cause, Not the Symptom: Four Recovery Drills for an LLM App, Each Checked on a New Input
  • Integration Layer or Model Output? Three Taps and Three Questions to Find Where a Wrong Answer Lives
  • Which Test Layer Owns the Failure? Unit, Functional, Integration and End-to-End Tests for a Claude App
  • Designing an Overnight Document Pipeline on Claude: Batch Lane, Live Lane, a Cached Prefix and a custom_id Reconcile
  • Proving a Model Upgrade Is Ready: A Frozen Golden Set, a Calibrated Judge, the Right Layer and a Release Gate
  • From Requirement to Design for a Claude App: Eight Requirements, Five Elements and a Trace With No Gaps
  • Build a Claude Refund App: the Messages API, Two Tools, an MCP Server and a Hook in One Loop
  • Ship a Claude App: an Eval Gate, Two Guardrail Layers, a Cost Check From usage and a Pinned Model
  • Lab: a 30-Case Golden Set, a Calibrated Judge and a Per-Slice CI Gate on a Claude Refund App
  • Lab: Cut a Claude App's Bill by 62 Percent With Usage Data, Layered Cache Breakpoints and a Batch Job
  • Lab: Three Planted Bugs in a Claude App, a Vague Prompt, a Mistyped Tool Schema and a Broken Stream Handler
  • Lab: Three Planted Bugs in a Claude Code CI Repo, a Permission Mode, a Plugin Path and an MCP Token Variable
  • Lab: Harden a Claude App, an Uncalibrated Judge, a Retry Loop That Retries Everything and a Hook Matcher With a Gap
  • Lab: Turn a Claude App Into a Reusable Template, One Pinned Model Id, No Key in Code and Evals Built From Data
  • Building an MCP Server: Tools, Resources and Prompts in Python and TypeScript
  • MCP Transports: stdio or Streamable HTTP, and Who Starts the Server
  • Deploying and Authenticating an MCP Server: Environment Keys for stdio, Bearer Tokens and Scopes for HTTP
  1. Blog
  2. /
  3. Claude
  4. /
  5. Claude Code

Choosing a Claude Code Extension: Skill, Hook, Rules File, Subagent, Slash Command or Plugin

A support team has six jobs it repeats by hand. Four questions (trigger, same every time, scope, owner) send each one to its home in Claude Code: a skill, a hook, a rules file, a subagent, a slash command or a plugin. Plus where each file lives and which file wins when two disagree.

Chaand Sheikh

·27 November 2026Claude Code

What you will learn

  • Pick the right home for a repeated job with four questions: trigger, same every time, scope and owner
  • Place each extension file where Claude Code looks for it, and spot the three common misplacements
  • Say which file wins when settings, skills or subagents clash, and why hooks and CLAUDE.md files never compete
  • Tell guidance (rules file, skill) apart from enforcement (hook)

Before you start

  • Basic use of Claude Code in a terminal
  • Reading JSON and Markdown files

A support team keeps doing the same jobs by hand. Someone says, "we repeat this every week", and the next question is always the same: where does this job belong?

Claude Code gives you six ways to extend it: a skill, a hook, a rules file, a subagent, a slash command and a plugin. They overlap just enough to be confusing. In this article we take six real jobs, ask four questions about each, and find each one its home. Then we look at where the files live and what happens when two files disagree.

Six jobs we repeat

Here is the team's list.

  1. Review a refund change against our policy checklist, item by item.
  2. Format the Python code after every single file edit, whoever made it.
  3. Follow our typing and test style whenever we work in the source folder.
  4. Scan a huge log and report only a short summary of what failed.
  5. Type one word and get a summary of yesterday's commits, grouped by feature.
  6. Share the refund check with every other support repo, without copying files.

Each job needs a different home. Choosing that home is the whole skill.

One kitchen, six ways to run it

Think of a busy kitchen.

  • A recipe card: you read it when you cook that dish, then follow the steps. That is a skill.
  • A door sensor: the light switches on every time, and nobody decides. That is a hook.
  • A poster on the wall: everyone sees it and is asked to follow it. That is a rules file.
  • A prep cook in the back room who brings back only the result. That is a subagent.
  • A button on the till: one press sends a saved order. That is a slash command.
  • A starter box packed for a new kitchen. That is a plugin.

Four questions pick the home

For any job, ask: what triggers it? Must it be the same every time? How far does it reach? Who maintains it?

MechanismTriggerSame every time?ScopeWho maintains it
Skillyou type /name, or Claude matches the descriptionno, Claude follows itproject or personalthe workflow's owner
Hooka lifecycle eventyes, it fires every timeproject, user or pluginthe tooling owner
Rules filesession start, or when a matching file opensno, it is guidancewhole project, or some pathsthe whole team, by pull request
SubagentClaude or you delegate a taskno, its own contextproject or personalthe team that uses it
Slash commandyou type /nameno, a saved promptproject or personalits author
Plugininstalled once, then enabledits parts decidemany repositoriesthe plugin author, versioned

The last column is a rule of thumb, not a rule from the docs. One more detail: plugin skills are namespaced, like /support-kit:refund-check, so two plugins never clash.

Which extension fits a repeated job Must run on every event, no judgment? Must reach many repositories? Big job, only the result should come back? Standing guidance for the project or a path? Needs judgment, step by step, on request? A saved prompt you type? Hook (#2) Plugin (#6) Subagent (#4) Rules file (#3) Skill (#1) Slash command (#5)
Each of the six jobs lands in one home. Only the hook is enforcement; the rest are things Claude reads or you ask for.

Each job finds its home

  • Refund checklist: it needs judgment on each item, and you ask for it by name. A skill.
  • Format after each edit: it must run every time, with no judgment. A hook.
  • Typing and test style: guidance, for the source files only. A rules file.
  • Huge log: it should stay out of the main chat and return only a summary. A subagent.
  • Yesterday's commits: a saved prompt you type. A slash command.
  • Share with other repos: one install for many repositories. A plugin.

Where each one lives

Claude Code reads set places, so a file anywhere else is never found. Here is the sample repo from the lecture.

CLAUDE.md                              rules file, always loads
.claude/settings.json                  hooks block (shared, committed)
.claude/settings.local.json            your local overrides
.claude/rules/python-style.md          rules file limited to some paths
.claude/skills/refund-check/SKILL.md   skill (a folder with SKILL.md)
.claude/agents/log-scanner.md          subagent
.claude/commands/standup.md            slash command
support-kit/.claude-plugin/plugin.json plugin manifest
support-kit/skills/refund-check/SKILL.md  plugin skill

The hook: settings.json

The hook lives in the shared settings file. It is committed, so the whole team gets it.

{
  "model": "sonnet",
  "hooks": {
    "PostToolUse": [
      {
        "matcher": "Write|Edit",
        "hooks": [
          { "type": "command", "command": "ruff format ." }
        ]
      }
    ]
  }
}

PostToolUse means "after a tool has finished". The matcher Write|Edit limits it to file changes. And ruff format . runs every single time. Claude does not decide.

The skill: a folder with SKILL.md

---
name: refund-check
description: Checks refund code against
  our policy checklist.
---
Walk the change through these items:
1. The amount is an integer in cents.
2. Big refunds need a human approval.
3. Every refund writes an audit line.

The subagent, the rules file and the command

---
name: log-scanner
description: Scans long support logs for failed refunds and returns only a
  short summary. Use when a log is too big to read in the main chat.
tools: Read, Grep, Glob
---
You scan log files for failed refunds. Count the failures, group them by
error message, and return a summary of at most ten lines.

The rules file uses a paths list so it only applies to source files:

---
paths:
  - "src/**/*.py"
---
Use type hints on every function.
Write tests with pytest fixtures, not setUp methods.

And the slash command is a saved prompt, named after its file (/standup):

---
description: Summarise yesterday's commits for standup
---
Summarise the commits made since yesterday in three bullet points,
grouped by feature. Skip merge commits.

Skills and slash commands share one mechanism, and the docs prefer a skill for new work.

Each home has its own deep dive: authoring a skill, CLAUDE.md, settings.json and plugins, hooks that block destructive actions and context isolation through subagents.

When two files disagree

Settings can come from three files. Skills and subagents can exist in your user folder and in the project. Who wins?

  • A setting key: local file, then project file, then user file. The first one that sets the key wins.
  • A skill with the same name: the user folder wins over the project folder.
  • A subagent with the same name: the other way round, the project folder wins.
  • Hooks do not compete. Every hook for the same event fires, from the project and from the user.
  • CLAUDE.md files all load and add up. Claude weighs any conflict, so there is no winner.

The lecture's small Python checker, winner.py, encodes that order (highest priority first):

SETTINGS = {
    "local": ".claude/settings.local.json",
    "project": ".claude/settings.json",
    "user": "home/.claude/settings.json",
}
HOME = {"user": "home/.claude", "project": ".claude"}
SKILL_ORDER = ["user", "project"]
AGENT_ORDER = ["project", "user"]


def setting_values(key):
    found = [(s, load(s)) for s in SETTINGS]
    return [(s, d[key]) for s, d in found if key in d]


def name_winner(order, subpath):
    for scope in order:
        if (ROOT / HOME[scope] / subpath).exists():
            return scope

Running main.py over the sample repo checks the placement of every file, tries three misplaced paths, and prints the winners. This is plain Python reading files, no model involved:

PLACEMENT
ok .claude/skills/refund-check/SKILL.md = skill
ok .claude/settings.json = hook
ok .claude/rules/python-style.md = rules file
ok .claude/agents/log-scanner.md = subagent
ok .claude/commands/standup.md = slash command
ok support-kit/.claude-plugin/plugin.json = plugin
no .claude/skills/refund-check.md
fix: .claude/skills/refund-check/SKILL.md = skill
no .claude/agent/log-scanner.md
fix: .claude/agents/log-scanner.md = subagent
no support-kit/.claude-plugin/skills/refund-check/SKILL.md
fix: support-kit/skills/refund-check/SKILL.md = plugin skill
WINNERS
model: local opus, project sonnet, user haiku
-> the local settings file wins
skill refund-check in two places -> user wins
subagent log-scanner in two places -> project wins
PostToolUse hooks that fire: 2
project hook: ruff format .
user hook: echo file changed

Common mistakes

  • A flat skill file. .claude/skills/refund-check.md is never found. A skill is a folder with SKILL.md inside.
  • A singular folder. .claude/agent/ is wrong. Subagents live in .claude/agents/.
  • Skills inside the manifest folder. Only plugin.json goes in .claude-plugin/. The plugin's skills sit at the plugin's root.
  • A rule that must always hold, written in CLAUDE.md. CLAUDE.md is guidance. If the format must run every time, it needs a hook.
  • A checklist that needs judgment, written as a hook. A hook runs a command; it can't weigh items. That is a skill.
  • Copying the files into every repo. To share properly, package a plugin with a version.

Quick recap

QuestionWhat it tells you
What triggers it?You (skill, slash command), Claude (skill, subagent), or an event (hook)
Same every time?If it must be, it's a hook, not a request
How far does it reach?A path, a project, a user, or many repos (plugin)
Who maintains it?Name the owner up front, so it stays alive

Choose by the workflow, not by habit.

Try it yourself

Write down three jobs your own team repeats in a repository. For each one, answer the four questions and name its home. If you picked CLAUDE.md for something that must happen every time, look again.

Tried the exercise? Share your answer or ask a question.

The StudyEasy AI Community is free to join, with the lesson files, notebooks and code.

Join free on Skool

Keep going in Claude · 6 of 66

Previous
Hooks That Block Destructive Actions: a PreToolUse Gate That Allows, Asks or Denies
Next post
Rolling Out Claude Code to a Team: Settings Precedence, dontAsk in CI, a Hook for Every-Time Rules and a Plugin for Five Repos

Related course on Udemy

Claude Certified Developer - Foundations (CCDV-F) Exam Prep

Build and ship Claude apps: the API, agents, tools and MCP, prompts, evals, security and model choice.View on Udemy ↗: Claude Certified Developer - Foundations (CCDV-F) Exam Prep (paid course, opens in a new tab)

Related posts

CLAUDE.md, settings.json and Plugins: Which Claude Code File Advises, Which Enforces, Which Packages

Three needs in one repo: a test command, a rule that Claude must never read .env, and a shared deploy skill. See which file each belongs in, how the settings layers merge, and what a plugin manifest carries.

Authoring a Claude Skill: SKILL.md, Frontmatter, Progressive Disclosure and the Description That Triggers It

Pack a support team's ticket-triage routine into one skill folder, then watch three requests load one, two or all three levels: the catalog, the SKILL.md body, and a script whose code never enters the context.

One Change, Four Environments: Where a Claude Config Edit Lands in Dev, Staging, Prod and CI

Change one line in a repo and ask where it lands. A small resolver for bookshop-bot shows that a new model id in settings.json reaches only CI, a prompt bump reaches dev and CI, and a prod block edit reaches only prod.

Claude in the SDLC: Prompts in Git, a Change Gate by Path, a Claude Review That Advises and a Person Who Merges

Follow one prompt edit from a branch to a merge: version prompts and the model pin like code, keep the API key in GitHub Secrets, gate changes by path, let Claude review the diff, and leave the merge to a person.

On this page

  • Six jobs we repeat
  • One kitchen, six ways to run it
  • Four questions pick the home
  • Each job finds its home
  • Where each one lives
  • The hook: settings.json
  • The skill: a folder with SKILL.md
  • The subagent, the rules file and the command
  • When two files disagree
  • Common mistakes
  • Quick recap
  • Try it yourself
Community · Free to join
Single logo

StudyEasy AI Community

Hosted onSkool

Learn AI engineering, share what you build, and connect with other learners.

  • Free resources: lesson files, notebooks and code

  • Ask questions and join engineering discussions

  • Meet real people learning and building with AI

Join free on Skool

Related course on Udemy

Claude Certified Developer - Foundations (CCDV-F) Exam Prep

Build and ship Claude apps: the API, agents, tools and MCP, prompts, evals, security and model choice.View on Udemy ↗: Claude Certified Developer - Foundations (CCDV-F) Exam Prep (paid course, opens in a new tab)

Single logo

Empowering Education, One Course at a Time

About
About usContact usFAQs
Legal
Terms of ServicePrivacy Policy

© 2026 StudyEasy Organization. All rights reserved.