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 0xmariowu/Autosearch --skill context-retention-policygit clone --depth 1 https://github.com/0xmariowu/AutosearchWrote 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/0xmariowu/autosearch/context-retention-policy)<a href="https://agentmods.dev/skills/0xmariowu/autosearch/context-retention-policy"><img src="https://agentmods.dev/badge/skills/0xmariowu/autosearch/context-retention-policy/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/0xmariowu/autosearch/context-retention-policy"><img src="https://agentmods.dev/badge/skills/0xmariowu/autosearch/context-retention-policy.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector pass
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.00089 | $0.01188 |
| Opus 5 | $0.00044 | $0.00594 |
| Sonnet 5 | $0.00018 | $0.00238 |
| Haiku 4.5 | $0.00009 | $0.00119 |
Grade A, and why
autosearch:context-retention-policy 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 11d 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.
How it starts
The opening of the file, as written. The whole thing — 115 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Context Retention Policy — Session-Level Context Governance
A research session can generate more evidence / tool results than any reasonable context window. This skill tells the runtime AI what to keep, what to offload, and when to compact.
Policy Parameters (defaults)
policy:
keep_last_k_tool_results: 12 # inline, full
keep_all_citations_index: true # citation_index stays in context always
keep_all_rubrics: true # rubrics stay in context always
offload_trigger_token_ratio: 0.7 # compact when context ≥ 70% full
offload_target_token_ratio: 0.4 # after compact, aim for 40% full
offload_archive_path: "session/<id>/offloaded/<ts>.jsonl"
prefer_compact_over_drop: true # summarize instead of silently drop
never_compact:
- clarify_result
- reflective_loop_state
- graph_plan
- citation_index
- rubrics
Compaction Procedure
When current_tokens / max_tokens >= offload_trigger_token_ratio:
- Sort evidence / tool_results by age (oldest first).
- Identify candidates — everything NOT in
never_compactand older than the last K results. - For each candidate batch (every ~3 evidence items):
- If
prefer_compact_over_drop: use a Fast-tier LLM to summarize the batch into a single "digest" item (5-10 lines max, preserves URLs + key specifics verbatim). - Else: drop the batch but write full content to
offload_archive_pathfor later recovery.
- If
- Replace the original items with the digest. Keep URLs in the citation_index so citations still resolve.
- Recheck token ratio. If still above
offload_target_token_ratio, iterate.
Preservation Rules (never compact these)
- The current reflective-search-loop state (gaps, visited, bad_urls).
- The current graph-search-plan graph structure.
- The citation-index entries (they're short and referenced by all sections).
- The rubrics from run_clarify.
- The original query + clarify verification message.
- The last 3 tool results regardless of K.
What ships with it
1 file 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.
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.
- 11d ago First seen · 115 lines · 89 tokens per session scan A 30cb07dd25f7
autosearch:context-retention-policy is a skill published in the GitHub repository 0xmariowu/Autosearch (44 stars, last pushed 1mo ago), licensed MIT. It adds 89 tokens to every session and 1,188 once invoked, about $0.0004 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
memem-mine
Opt in to memem's event-triggered mining. New sessions are mined automatically via the Stop hook.
hypothesis-tracking
Retrieve and update company hypotheses in Primr. Use when the user asks what is already known, wants to validate a claim, or wants to persist a research finding.
stats
Show Captain Memo's corpus statistics (chunks per channel, observation counts, indexing progress, embedder info). Use when the user types /captain-memo:stats.
observations
List recent captured session observations (the Haiku-summarized voyage logs). Use when the user wants to see what Captain Memo has logged from past sessions.
recall
Use find before WebSearch or WebFetch for research, or before answering a why/how/what-did-we-decide question. Quarry indexes this codebase, design docs, prior session transcripts, and previously fetched web pages — it often already has the answer. Prefer grep for symbol and value lookups; prefer find for meaning.…
claude-bridge-role-memory-keeper
Playbook for a Claude Code agent in the dedicated memory keeper role — single-writer for shared agent memory across a team of 3+ peers. Use when you are designated as the keeper (= other peers send you write candidates, you write them and watch for drift). Memory hygiene + reconciliation against the canon + drift…