# #1815 + #1816 — Rules-size warning + storage-patterns reference

## Problem

Claude Code auto-loads everything matching `.claude/rules/*.md` into every `<system-reminder>`. At 40,000 chars CC emits a yellow runtime warning — by then context burn is already material. The hq-ext platform `recent-decisions.md` ballooned to 53.8k chars (1.3× cliff) before anyone noticed.

## Two-part fix

### #1815 — lifecycle/rules-size-check (this PR)

SessionStart async hook scans `.claude/rules/` + `.claude/plugins/` and emits operator-facing stderr warnings:

    [orchestkit] WARN: .claude/rules/foo.md is 36.2 KiB (37,123 chars) — auto-loaded into every prompt. CC warns at 40k. Consider splitting via index-per-entry pattern (see src/skills/CONTRIBUTING-SKILLS.md#storage-patterns or skill-evolution/references/storage-patterns.md).

Thresholds:

- WARN at 35,000 chars (12.5% safety margin)
- CRITICAL at 38,000 chars (5% margin)

### #1816 — storage-patterns reference

New doc at `src/skills/skill-evolution/references/storage-patterns.md` with trade-off table, decision matrix, migration script. Pointer added to `src/skills/CONTRIBUTING-SKILLS.md` so future skill authors hit it during the authoring flow.

## Two patterns documented

Pattern | Best for | Failure mode
--- | --- | ---
Rolling logbook | Bounded growth, < 30k chars total, chronological narrative | Crosses 40k cliff silently
Index-per-entry | Unbounded growth, lookups by-key or by-date | Two-step writes, more PR diff noise

Default to index-per-entry if unsure — bounded by construction.

## Tests

- `rules-size-check.test.ts` — 12 tests: thresholds, silent paths, severity escalation, sort order, *.md filter, ctx.projectDir fallback, defensive on null input, warning text shape
- `split-bundles.test.ts` + `hooks-json-wiring.test.ts` — count bumps 228→229, 196→197
- Total: 64 tests, all passing

## Hook count

Total: 196 → 197 (one new `lifecycle/` hook, SessionStart async).

Closes #1815. Closes #1816.