dense-mem AGENTS.md

dense-mem AGENTS.md is an instructions file for Codex, OpenCode from markhuangai/dense-mem. It costs 2,447 tokens per session, scanned A, original, Apache-2.0.

Repository instructions for Dense-Mem, a memory service that stores evidence, retrieves relevant context, and records where information came from.

In plain words
What is it for?
Use them when checking architecture, reviewing code and tests, recording decisions, and keeping project memory current.
Why use it?
They help developers make architecture changes without losing project decisions or confusing temporary code with the intended design.

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/markhuangai/dense-mem/agents-md
Clone the repo
git clone --depth 1 https://github.com/markhuangai/dense-mem

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 dense-mem AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/markhuangai/dense-mem/agents-md.svg)](https://agentmods.dev/instructions/markhuangai/dense-mem/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/markhuangai/dense-mem/agents-md"><img src="https://agentmods.dev/badge/instructions/markhuangai/dense-mem/agents-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 2,447 This file is loaded in full into every session.
When invoked 2,447 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 $0.02447 $0.02447
Opus 5 $0.01223 $0.01223
Sonnet 5 $0.00489 $0.00489
Haiku 4.5 $0.00245 $0.00245

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

Security

Grade A, and why

dense-mem 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 4d 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.

AGENTS.md · 223 lines

How it starts

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

Dense-Mem Repository Guidance

Project Context

  • Dense-Mem is a standalone MCP Streamable HTTP memory service. The host decides when memory is useful; Dense-Mem owns evidence intake, semantic lifecycle, provenance, retrieval, trace, authorization, and audit.
  • For non-trivial architecture work, query the Dense-Mem project-memory MCP first with assemble_context or recall_memory. Treat recalled items as context; explicit user direction and verified repository state still govern.
  • Keep project memory current after approved architecture decisions, verified implementation milestones, corrections, or conformance gaps. Store concise entries without credentials or local filesystem paths.
  • Do not add repository references to local paths for separately maintained documentation. State the invariant directly in this repository.
  • Inspect current code, interfaces, migrations, callers, and tests before changing behavior. Distinguish transitional implementation from the target architecture instead of assuming either one fully describes the other.

Architecture Decision Records

  • Accepted repository architecture decisions live in adr/. Before non-trivial design, implementation, or review, enumerate adr/*.md and read every accepted record relevant to the affected behavior.
  • Accepted ADRs describe the governing target. A transitional implementation may differ only when the ADR states its bounded rationale and removal condition; do not widen that exception or treat the transition as the completed architecture.
  • A new or edited ADR in the current change cannot authorize accompanying code by itself. Explicit maintainer direction governs a new decision, and a later ADR must identify any accepted record that it supersedes.

Current Stack

  • Go 1.26 with Echo v4; PostgreSQL access uses GORM/pgx and goose migrations; validation uses go-playground/validator/v10; Redis uses go-redis/v9.
  • Configuration is loaded from environment variables through internal/config. Do not introduce a second configuration framework.
  • The browser applications use React/Vite with Vitest and Playwright. Follow their existing component and test patterns when changing web/.
  • HTTP success responses use internal/http/response and the { "data": ... } envelope. Public errors are typed and bounded through existing error helpers.

Read the full file on GitHub · 223 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. 4d ago First seen · 223 lines · 2,447 tokens per session scan A 5f01bfff887b

Subscribe to this mod's changes

dense-mem AGENTS.md is an instructions file published in the GitHub repository markhuangai/dense-mem (39 stars, last pushed today), licensed Apache-2.0. It adds 2,447 tokens to every session, about $0.0122 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.