Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add myths-labs/muse --skill layered-contextgit clone --depth 1 https://github.com/myths-labs/museWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/myths-labs/muse/layered-context)<a href="https://agentmods.dev/skills/myths-labs/muse/layered-context"><img src="https://agentmods.dev/badge/skills/myths-labs/muse/layered-context/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/myths-labs/muse/layered-context"><img src="https://agentmods.dev/badge/skills/myths-labs/muse/layered-context.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00023 | $0.00931 |
| Opus 5 | $0.00012 | $0.00465 |
| Sonnet 5 | $0.00005 | $0.00186 |
| Haiku 4.5 | $0.00002 | $0.00093 |
Grade A, and why
layered-context scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 96 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Layered Context Loading Protocol
Inspired by OpenViking (ByteDance) L0/L1/L2 architecture. Adapted for MUSE's on-demand Markdown context loading.
Why
Full-loading all .muse/*.md files during /resume wastes tokens when the Agent only needs one role's context. The layered approach loads minimum context first, then deepens on demand.
Three Layers
| Layer | Token Budget | Content | When to Load |
|---|---|---|---|
| L0 | ~100 tokens | One-line HTML comment at top of each .muse/*.md |
Always — scan ALL role files |
| L1 | ~2K tokens | Full role file content | On demand — only the CURRENT role's file |
| L2 | Unbounded | memory/*.md + code files + docs |
On demand — grep search when needed |
L0 Format
Every .muse/*.md file MUST have an L0 comment as the first line:
<!-- L0: v2.10.1 | P0=竞品技术吸收, P1/P2全清, QA PASS, S036已接收 -->
L0 Content Rules
- Max 120 characters (excluding
<!-- L0:and-->) - Must include: current version + top priority + blocking issues
- Pipe-separated sections:
version | priorities | status - Updated every /bye — when the role file is synced
L0 Examples
<!-- L0: v2.10.1 | P0=竞品技术吸收(mem0/OpenViking), P1全清, QA 10/10 PASS -->
<!-- L0: 9/9渠道已发, Show HN暂缓, S040梗图排期中, Stars=2 -->
<!-- L0: 最近QA全PASS(10/10 v2.3), 无待修FAIL, QA清洁状态 -->
Boot Sequence with Layered Loading
/resume [role]
│
├─① Read CLAUDE.md + MEMORIES.md (constitutional layer, always)
│
├─② Scan ALL .muse/*.md L0 lines (grep "<!-- L0:" .muse/*.md)
│ → Get one-liner status of every role in ~400 tokens total
│
├─③ Deep-read CURRENT role's .muse/*.md (L1, full file)
│ → Only the file matching /resume [role]
│
├─④ Scan memory/ for unfinished items (L2, on demand)
│ → grep 🔲 and [ ] in recent memory files
│
└─⑤ grep strategy.md for 🟡 directives (L2, on demand)
→ Only if non-strategy role
Decision Tree: When to Upgrade
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- yesterday Changed d1046d085764
- 8d ago First seen · 96 lines · 23 tokens per session scan A e16b6ee61ee9
layered-context is a skill published in the GitHub repository myths-labs/muse (32 stars, last pushed 2d ago), licensed MIT. It adds 23 tokens to every session and 931 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
context-receipts
Emit privacy-safe receipts for context selection, deferral, hydration, compaction, pruning, delegation, usage attribution, and boundary handoffs.
init-workspace-documentation
Skill "init-workspace-documentation" from griddynamics/rosetta, covering agent memory.md, agent memory, preventive rules, what worked and what failed.
ijfw-handoff
Session handoff generation and loading. Trigger: session end, context full, /handoff.
ijfw-summarize
Generate optimized project context from codebase scan. Trigger: new project, no CLAUDE.md, /ijfw-summarize.
repo-context-ledger
Maintain durable, evidence-based repository context whenever an agent initializes a repository, changes behavior, checkpoints or resumes work, switches AI tools or windows, collaborates through Git, prepares a pull request, or completes a coding task. Use the deterministic runtime to route bounded context, isolate…
ijfw-status
Use when the user says: 'ijfw status', 'show me the system state', 'what is ijfw doing', or to see the at-a-glance routing / memory / activity banner.