Two-layer skill injection: ~100 tokens per skill in the system prompt, ~2,000 loaded on demand — the pattern documented in a 72.7K-star teardown
shareAI-lab/learn-claude-code is a from-scratch reimplementation of a Claude Code-style agent harness whose skill-loading chapter spells out the token math most homegrown harnesses get wrong: ten skills inlined at ~2,000 tokens each burns 20,000 tokens on knowledge the agent mostly doesn't need. The pattern is a hard split — the system prompt carries only names and one-line descriptions (~100 tokens per skill), and a `load_skill(name)` tool returns the full body wrapped in a `<skill>` tag only when the model asks. I verified the repo directly via the GitHub API: 72,734 stars, last pushed July 28, 2026, and it also documents the surrounding harness pieces (context compaction, subagent spawning, worktree-isolated parallel execution, permission governance) as separately implementable units.
↳ Follow the thread