Vol. I · No. 1Edition: AfternoonEst. 2026AboutSearchRSS

The Sand Paper

Finding grains of sand with grains of sand.
A Journal of Intelligence Transfer
New · Afternoon · 3:15 PM PT
Agents & Coding

Where Each Rule Goes in a Claude Code Repo

CLAUDE.md for what is true every session, skills for what you need sometimes, hooks for what must never be skipped.

Annoying if ignored once: CLAUDE.md. A disaster if ignored once: a hook.

CLAUDE.md should not hold everything, @AlekVectis writes. Here is his split, checked against the Claude Code documentation.

FileWhat it holds
CLAUDE.mdWhat is true every session: build and test commands, the odd repo rules. Keep it short
.claude/settings.jsonPermissions, committed so the team gets them. A deny on Read(./.env) keeps secrets unread
.claude/settings.local.jsonYour own overrides for one project, kept out of git
.mcp.jsonProject MCP servers, so anyone who clones the repo gets the same tools
.claude/skills/name/SKILL.mdProcedures you need only sometimes, like release steps. Loads when the task calls for it
.claude/agents/Subagents with their own prompt and tool list, such as a reviewer that can read but not edit
hooks, in settings.jsonAnything that must happen every time. A PreToolUse hook that exits with code 2 blocks the call
From @AlekVectis’s post. Source for the settings and hook behavior: Claude Code docs.

The docs add two details for anyone writing a guard hook. Exit code 1 is only a non-blocking error, so a policy hook should exit 2. And a hook’s if filter is best effort, so the docs suggest permission rules for a hard allow or deny.

On a long task, @AlekVectis notes, Claude drifts from instructions. A hook just runs.

Sources

  1. @AlekVectis on X · Oct 23, 10:59 AM PT
  2. Claude Code docs: settings · code.claude.com
  3. Claude Code docs: hooks · code.claude.com
Back to front pageMore in Agents & Coding