Agent Context Budget logo

Agent Context Budget

Community
WenyuChiou
agent-context-budget

Use when launching parallel or background subagents, or when a handoff, log, or result would be more than a short summary (roughly 2 KB). Caps return sizes (summary in the reply, detail by path), picks a cheap model tier for mechanical lanes, records durable decisions as proposals, and checkpoints or primes a fresh session before context runs out.

Overview

PublisherWenyuChiou
Repositoryagent-collab-skills
Skill nameagent-context-budget
Stars
33
Forks
7
Bundled files
2
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 2 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by WenyuChiou on GitHub. Read the source before you install it.

Installation

Install the Agent Context Budget AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/WenyuChiou/agent-collab-skills/tree/main/skills/agent-context-budget
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/WenyuChiou/agent-collab-skills.git /tmp/agent-collab-skills
mkdir -p .claude/skills
cp -r /tmp/agent-collab-skills/skills/agent-context-budget .claude/skills/agent-context-budget
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Agent Context Budget in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Agent Context Budget on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Agent Context Budget is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

agent-context-budget

Keep the primary session small while lanes do the reading and writing. There is no second budget source: native mode follows the host's limits and the caps written into each brief; harness mode takes every number from the policy referenced by the current TaskCheckpoint. The "roughly 2 KB" in the description says when to use this skill; it is not a limit.

Do not use this skill to summarize away unresolved failures, human decisions, raw scientific evidence, or security findings.

Before launching lanes

  • Put a return cap in every brief: status, short summary, files changed, checks run, risks, blockers. Long output goes to a file and the lane returns the path. Raw logs, transcripts, and full diffs never come back inline.
  • Reading lanes return conclusions with file:line references, not file dumps. Name exact files and line ranges in the brief.
  • Choose model tiers before launch: a cheap tier for mechanical lanes (pattern edits, scaffolds, bulk reads), a strong tier for review, verdicts, root-cause analysis, security, and governance. Never switch a lane's model silently after a failure.
  • Background lanes notify on completion. Keep working and read the result then; do not poll.
  • For a follow-up, continue the lane that already holds the context instead of starting a fresh one.

Host mechanics (parallel calls, background runs, per-lane model, return schemas) are in native lanes.

What goes into a brief

Only decision-relevant material:

  • goal and acceptance contract;
  • explicit files and tools in scope;
  • direct evidence paths;
  • current recorded human decisions;
  • relevant interfaces or schemas.

Keep raw logs and complete artifacts at their paths. Include a short failure excerpt only when the next action needs it.

Before context runs out

Write a fresh-session primer: goal, current state, decisions and who made them, open questions, evidence paths, next step. Keep unresolved failures, human decisions, and security findings visible. Compaction changes the active context, not cumulative usage or failure history.

Durable decisions (formerly agent-shared-memory)

Memory output is proposal-only. Repository state, current evidence, and recorded human decisions outrank memory; recall systems are optional caches. Native mode may write a proposal file and nothing else under .coord/; applying an approved proposal needs the signed approval of harness mode.

  • Write a proposal to .coord/memory-proposals/<proposal-id>.json with an immutable action (operation, target_ref, summary, evidence_refs).
  • Supersede, archive, and delete need a specific target_ref. A proposal with no evidence refs stays pending.
  • Only an explicit human approval, recorded with actor, decision, timestamp, rationale, affected action hash, and trusted-host HMAC authorization, lets a proposal be applied. Decline, timeout, and revise are not approval.
  • Applying appends one new event to .coord/memory.yml. It never edits an existing event; a resolution, correction, or supersession is a new append-only event.
  • Never report an unapproved proposal as a canonical decision. Delegated executors never receive the signing key.

Full schema and apply rules: references/coord_memory_schema.md.

Harness mode

Applies when AGENT_COLLAB_POLICY is configured, or a round spans sessions or tools, runs unattended, or must resume.

  1. Validate:

    agent-collab policy validate --policy <policy-ref> --json
    agent-collab checkpoint validate --checkpoint <checkpoint-ref> --json
  2. Record the observed metrics in the checkpoint. Never estimate a lower number to fit the policy.

  3. Before each child spawn and after each returned result, run:

    agent-collab policy evaluate \
      --policy <policy-ref> \
      --checkpoint <checkpoint-ref> \
      --json
  4. Obey the decision:

    • continue with spawn_allowed=true: build the bounded packet.
    • checkpoint: write the checkpoint and primer. A v2 slice with auto_continue advances atomically under the same goal; v1 returns control. For a v2 action-scope context_compaction_required, do local context maintenance without asking for renewed approval: keep full artifacts, acceptance evidence, failures, and authorization; build a smaller linked packet or use native compaction; record measured sizes; re-evaluate. Do not spawn or advance a slice while this gate is pending.
    • stop or spawn_allowed=false: do not spawn. Respect the v2 scope; an exhausted action still allows safe primary-agent diagnosis.
  5. A configured but unreadable policy stops the run. If the harness package is unavailable, do not start an autonomous loop; prepare packets for human-controlled execution instead.

Multi-cycle loop rules (retry counting, failure identity, no-progress cycles) are in references/harness-loop.md.

Outputs (scratch by default): .coord/context_<NNN>.md (shape in references/harness-loop.md), .coord/session_primer.md, and the updated checkpoint. Promote a checkpoint snapshot only when the repository needs it for resume, shipping, or acceptance evidence. Agent boundaries do not imply commits.

Invariants

  • Policy values have one machine-readable source; the stricter of the policy and the host's native limit wins.
  • Reserve capacity for required independent review.
  • No silent retry, model switch, context discard, or result truncation. A capped return that points to the full output is not truncation.
  • Missing evidence is reported as missing. A decline, cancellation, timeout, error, or null result remains non-success.
  • Recall systems may suggest context; they never override repository state or recorded human decisions.

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Agent Context Budget AI skill do?

Use when launching parallel or background subagents, or when a handoff, log, or result would be more than a short summary (roughly 2 KB). Caps return sizes (summary in the reply, detail by path), picks a cheap model tier for mechanical lanes, records durable decisions as proposals, and checkpoints or primes a fresh session before context runs out.

Why use Agent Context Budget on TypingMind?

Because you install it once and use it with any model. Agent Context Budget is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Agent Context Budget in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/WenyuChiou/agent-collab-skills/tree/main/skills/agent-context-budget. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Agent Context Budget?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Agent Context Budget?

As many as you like. As long as a model supports skills, you can use Agent Context Budget with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Agent Context Budget AI skill free?

Yes. It is published on GitHub by WenyuChiou under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