Skip to content
For your teamWhat one developer teaches an agent, a teammate’s agent can use.How it worksWhere a lesson starts and how it reaches every agent.Code reviewYour team’s knowledge, checked in every PR.SecurityWhat it sends, what it changes and how to leave.Book a call30 minutes with Roei, if you want a hand. Never required.
On your ownYour corrections follow you across agents and repos.Install itnpx harborloop init, in your repo.Every commandWhat the CLI does, and how to take it off again.
DocsPricingSign in
Start free →
For teamsFor individualsHow it worksCode reviewSecurityDocsPricingSign inStart free →
Home/Blog

Blog

  • Supermemory alternatives
  • PR review against AGENTS.md
  • Claude Code second brain
  • Why Copilot ignores it
  • Cursor Team Rules
  • Rules vs skills
  • Claude Tag vs Claude Code
  • GitHub Copilot Memory
  • Codex memories
  • Cursor memories
  • Claude Code auto memory
  • Claude Code team memory
  • Supermemory Company Brain alternatives
  • 3,905 files checked
  • Why Codex ignores it
  • Mem0 alternatives
  • Codex skills
  • Karpathy's LLM wiki
  • Auto mode
  • Memory or documentation?
  • Best company brain tools
  • Claude Code and AGENTS.md
  • Claude Code skills
  • Claude Code hooks
  • claude-mem
  • Claude Code best practices
  • Karpathy CLAUDE.md
  • AGENTS.md vs CLAUDE.md
  • Cursor rules
  • copilot-instructions.md
  • Why Claude ignores it
  • CLAUDE.md length
  • Committing CLAUDE.md
  • Agent memory compared
  • CLAUDE.md vs skills vs hooks
  • Make Claude Code remember
  • Review comments to rules
  • Slack decisions
  • Company brain
  • Context engineering, Claude 5
  • Context rot, stale rules
  • AGENTS.md research
  • ADRs for agents
  • Memory poisoning
  • Best MCP memory servers
  • Shared memory across agents
  • Growing CLAUDE.md
  • Which rules got used

Blog

CLAUDE.md vs skills vs hooks vs rules vs subagents

Published: October 30, 2026

Put a team rule where its cost matches its reach. CLAUDE.md holds the few facts every session needs. Path-scoped rules hold what applies to one part of the tree. Skills hold procedures and reference loaded on demand. Hooks and permissions hold what must never happen. Subagents hold side work, not rules.

The mechanics below come from Anthropic's extension overview, the memory docs, and the June 2026 post Steering Claude Code, checked 2026-09-23 against Claude Code 2.1.280. That post puts the whole trade in one line: “Each method trades context cost against authority.”

CLAUDE.md vs rules vs skills vs hooks vs subagents, side by side

MechanismWhen it loadsEnforced?Context costKnown failure mode
CLAUDE.mdSession start, full text; nested files when Claude reads, writes or edits in that directoryNo. Delivered as a user message after the system promptEvery requestContradictions, stale lines, adherence drops as it grows past about 200 lines
.claude/rules/ (no paths)Session start, same priority as .claude/CLAUDE.mdNoEvery requestSame as CLAUDE.md; easy to grow unnoticed
.claude/rules/ (paths:)When Claude reads, writes or edits a matching fileNoOnly after a matchDoes not trigger on every tool use; a single-file Bash read loads it since 2.1.293, a Bash edit does not
SkillName and description every turn; body on invoke or auto matchNoLow until usedVague or overlapping descriptions mean the skill is missed
SubagentWhen spawned, in its own context windowNoIsolated from the main sessionSees none of the parent conversation; rules must be in its prompt or CLAUDE.md
HookOn lifecycle events (PreToolUse, PostToolUse, SessionStart and others)Yes. Runs as code; exit 2 on PreToolUse blocks the callZero unless it returns outputPattern matching in your script can miss a variant of the command
Permission ruleChecked by the client on every tool callYesZeroOnly covers tools and paths, not judgment

What belongs in CLAUDE.md?

Facts Claude should hold in every session and cannot read off the code: the build and test commands, the one gotcha that bites every newcomer, a convention that differs from the tool's default. The docs say to keep it under 200 lines, and warn that longer files “consume more context and reduce adherence.”

The test is reach. If a line matters for one directory, one file type, or one workflow, it is paying rent on every request for a task that does not need it. Move it. And do not split a long file with @imports to shrink it: imported files still load at launch.

