Directives

The rules an agent is bound by. Directives resolves the CLAUDE.md and .claude/rules/ files that govern a project, in precedence order, so a session knows what it is actually required to do.

Part of the brain.

The layers#

Read lowest precedence first, so each layer refines the ones before it:

LayerWhere it comes from
packtoryo's own shipped engineering rules
globalyour ~/.claude/CLAUDE.md and ~/.claude/rules/, standing rules for every project
projectthe project's own CLAUDE.md and .claude/rules/
nestedany CLAUDE.md deeper in the tree, for package- or directory-scoped overrides

The pack is toryo's contribution and sits lowest, so anything you write wins over it. It is read at resolve time and never installed onto your disk.

Vendored paths (node_modules, .git, dist, build) are excluded. A CLAUDE.md that came in with a dependency is not a directive.

Nothing is indexed#

Directives has no database. You and your projects edit these files freely, so an indexed copy would be stale the moment someone saved. Every lookup reads from disk, live.

That means a rule you write takes effect on the very next session, with nothing to reindex or restart.

How agents use it#

Searching is the normal path: it splits each file into sections and matches per section, so a hit is the specific rule rather than the whole document. Listing the hierarchy is the orientation step when a search comes back empty.

Resolving the complete hierarchy is available but deliberately a last resort, since it inlines every file's content and costs roughly 18,000 tokens on a typical repository. It is for when the rules themselves are the subject of the work.

Why it matters#

This is the layer that makes an agent's output look like your codebase rather than generic output. A rule you write once, whether a testing convention, an import style, or a library you have banned, governs every session in that project, both the unattended ones and your own.

Full command surface: CLI & contract reference.