Architecture

Modular Instructions

An architecture pattern where CLAUDE.md delegates to domain-specific rule files instead of containing all instructions in a single monolithic file.

Modular instructions solve the scaling problem of a single CLAUDE.md file. At 300+ lines, a monolithic instruction file creates conflicts and makes updates risky. The modular pattern splits instructions into domain-specific rule files (finance-rules.md, newsletter-rules.md, steepworks-rules.md) that load conditionally based on file path. CLAUDE.md becomes an index and router rather than an encyclopedia. Rule files use paths: frontmatter to specify when they activate. This means finance rules only load when you touch finance files, keeping the context budget lean. The pattern reduced CLAUDE.md from 303 lines to 151 while increasing total instruction coverage.

Where it shows up:

CLAUDE.md architectureRule file designMulti-domain reposContext optimization

Build your Knowledge OS

90 minutes from zero to your first skill chain.