Claude Code rules vs CLAUDE.md

A rule in .claude/rules/ without frontmatter is CLAUDE.md in a separate file. It loads at launch with the same priority. The organisational win is real; the context win is nothing.

The context win comes from paths:. A rule scoped to payments/** reaches Claude when it reads, writes or edits a payments file, and not while it edits CSS. Two caveats. Path-scoped rules trigger “when Claude uses the Read, Write, or Edit tool on a file matching the pattern, not on every tool use,” so a session that only greps and runs commands may never see the rule. And a rule a user wrote in ~/.claude/rules/ sits beside the project's; if they conflict, “Claude may follow either one.”

# .claude/rules/payments-webhooks.md
---
paths:
  - "payments/webhooks/**/*.ts"
---

- Webhook handlers are idempotent: dedupe on the provider event ID
  before any write. Decided in #eng-payments after the double refund.

When should I use a skill instead of CLAUDE.md?

When the content is a procedure or reference you need sometimes. The steering post says it directly: “Instructions that are procedural, like deploy workflows, release checklists, or review processes, belong in a skill.” Only the name and description ride along every turn. The body loads when you type /release or Claude matches the description to the task.

The failure mode is the matching. The overview warns that if descriptions are vague or overlap, Claude “may load the wrong skill or miss one that would help.” Vercel measured the size of that gap on their own Next.js evals in January: the skill was never invoked in 56 percent of cases, and an 8KB docs index placed in AGENTS.md scored 100 percent against 79 percent for the best skill setup (Vercel). One team's eval, on one framework, but the lesson carries: a skill is only as good as its trigger. Anything Claude must know before it knows to ask belongs in the always-on layer, stated short. How Cursor, Copilot and Codex split the same two jobs, and which skill folder each one reads, is in rules vs skills across four agents. The format itself, frontmatter and all, is in how to write a skill.

Hooks vs skills

A skill is text Claude reads and interprets. A hook is code the client runs. The overview table says it in two cells: a hook “always fires on its event; the trigger is guaranteed,” while with a skill “Claude interprets the instructions; outcome can vary.”

So guardrails go in hooks. The docs' own example: “never edit .env” in CLAUDE.md or a skill “is a request, not a guarantee. A PreToolUse hook that blocks the edit is enforcement.” A PreToolUse deny holds even in bypassPermissions mode. For a plain allow or deny on a command, the hooks guide prefers permissions.deny in settings, because a hook's own pattern matching is best effort.

The two combine well. A PostToolUse hook runs the linter after every edit and feeds the output back as text; a /fix-lint skill tells Claude how your team resolves what it finds. Events, exit codes and examples are in Claude Code hooks.

CLAUDE.md vs settings.json

CLAUDE.md is what Claude reads; settings.json is what Claude Code enforces. The memory docs put it in one line: “Use settings for technical enforcement and CLAUDE.md for behavioral guidance.” A committed .claude/settings.json carries the team's permission rules, hooks and environment variables, and its deny rules apply right away, while its allow rules wait until each teammate trusts the folder (settings docs, checked 2026-10-30 against Claude Code 2.1.314). Neither file is the system prompt: Anthropic does not publish it, and points standing instructions to CLAUDE.md or the --append-system-prompt flag.

Those deny rules and hooks matter more under Claude Code auto mode, where a classifier approves most calls instead of you.

Where do subagents fit?

Subagents are not a place to store a rule. They are a place to run a side task (a dependency audit, a log trawl) in a separate context window so the main conversation gets a summary instead of the noise. Each one starts fresh: it “doesn't see your conversation history, the skills you've already invoked, or the files Claude has already read.” It does load the same CLAUDE.md hierarchy, except the built-in Explore and Plan agents, which skip it.

That last clause is the one that bites. A team rule that only lives in the conversation, or in a skill the parent invoked, does not reach the subagent. Put rules a subagent needs in its own prompt, in its skills: list, or in CLAUDE.md.

A decision path for one team rule

  • Would breaking it destroy something? Hook or permission rule. Keep a one-line note in CLAUDE.md so Claude knows why it was refused.
  • Does it apply to every task in the repo? CLAUDE.md, one line, concrete enough to check.
  • Does it apply to one part of the tree? A path-scoped rule. Unscope it if the work there often happens through Bash.
  • Is it a procedure or a long reference? A skill with a description that names the task in the words people use.
  • Is it only yours? CLAUDE.local.md or your user files, not the repo.
  • Is it no longer true? Delete it. See stale rules.

