The Lean Wolf

Context Diet & Template Extraction — The Shedding — a session chronicle from the Fenrir Ledger forge.

Act I · The Pack Patrol

Fire-Next-Up — Board Scan & Orphan Check

Odin

/fire-next-up

The orchestrator ran its pre-flight patrol: worktree health check (clean), orphan PR scan, and project board query. Found 3 open PRs (#220, #222, #223) all awaiting Loki QA — active chains, not stale. Identified 6 items in "Up Next" with 3 bugs, 2 enhancements, and 1 unlabeled feature.

Priority selection began — fetching labels for all 6 candidates — when Odin interrupted with a different question.

Open PRs
3
Awaiting Loki
3
Up Next
6

Act II · The Weight Reckoning

Context Audit — What Fattens the Wolf?

Odin

Which files get loaded in every session that are taking up the most context?

Measured every file that loads into Claude Code's context window. The verdict was damning: fire-next-up/SKILL.md alone consumed 55 KB (1,352 lines) — 82% of all loaded skill context. It contained 5 full agent prompt templates, each repeating the same 18-line sandbox preamble verbatim.

Ranked all 13 skill files by size. The top offender was clear.

// Context budget per invocation of /fire-next-up
SKILL.md        55 KB   1,352 lines   ← the wolf is fat
MEMORY.md        9 KB     121 lines
CLAUDE.md        3 KB      71 lines
// ─────────────────────────────────────────────
Total           67 KB   loaded before a single tool call

Act III · Eight Bones to Break

Extraction Analysis — Identifying the Candidates

Odin

Refactor /fire-next-up...extract common patterns to templates that only get read on demand. how many candidates are there?

Dissected the monolithic SKILL.md and identified 8 extraction candidates — blocks that were either repeated verbatim across templates or only needed conditionally (specific flag, specific agent type).

The sandbox preamble alone was duplicated 5 times. The resume flow (215 lines) was only needed for --resume. Agent prompts were only needed when spawning that specific agent.

// Extraction candidates
#1  Sandbox Preamble       5x verbatim     ~4.5 KB  (dedup)
#2  Luna template          ux chains only   ~3.5 KB
#3  FiremanDecko template  bug/enh/ux       ~4.4 KB
#4  Heimdall template      security only    ~3.7 KB
#5  Loki template          every chain      ~5.6 KB
#6  Loki Bounce-Back       resume + CI fail ~4.5 KB
#7  Report templates       step 8 only      ~3.0 KB
#8  Resume Flow            --resume only   ~10.5 KB
// ──────────────────────────────────────────────────
    Total extractable:                      ~38 KB

Act IV · The Shedding

Template Extraction — 55 KB to 10.7 KB

Odin

fuckin do it

Created 8 template files under templates/ in parallel, then rewrote SKILL.md to reference them on demand. The sandbox preamble was extracted once and composed into prompts via {{SANDBOX_PREAMBLE}} placeholder. Each agent template is now read only when the orchestrator spawns that specific agent.

The always-loaded SKILL.md dropped from 1,352 lines (55 KB) to 316 lines (10.7 KB) — a 77% reduction in context consumed per invocation.

  • 1,352 lines / 55 KB always loaded 316 lines / 10.7 KB always loaded
  • 5x duplicated sandbox preamble 1x shared in sandbox-preamble.md
  • All prompts inline 8 on-demand template files
  • Resume flow always loaded Only read on --resume
Before
55 KB
After
10.7 KB
Reduction
77%
✎ .claude/skills/fire-next-up/SKILL.md ✦ templates/sandbox-preamble.md ✦ templates/luna.md ✦ templates/firemandecko.md ✦ templates/heimdall.md ✦ templates/loki.md ✦ templates/loki-bounce-back.md ✦ templates/reports.md ✦ templates/resume-flow.md

Act V · The Branch & Seal

Commit, Push & PR #225

Odin

yup

Branched from main as chore/extract-fire-next-up-templates, committed 9 files (721 insertions, 1,163 deletions), pushed, and opened PR #225. The diff tells the whole story: the monolith shattered into composable shards.

$ git diff --stat
 .claude/skills/fire-next-up/SKILL.md          | 1290 ++++----
 templates/sandbox-preamble.md                 |   30 +
 templates/luna.md                              |   53 +
 templates/firemandecko.md                      |   71 +
 templates/heimdall.md                          |   58 +
 templates/loki.md                              |   98 +
 templates/loki-bounce-back.md                  |   80 +
 templates/reports.md                           |   70 +
 templates/resume-flow.md                       |  134 +
 9 files changed, 721 insertions(+), 1163 deletions(-)
Session Ledger
Files created
8
Files modified
1
Lines removed
1,163
Context saved
77%