opencode-dejavu: Instructions file for Codex

AGENTS.md

opencode-dejavu AGENTS.md is an instructions file for Codex, OpenCode from WhiteBite/opencode-dejavu. It costs 4,679 tokens per session, scanned A, original, MIT.

A set of instructions for Dejavu, an OpenCode plugin that remembers repeated tool-call failures and can block the same mistake after it happens repeatedly. OpenCode is a coding-agent environment, and Bun runs its TypeScript files.

In plain words
What is it for?
Use it when working on the plugin’s failure detection, stored rules, validation, repair scripts, commands, or smoke test.
Why use it?
It helps prevent recurring tool errors from being repeated across coding sessions.

Instructions file for CodexOpenCode

Written for Codex and OpenCode: the file is AGENTS.md. Also seen: mentions OpenCode.

This is WhiteBite/opencode-dejavu's own configuration. It tells Codex and OpenCode how to work on opencode-dejavu itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything opencode-dejavu configures →

Reuse

Borrowing it

Nothing to install: this file belongs to WhiteBite/opencode-dejavu. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/WhiteBite/opencode-dejavu/main/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/WhiteBite/opencode-dejavu

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 opencode-dejavu AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/whitebite/opencode-dejavu/agents-md/github.svg)](https://agentmods.dev/instructions/whitebite/opencode-dejavu/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/whitebite/opencode-dejavu/agents-md"><img src="https://agentmods.dev/badge/instructions/whitebite/opencode-dejavu/agents-md/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 opencode-dejavu AGENTS.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/whitebite/opencode-dejavu/agents-md"><img src="https://agentmods.dev/badge/instructions/whitebite/opencode-dejavu/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 4,679 This file is loaded in full into every session.
When invoked 4,679 The same file — it is already loaded in full.
Security scan A 1 finding. 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.04679 $0.04679
Opus 5.5 $0.01872 $0.01872
Sonnet 5.5 $0.00936 $0.00936
Haiku 4.5 $0.00468 $0.00468

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

Security

Grade A, and why

opencode-dejavu AGENTS.md scanned grade A with 1 finding 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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

- Do NOT count exit 1 from diagnostic verbs (grep/tsc/pytest/curl/ls...) as failure — intended outcome; exit ≥ 2 always counts (OpenCode normalizes exits to 1, so discriminate by command shape)
AGENTS.md · 152 lines

How it starts

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

PROJECT KNOWLEDGE BASE

Generated: 2026-08-22 (refreshed 2026-08-30) Commit: 14ca0c1+ Branch: main

OVERVIEW

dejavu — OpenCode plugin ("memory prosthesis with teeth"): mechanically detects recurring tool-call failures and promotes them into enforced gates (3 failures across 2 distinct sessions). Remind first, hard-block on same-session repeat offense. TypeScript ESM, runs under Bun, ships as raw .ts (no build step).

STRUCTURE

dejavu-opencode-plugin/
├── index.ts            # Plugin entry — exports Dejavu (Plugin factory) + all 4 hooks
├── src/
│   ├── patterns.ts     # Pure engine: signatures, normalization, secret scrub, detection, blocking policy
│   ├── store.ts        # GateStore/Stores: two-scope persistence, locks, promotion, TTL, migration, reconcile
│   └── validate.ts     # Invariant layer: strict gate parsing + mechanical repair (parse-don't-validate boundary)
├── test/smoke.ts       # Behavioral smoke test — plain bun script, no framework, temp-dir isolated
├── scripts/            # doctor.ts (pathology report), analyze.ts (store summary), migrate.ts (demote+scrub)
├── command/dejavu.md   # /dejavu slash-command definition (install → ~/.config/opencode/command/)
├── skills/dejavu/      # Companion agent-protocol skill (install → ~/.config/opencode/skills/)
└── .omo/, .codegraph/  # Tooling artifacts — not project code

WHERE TO LOOK

Task Location Notes
Gate enforcement (remind/block/override) index.ts before/after hooks blocking gates abort in the before-hook; reminding gates annotate the failing output in the after-hook; session state lives ON THE GATE, read fresh under the store lock
Failure detection + recording index.ts tool.execute.after + event two channels: exit/text vs message stream; a cross-channel dedup guard counts one call once
Signature/normalization src/patterns.ts callSignature, normalizeCommand, parameterizeError
Enforcement policy src/patterns.ts:canBlock()/canRemind() three tiers — bash non-diagnostics block, diagnostics + Unix viewers remind-only, everything else just watches
Persistence, locks, promotion, global escalation src/store.ts Stores.recordFailure() is the core; cross-project evidence lives in global index.json
Self-healing / reconcile src/store.ts + src/validate.ts Stores.reconcileAll() at every init; doctor --repair on demand
Tunables top of index.ts and src/store.ts split: TTL/review caps in index, promote thresholds in store
Pathology checks scripts/doctor.ts defect classes: unparseable/bad records, duplicate keys, temporal inversion, nested tokens, enforced-without-evidence, stale blocking/reminding, not-teaching, annoying, stale-correction, review-flagged, reminders-ignored, unsanitized, stale copies, corrupt logs, version drift, cross-store index checks; no-arg run discovers projects from the index

Read the full file on GitHub · 152 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. 1mo ago Changed · +7 lines · +563 tokens per session 56d68fde8d91
  2. 2mo ago Changed · +6 lines · +553 tokens per session 0b6d9e8b8d2d
  3. 2mo ago Changed · +5 lines · +98 tokens per session 5cc9cf7a9c2d
  4. 2mo ago First seen · 134 lines · 3,465 tokens per session scan A 3cc561845bce

Subscribe to this mod's changes

opencode-dejavu AGENTS.md is an instructions file published in the GitHub repository WhiteBite/opencode-dejavu (6 stars, last pushed 1mo ago), licensed MIT. It adds 4,679 tokens to every session, about $0.0187 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

opencode-dejavu AGENTS.md compared with instructions from other repositories

opencode-dejavu AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
opencode-dejavu AGENTS.mdWhiteBite/opencode-dejavuInstructions file61mo agoMITA4,679Codex, OpenCode
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143kyesterdayMITA7,461Codex, OpenCode
langchain AGENTS.mdlangchain-ai/langchainInstructions file149kyesterdayMITA4,680Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA5,516GitHub Copilot
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA3,093GitHub Copilot
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file274k2d agoMITA4,313Codex, OpenCode