barry-cache AGENTS.md

barry-cache AGENTS.md is an instructions file for Codex, OpenCode from AlexanderIstomin/barry-cache. It costs 1,228 tokens per session, scanned A, original, Apache-2.0.

Repository instructions for Barry Cache, a tool that stores source-backed context about a codebase in context files. They describe commands for resuming task context, finding relevant information, and loading selected facts.

In plain words
What is it for?
Use them when working in a Barry Cache-enabled repository to start a task, search stored context, load a relevant route, or adjust the amount of returned information.
Why use it?
They help an agent retrieve the right repository details without repeatedly reading every context file. They also explain how to expand the results when important facts were left out.

Instructions file for CodexOpenCode

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 instructions/alexanderistomin/barry-cache/agents-md
Clone the repo
git clone --depth 1 https://github.com/AlexanderIstomin/barry-cache

Made for: Codex, OpenCode.

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 barry-cache AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/alexanderistomin/barry-cache/agents-md.svg)](https://agentmods.dev/instructions/alexanderistomin/barry-cache/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/alexanderistomin/barry-cache/agents-md"><img src="https://agentmods.dev/badge/instructions/alexanderistomin/barry-cache/agents-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 1,228 This file is loaded in full into every session.
When invoked 1,228 The same file — it is already loaded in full.
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.1 $0.01228 $0.01228
Opus 5 $0.00614 $0.00614
Sonnet 5 $0.00246 $0.00246
Haiku 4.5 $0.00123 $0.00123

Measured 5d ago against content hash 8f6d0301b44a, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

barry-cache AGENTS.md 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 5d 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.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

AGENTS.md · 80 lines

How it starts

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

Barry Cache

Barry Cache remembers this repo through source-backed context files.

Use the repo package script so Barry Cache runs from the local npm dependency without relying on shell PATH. If the dependency is missing, run bun install first. Use npx barry-cache <command> only when package scripts are unavailable.

Repeated retrieval commands use the disposable parsed index in .context-cache/context-index.json when source context files have not changed.

Start task context with:

bun run barry -- resume --task "<task>"

Use focused retrieval during work:

bun run barry -- route --task "<task>"
bun run barry -- search --query "<query>"
bun run barry -- load --route "<route>"

load and resume return a relevance-ranked budgeted slice by default (~2000 tokens per pack), not the whole pack. Trust the slice — the result lists any dropped fact ids and an expand_hint. If a needed fact is missing, restore just that id with --expand <id>; use --expand all only when you genuinely need the full pack, or --budget <N> to resize.

Workspace context is optional. When docs/context/workspaces.json exists and you know relevant files or directories, include them so Barry can choose the right workspace:

bun run barry -- resume --task "<task>" --paths "path-a,path-b"
bun run barry -- workspace infer --task "<task>" --paths "path-a,path-b"

Use the workspace Barry selects. If Barry reports workspace_decision.status: "ambiguous", do not guess — ask the user or rerun with --workspace <slug>.

When context files change, run:

bun run barry -- validate

Before handing off substantial work, record factual evidence:

bun run barry -- finalize --status success --summary "<summary>" --files "path-a,path-b"

When user validation shows previous work is broken, record the contradiction before or while fixing it:

bun run barry -- failure record --summary "<what failed>" --expected "<expected behavior>" --actual "<observed behavior>" --challenges "<handoff-or-fact-id>"

Memory policy:

  • Private vs. canonical memory: your agent's own private memory — the local store only you can read (for Claude Code, MEMORY.md and its files; other agents have their own) — is invisible to every other agent. Use it only for cross-session personal context — user preferences, how to work with this user, and external references.
  • Any decision, fact, or constraint another agent would need goes to Barry, never a private memory: an ADR, a docs/context/features/*/FACTS.jsonl fact, or a finalize/failure record. If you are about to write a project-type private memory, that is the signal to route it to Barry instead.
  • feedback-type guidance splits on who it serves: keep it private only when it is about working with this user personally (explanation depth, tone, review style). Guidance that states a rule every agent on this repo should follow (e.g. "always run bun run barry -- validate before finalize") is a policy, not a preference — route it to Barry as an ADR/AGENTS.md policy or a decision fact.
  • Finalize writes operational memory only.
  • Failure records write operational validation memory only and should challenge stale handoffs or facts instead of rewriting history.
  • Do not claim Barry canonical memory is updated unless docs/context/ changed.
  • If a task adds durable implementation behavior, add or update source-backed facts in docs/context/features/*/FACTS.jsonl and run bun run barry -- validate.
  • Direct FACTS.jsonl edits remain supported; use bun run barry -- fact draft --route "<route>" --prefix "<PREFIX>" ... when a schema-checked JSONL draft or explicit --write append is safer.
  • fact draft is an authoring guardrail, not broad canonical CRUD; review the resulting diff and run bun run barry -- validate.
  • Use ISO 8601 timestamps in fact updated_at values when saving new facts, so same-day feature order is preserved in review timelines.
  • Use collision-resistant fact IDs like REV-20260526T160512Z-a8f3; dense review UI may display them as REV-a8f3.

Read the full file on GitHub · 80 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. 5d ago First seen · 80 lines · 1,228 tokens per session scan A 8f6d0301b44a

Subscribe to this mod's changes

barry-cache AGENTS.md is an instructions file published in the GitHub repository AlexanderIstomin/barry-cache (5 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 1,228 tokens to every session, about $0.0061 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.