context-protect

A context-management method that sends a long investigation to another coding agent and keeps only its summary in the main conversation.

In plain words
What is it for?
It helps investigate long log files, directories, CI traces, and transcripts while preserving the main session for reasoning. It is less suitable when you need to explore or ask follow-up questions about the raw details.
Why use it?
It prevents large logs, audits, or transcripts from filling the main agent's working space when only a conclusion or short list is needed.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/firstintent/a2a-bridge/context-protect
Any agent
npx skills add firstintent/a2a-bridge --skill context-protect
Clone the repo
git clone --depth 1 https://github.com/firstintent/a2a-bridge

Made for: Claude Code, Codex.

Per session 54 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,131 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00054 $0.01131
Opus 5 $0.00027 $0.00566
Sonnet 5 $0.00011 $0.00226
Haiku 4.5 $0.00005 $0.00113

Measured 2d ago against content hash 674f44d19ee6, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

context-protect 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 2d 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/context-protect/SKILL.md · 129 lines

How it starts

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

context-protect — delegate a long dig, keep the summary

Your primary session's context is the scarcest resource it has. When a subtask would otherwise dump a long log, a codebase audit, or a full transcript analysis into it, push the work to a peer and keep only the summary. The peer stays free to grind through the full data; your session stays free to reason about the conclusion.

When to use

  • The input is long (log file, directory listing, CI trace, transcript).
  • You only need a conclusion, a bug location, a count, or a bullet list — not the raw material.
  • The primary session does not need to answer follow-up questions about other details buried in the input. If it might, fetch the full output instead; summarization is lossy.

When NOT to use

  • You cannot enumerate the question up front. Summarization works when you know what you want to learn; it fails when you are still orienting.
  • The peer's summary is not trustworthy without spot-checks. Either verify the summary via a second pass (see skills/verify/) or pull the raw data.
  • The task is cheap to run inline. Paying for a second agent's context just to avoid a 200-token paste is not worth it.

Protocol

Set Message.metadata.return_format to "summary" on the message/stream request:

{
  "message": {
    "parts": [{ "kind": "text", "text": "<digest prompt>" }],
    "metadata": { "return_format": "summary" }
  }
}

The peer adapter surfaces return_format: "summary" to the peer (the bridge does not summarize on its own — adapters relay the hint to the model). The peer is expected to compress its own output before returning; the shape that comes back is ordinary text, not a structured artifact.

Prompt scaffold

You are assisting a larger session that is TIGHT ON CONTEXT. Answer
the QUESTION below using the INPUT, then return ONLY the summary
requested — no raw excerpts longer than a single line of evidence
per bullet, no preambles, no "here is the summary" framing.

QUESTION:
<one specific question, e.g. "Which request ids failed with a
timeout between 14:00 and 15:00, and which upstream did they point
at?">

INPUT:
<paste or attach the log / audit / transcript>

OUTPUT FORMAT:
- Bullet list, at most N bullets.
- Each bullet: one fact, one citation (timestamp / line / file:line).
- End with a single-sentence "bottom line" summarizing the pattern.

Read the full file on GitHub · 129 lines

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. 2d ago First seen · 129 lines · 54 tokens per session scan A 674f44d19ee6

Subscribe to this mod's changes

context-protect is a skill published in the GitHub repository firstintent/a2a-bridge (8 stars, last pushed 4mo ago), licensed MIT. It adds 54 tokens to every session and 1,131 once invoked, about $0.0003 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-31.

Related

Other skills, from other repositories

self-build

Builds isolated npm capability packages that operate on real project code and connects them to Peri through MCP/MCPP and MetaHarness. Use when adding tools, resources, remote skills or agents, creating a Bun/Node.js stdio server, linking .mcp.json, or changing the active prompt and middleware set.

KonghaYao/peri · 66 tokens

learn-from-history

审计近期对话历史,提炼重复失败、成功模式、稳定规则和 skill 改进。用户要求总结历史对话、 回顾近期 agent 表现、从历史中学习或寻找可自动化改进时使用。.

KonghaYao/peri · 55 tokens

ultracode

Multi-agent workflow orchestration. Use when the user says "ultracode", "workflow", "parallel agents", "pipeline", or asks to orchestrate multiple agents for complex tasks. Also use when the user wants to break work into phases or parallel streams.

KonghaYao/peri · 58 tokens

demo-subagents-tui

This skill demonstrates how to use the agent tool to spawn subagents within the pi-go TUI for parallel task execution. Subagents are autonomous child processes that run concurrently, enabling efficient parallelization of independent tasks.

dimetron/pi-go · 0 tokens

nightly-session-watch

Nightly sweep of the last 24h of pi-go sessions — anomalous runs, loop aborts, tool error rates, token waste, real prompt-token spend, and whether the observation and palace pipelines are still recording. Triages each finding to the specialist skill that diagnoses it. Use for an unattended daily health check, or on…

dimetron/pi-go · 78 tokens

agents-md

Generate AGENTS.md files for Go, Rust, TypeScript, and Java projects. Use this skill whenever the user asks to create, scaffold, bootstrap, update, or review an AGENTS.md (or agent-instructions, CLAUDE.md, repo guide for agents) file in a codebase. Also trigger when the user says "add AGENTS.md", "make this repo…

dimetron/pi-go · 138 tokens