Cursor rules vs skills: the equivalents

Cursor has converged on nearly the same set, per its rules, skills, hooks and subagents docs, checked 2026-09-23.

Claude CodeCursor
CLAUDE.mdAGENTS.md, or a rule set to Always Apply
Path-scoped ruleRule set to Apply to Specific Files (globs)
Skill, auto matchedRule set to Apply Intelligently, or a skill in .cursor/skills
Skill, invoked by nameRule set to Apply Manually (@-mention)
Hookhooks.json; exit code 2 blocks, like Claude Code
Subagent.cursor/agents, each with its own context window

The same rule of reach applies. The difference that matters for teams is that the two tools read different files, which is the subject of AGENTS.md vs CLAUDE.md. For skills on the OpenAI side, and sharing one set with Claude Code, see Codex skills.

What none of these mechanisms do

Every mechanism above answers “how does this text reach the model?” None answers “is this still what we decided?” or “did anyone use it?” The webhook rule in the example came out of a thread in #eng-payments. Someone had to notice it, write it into the right file, keep it in sync with the Cursor copy, and remember to delete it when the team changes its mind.

That gap is what Harbor is for. It reads where the team already decides (Slack, PR review threads, docs), a person or your policy approves the result, and each agent is served only the facts that apply to the task on turn one, through hooks it installs for Claude Code, Codex and Cursor. It counts, per rule, how often it was served and how often an answer cited it, and a fact whose subject leaves the repo can be retired. Guardrails for destructive commands observe by default; your team decides which ones block. See how Harbor reaches each agent or start with the quickstart. If a rule is being skipped rather than misplaced, read why Claude ignores CLAUDE.md.

Questions

When should I use a skill instead of CLAUDE.md?

Use a skill for procedures and reference material you need sometimes, like a release checklist. Only its name and description load every turn; the body loads when invoked or matched. Facts every session needs stay in CLAUDE.md.

What is the difference between hooks and skills in Claude Code?

A skill is text Claude reads and interprets, so the outcome can vary. A hook is code Claude Code runs on a lifecycle event, and a PreToolUse hook that exits with code 2 blocks the tool call. Guardrails belong in hooks or permission rules.

What is the difference between .claude/rules and CLAUDE.md?

A rule without paths frontmatter loads at launch like CLAUDE.md. A rule with paths loads only when Claude reads, writes or edits a matching file, which saves context but means it may not load if the work happens only through Bash.

Do subagents read CLAUDE.md?

Custom subagents load the same CLAUDE.md hierarchy as the main session, but not its conversation or the skills it invoked. The built-in Explore and Plan agents skip CLAUDE.md.

What are the Cursor equivalents of CLAUDE.md, skills and hooks?

AGENTS.md or an Always Apply rule for CLAUDE.md, Apply to Specific Files rules for path-scoped rules, skills in .cursor/skills or Apply Intelligently rules for skills, hooks.json for hooks, and .cursor/agents for subagents.

Your team’s rules, in every agent, checked on every PR.

Harbor is shared memory for your team’s Claude Code, Cursor, Codex and Copilot. Free for you and one teammate. No card. No end date.

Start free →

Product

  • How it works
  • Every agent
  • Code review
  • The result
  • Security
  • For coding agents
  • Pricing

Developers

  • Docs
  • Quickstart
  • CLI
  • MCP server
  • Served and cited
  • Rule-file checker
  • Blog

Guides

  • Why Claude ignores CLAUDE.md
  • AGENTS.md vs CLAUDE.md
  • Does Claude Code read AGENTS.md?
  • Why Codex ignores AGENTS.md
  • Why Cursor ignores rules
  • Copilot instructions vs AGENTS.md
  • Shared memory across agents
  • Make Claude Code remember

Compare

  • vs Mem0
  • vs Zep
  • vs Unblocked
  • vs ByteRover
  • vs Cognee
  • vs Hindsight
  • vs OpenViking
  • vs Supermemory
  • vs Glen

Company

  • Questions
  • Contact
  • X
  • LinkedIn
  • Privacy Policy
  • Terms of Service
  • Data Processing Agreement
  • Refund Policy
© 2026 HarborStart free