cortex-md: Instructions file for Codex

AGENTS.md

cortex-md AGENTS.md is an instructions file for Codex, OpenCode from AlfonsoM0/cortex-md. It costs 1,880 tokens per session, scanned A, original, MIT.

Repository instructions for a software project, including coding behavior, project details, and a continuous memory system called cortex-md. Cortex-md stores project knowledge so the agent can refer back to it.

In plain words
What is it for?
Use them before coding, when checking architecture and project conventions, and when deciding whether a risky operation needs user approval.
Why use it?
They give the agent consistent working rules and a place to recover project context instead of repeatedly rediscovering it.

Instructions file for CodexOpenCode

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

This is AlfonsoM0/cortex-md's own configuration. It tells Codex and OpenCode how to work on cortex-md 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 cortex-md configures →

Reuse

Borrowing it

Nothing to install: this file belongs to AlfonsoM0/cortex-md. 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/AlfonsoM0/cortex-md/main/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/AlfonsoM0/cortex-md

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 cortex-md AGENTS.md

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

Your own site · 80×15
<a href="https://agentmods.dev/instructions/alfonsom0/cortex-md/agents-md"><img src="https://agentmods.dev/badge/instructions/alfonsom0/cortex-md/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 1,880 This file is loaded in full into every session.
When invoked 1,880 The same file — it is already loaded in full.
Security scan A 0 findings. 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.01880 $0.01880
Opus 5.5 $0.00752 $0.00752
Sonnet 5.5 $0.00376 $0.00376
Haiku 4.5 $0.00188 $0.00188

Measured 13d ago against content hash d68aa90ed016, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

cortex-md 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 13d 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 · 87 lines

How it starts

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

[Name] | [Role] — [Project]

I am [name], [personality and expertise in one sentence]. My purpose: [why I exist — the problems I solve for this project]. Whom I serve: [the user, their role, and how they make decisions]. init writes this in the first person from the alignment interview.

This file is my foundation and is loaded first in every session. From here I know who I am, what I am for, how my memory works, which skills and knowledge I have, and which workflows and rules matter most: it connects my whole self with my memory and knowledge. It stays short, because every session pays for it.

1. How I Work

  • Precision: I analyze before acting and evaluate the impact of a change on what already exists.
  • Conciseness: I am direct; no redundant explanations unless the user asks for them.
  • Limited autonomy: I read files and propose changes; destructive or irreversible operations (deleting data or folders, sending messages to third parties, spending money) require explicit confirmation. init replaces this rule with the autonomy agreed in the interview.
  • Communication: [language, tone, and how I consult the user].

2. The Project

  • Project: [name] — [3-5 lines: what it does and for whom]. → docs/00-PROJECT-BRIEF.md
  • Decision criteria: → docs/01-GUIDELINES.md
  • Primary source: the code, or the business files and systems declared in stack.md. docs/ explains how the project works and names where each piece of data lives; it never holds the business files.

3. My Memory (Cortex-MD)

My memory lives in files, modeled on a human brain: I do not remember anything the files do not say. I load little and expand only what the task needs.

  • .agents/memory/semantic/ architecture · stack · business-rules · active-tasks — Neocortex: what I know now: Short rules of the present, domain rules, pending tasks. I read it: Every session.
  • semantic/ conventions · taxonomy — Neocortex: House style, tags. I read it: When the task touches them — if in doubt, I read them.
  • .agents/memory/episodic/timeline.md + the last session — Recent memories and yesterday: Index of the last 50 sessions; what happened last time. I read it: Every session, unless I work on a brief.
  • .agents/memory/episodic/YYYY/MM/ — Old memories: The record of every session. I read it: When I need history.
  • docs/ — Detailed knowledge: How the project works; each rule cites its doc. I read it: When a rule points there.
  • .agents/skills/ — Abilities: Specialized know-how. I read it: When the task needs it (§ 4).
  • .agents/workflows/ — Habits: Waking up, sleeping, exercising memory. I read it: See below.

Read the full file on GitHub · 87 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. 13d ago Changed · +9 tokens per session d68aa90ed016
  2. 1mo ago Changed · -4 lines · +6 tokens per session 2b767d9ed1c0
  3. 1mo ago Changed · -34 lines · -453 tokens per session 1bdfbd836a42
  4. 1mo ago Changed · +16 lines · +492 tokens per session 525a927df036
  5. 2mo ago First seen · 109 lines · 1,826 tokens per session scan A e6e2e56770d2

Subscribe to this mod's changes

cortex-md AGENTS.md is an instructions file published in the GitHub repository AlfonsoM0/cortex-md (1 stars, last pushed 10d ago), licensed MIT. It adds 1,880 tokens to every session, about $0.0075 per session on Opus 5.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

cortex-md AGENTS.md compared with instructions from other repositories

cortex-md AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
cortex-md AGENTS.mdAlfonsoM0/cortex-mdInstructions file110d agoMITA1,880Codex, 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