arch-context-budget

arch-context-budget is a skill for Codex from Koredotcom/agents-mcp-tools. It costs 82 tokens per session (1,215 once invoked), scanned A, original, MIT.

A guide to finding out what an AI model received on each turn of an agent conversation. It covers the system instructions, chat history, tools, memory, search results, and limits that can shorten or remove context.

In plain words
What is it for?
Use it to trace lost context, inspect long conversations, find truncation or compaction, and manage the information included in each model request.
Why use it?
An agent may appear to forget information, repeat itself, run slowly, or cost more because too much input was sent or earlier content was cut. Inspecting the actual request shows where that happened.

Skill for Codex

Written for Codex: agents/openai.yaml present.

Good fit Use it to trace lost context, inspect long conversations, find truncation or compaction, and manage the information included in each model request.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/koredotcom/agents-mcp-tools/arch-context-budget
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 Koredotcom/agents-mcp-tools --skill arch-context-budget
Clone the repo
git clone --depth 1 https://github.com/Koredotcom/agents-mcp-tools

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 arch-context-budget

README.md
[![agentmods](https://agentmods.dev/badge/skills/koredotcom/agents-mcp-tools/arch-context-budget/github.svg)](https://agentmods.dev/skills/koredotcom/agents-mcp-tools/arch-context-budget)
Your own site
<a href="https://agentmods.dev/skills/koredotcom/agents-mcp-tools/arch-context-budget"><img src="https://agentmods.dev/badge/skills/koredotcom/agents-mcp-tools/arch-context-budget/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 arch-context-budget

Your own site · 80×15
<a href="https://agentmods.dev/skills/koredotcom/agents-mcp-tools/arch-context-budget"><img src="https://agentmods.dev/badge/skills/koredotcom/agents-mcp-tools/arch-context-budget.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 82 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,215 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.00082 $0.01215
Opus 5.5 $0.00033 $0.00486
Sonnet 5.5 $0.00016 $0.00243
Haiku 4.5 $0.00008 $0.00121

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

Security

Grade A, and why

arch-context-budget 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.

skills/arch-context-budget/SKILL.md · 75 lines

How it starts

The opening of the file, as written. The whole thing — 75 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Context budget

Every turn ends in one model request: a system prompt, the conversation history and the tool list. Most "the model forgot", "it's slow" and "the bill is high" complaints come from what went into that request. Find out from the request itself, not from the reply. If the developer has a single bad session, use arch-explain-session first to find the turn where data was lost.

Gather the evidence

  1. Pick a long session (20+ turns), or run one with debug_load_agent and debug_send_message.
  2. Get the full model requests for turns 1, 5, 10 and 20. The MCP trace tools do not return them: Live reads cut each value to about 200 characters; historical reads leave out the LLM prompt, messages and tool list (marked llmPayloadOmitted). Ask the developer to use Export entire trace on the session page, or open each LLM step's Request view, and read those payloads.
  3. With the MCP tools, locate where cuts happened: debug_traces with the session's sessionId and text set to a marker such as _contextLimited or COMPACTED FOR CHAT HISTORY. For a session that is not live, pass projectId and source: "historical".
  4. In the exported requests, search for the markers _contextLimited, _summarized, truncated, COMPACTED FOR CHAT HISTORY, Prior response, Prior turn result, Result available and "unavailable", and for {{context}}, {{config., {{env. and unfilled {{placeholders}}.

Limits and markers are listed in references/context-limits.md.

Two things grow without limit

In release 1.7.3, conversation history and declared session memory have no size cap. History is not trimmed by tokens or message count, and automatic summarization is off. Memory sections are sent in full on every call. Long and multi-agent conversations bloat here first.

Rules that prevent most context bugs

  1. Make visibility explicit. Declaring BEHAVIOR: role: puts the agent in explicit mode: ## Current Context then holds only declared and granted values. One {{context}} in an allow-list agent admits every session value. On an agent that is already live, values it never declared stop reaching the prompt, so declare what it needs and run the eval set before shipping the change.
  2. Shape tool results at the source. Give every tool with more than a few fields a MODEL_CONTEXT. Without it the platform decides what survives, which is the usual cause of "the model forgot the data it just fetched". Voice never summarizes, so this matters twice as much.
  3. Save, don't hope. On the next turn a tool result becomes a placeholder and a reply that followed a tool becomes a short preview. Save what later turns need with on_result: SET.
  4. Keep memory small. Session memory holds IDs and short strings, not objects or lists. Use RESET: per_activation for scratch values.
  5. Trim handoffs. pass the fields, a one-line summary, and history: summary_only or a small last_n. Keys inside CONTEXT: must be lowercase.
  6. Set compaction once, at project level (by API or project import; Studio edits compaction only inside the voice profile). The policy is resolved once per conversation and is not refreshed on handoff.
  7. Keep the start of the prompt stable. Identity, rules and tools first; per-turn values later in memory. A {{variable}} in GOAL changes the start of the prompt and defeats provider caching.
  8. Keep secrets out of prompt text. Never reference config.* or env.* in GOAL, PERSONA, LIMITATIONS, SYSTEM_PROMPT or RESPOND. Credentials belong in auth profiles.
  9. Give the agent the date when it reasons about relative dates; the system prompt has none.
  10. Set max_search_tokens on every knowledge-base tool (2,000–4,000 for voice).

Read the full file on GitHub · 75 lines

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 · 75 lines · 82 tokens per session scan A afb24cb15e19

Subscribe to this mod's changes

arch-context-budget is a skill published in the GitHub repository Koredotcom/agents-mcp-tools (4 stars, last pushed 1mo ago), licensed MIT. It adds 82 tokens to every session and 1,215 once invoked, about $0.0003 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-10-09.

Related

arch-context-budget compared with skills from other repositories

arch-context-budget next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
arch-context-budgetKoredotcom/agents-mcp-toolsSkill41mo agoMITA82Codex
knowledge-ingestopenclaw/openclawSkill394ktodayMITA80Claude Code, Codex
forgetasgeirtj/system_prompts_leaksSkill71k3d agoCC0-1.0A0Claude Code, Codex
mem0-oss-to-platformmem0ai/mem0Skill69k6d agoApache-2.0A217Claude Code, Codex
Cortexdanielmiessler/LifeOSSkill20k7d agoMITA184Claude Code
ha-data-storesshiwenwen/hope-agentSkill1.9ktodayMITA115Claude Code, Codex
memoryopensquilla/opensquillaSkill7.1k6d agoApache-2.0A44Claude Code, Codex