map-token-context

map-token-context is a skill for Codex from hakiyaka/capsule. It costs 54 tokens per session (794 once invoked), scanned A, original, MIT.

A context-management and decision-routing toolkit for AI agents. It helps choose specialist instructions and limit the files, history, tools, and other information sent to a model.

In plain words
What is it for?
Use it for token-heavy or reasoning-heavy tasks, specialist-skill routing, file and web context lookup, decision calculations, scheduling, reusable reasoning, and context-size measurement.
Why use it?
Large or unnecessary context can increase cost, slow reasoning, and make decisions harder to control. This toolkit provides structured ways to route work, search context, and verify results.

Skill for Codex

Written for Codex: agents/openai.yaml present. Also seen: mentions subagents.

Good fit Use it for token-heavy or reasoning-heavy tasks, specialist-skill routing, file and web context lookup, decision calculations, scheduling, reusable reasoning, and context-size measurement.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/hakiyaka/capsule/map-token-context
Install

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.

Any agent
npx skills add hakiyaka/capsule --skill map-token-context
Clone the repo
git clone --depth 1 https://github.com/hakiyaka/capsule

Made for: Codex.

Wrote 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.

agentmods badge for map-token-context

README.md
[![agentmods](https://agentmods.dev/badge/skills/hakiyaka/capsule/map-token-context/github.svg)](https://agentmods.dev/skills/hakiyaka/capsule/map-token-context)
Your own site
<a href="https://agentmods.dev/skills/hakiyaka/capsule/map-token-context"><img src="https://agentmods.dev/badge/skills/hakiyaka/capsule/map-token-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.

agentmods 80×15 button for map-token-context

Your own site · 80×15
<a href="https://agentmods.dev/skills/hakiyaka/capsule/map-token-context"><img src="https://agentmods.dev/badge/skills/hakiyaka/capsule/map-token-context.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 54 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 794 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00054 $0.00794
Opus 5.5 $0.00022 $0.00318
Sonnet 5.5 $0.00011 $0.00159
Haiku 4.5 $0.00005 $0.00079

Measured 1mo ago against content hash f72429f7325d, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

map-token-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 1mo ago.

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.

optional-skills/map-token-context/SKILL.md · 27 lines

What it actually says

Capsule

Use one capsule; put action fields in payload.

  • With a virtual router, call skills {operation:"route",query:"English intent"}; its default is one domain-anchored match. Read only that skill_file; request a larger limit only when the task truly needs another specialist.
  • Use cognition for exact cover, assignment, knapsack, shortest path, DAG scheduling, weighted decisions, information-gain checks, reasoning-governor status, or reusable decision kernels; trust its checksum certificate and reason only about unencoded judgment.
  • Use run|batch for commands, file for files, index|search|remember for context, fetch for web text, and execute for derivation.
  • Use progressive expand|diff for exact evidence and stats|gain|insight|doctor for measurement.
  • Treat [Capsule replay], [Capsule delta], [Capsule poll: exactly unchanged], and [Capsule session transcript projection] as complete control tags: reuse them directly and call expand only when exact bytes are required. The current exact= capsule always contains the complete latest result.
  • Treat [Capsule repeated failure] as proof that the same tool input produced the byte-identical error again. Use its short diagnostic, change input or external state, and call expand only if exact bytes are required.
  • Treat [Capsule round-trip tax] and the sequence fuse as measured prompts to batch independent work or execute the next concrete change. A costly uncached suffix also tightens output/history budgets mechanically. Successful exec control wrappers are removed automatically; oversized read-only output remains exact-capsule recoverable even at normal context pressure.
  • For automatic-context-compaction cost, call insight with compaction:true and the session id/path. It returns aggregates, the latest event, and context_pressure with occupancy, predicted runway, locally reported quota pressure, compaction churn, retained-image risk, reasons, and the active policy. Request bounded rows only with compaction_events:true. Treat pre/post input as observable exposure because hidden compactor generation is not exposed.
  • Treat gain as contract-valid local exposure telemetry, not billing. Legacy hook projections are excluded unless include_unverified:true is explicitly requested.
  • Start view_image at high; use original only for pixel-level evidence.
  • Give subagents self-contained messages. Automatic policy uses none for independent tasks, a small recent window for deictic continuations, and full history only for explicit whole-conversation dependencies.
  • Subagent work is task-bounded: keep the default total to 16 (never above 20), use one agent per UI/i18n/performance/release lane, pause after 10 independent agents for one compact {decisions,evidence,files,blockers} summary, and reuse that digest instead of opening another review wave. Return no raw screenshots, base64 media, full diffs, or transcripts; retain exact recovery in Capsule.
  • After each grouped mutation and decisive verification, call stats once and gain once. Treat both as local exposure evidence, not billing; do not rerun exploratory reads just to obtain a measurement.
  • Return the smallest complete answer; explicit detail requirements win.
  • Never sacrifice accuracy for compression.
  • Skill apply|restore requires an explicit request and confirm:true.
  • See capsule-contract.md for exact behavior and recovery.
Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

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.

  1. 1mo ago First seen · 27 lines · 54 tokens per session scan A f72429f7325d

Subscribe to this mod's changes

map-token-context is a skill published in the GitHub repository hakiyaka/capsule (4 stars, last pushed 24d ago), licensed MIT. It adds 54 tokens to every session and 794 once invoked, about $0.0002 per session on Opus 5.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-31.

Related

Other skills, from other repositories

graphifychat

Turn any conversation into a queryable knowledge graph. Three-layer portable memory file: TRON (structured input+output capture with emotion, psychology, intent — every turn), Sparse6 (layered relational graph with community detection, hyperedges, confidence scores — every turn), GRAPHREPORT (god nodes + surprising…

soumyakantabera/graphifychat · 172 tokens

session-handoff

Synthesizes the current session into a structured HANDOFF block for context transfer between sessions. Captures what was built, decisions made, and unresolved items.

SethGammon/Citadel · 35 tokens

context-budget

Use when a long-horizon task is filling the context window and you must decide what to keep, offload, drop, or hand off to a fresh window — when to compact, what the summary must preserve, and whether to isolate a read-heavy subtask in a subagent. NOT dollar spend or caps (that is cost-tracking), NOT finding context…

ericrisco/rsc-harness · 82 tokens

entroly-context-control

Surgically select, compress, and recover codebase context using Entroly's MCP tools. Slashes token usage by up to 95% with Merkle-exact recovery receipts and WITNESS verification.

juyterman1000/entroly · 48 tokens

accordion-context-folding

Read this skill if you see {# FOLDED} markers in your context (e.g. {#3f9a2c FOLDED}), or if earlier parts of your context look summarized. Accordion is a desktop tool that may compact older context blocks to keep you under a token budget. The unfold tool restores a folded block (open from your next turn); the recall…

a-Fig/Accordion · 102 tokens

accordion-context-recall

Read this skill when you need to read the full content of a folded context block RIGHT NOW as a tool result — without opening it in your standing context. Use recall(codes) when you only need a value once and do not want to permanently restore the block. Accordion may fold older parts of your context to keep token…

a-Fig/Accordion · 89 tokens