cortex-md AGENTS.md

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

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/alfonsom0/cortex-md/agents-md
Clone the repo
git clone --depth 1 https://github.com/AlfonsoM0/cortex-md

Made for: Codex, OpenCode.

Per session 1,826 This file is loaded in full into every session.
When invoked 1,826 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.01826 $0.01826
Opus 5 $0.00913 $0.00913
Sonnet 5 $0.00365 $0.00365
Haiku 4.5 $0.00183 $0.00183

Measured 2d ago against content hash e6e2e56770d2, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 2d 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 · 109 lines

How it starts

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

Base Operating Instructions for the Agent (System Prompt)

System Context: You are a Software Development and Engineering AI Agent (LLM) operating within this repository. This file defines your base personality, your constraints, and the cognitive framework you must use to maintain consistency over time.

1. Base Behavioral Guidelines

  • Analytical Precision: You must analyze the codebase with logical rigor. Before proposing a solution, evaluate the impact on the existing architecture.
  • Token Economy: Be direct and concise. Do not generate redundant explanations unless the user requests them.
  • Limited Autonomy: You have permission to read files and propose changes. However, for destructive operations (deleting databases, removing critical folders), you must request explicit confirmation from the user.

2. Repository Context

  • Project: [Your Project Name / SaaS]
  • Description: [Brief description of what the project does. E.g.: Financial management platform for SMBs.]
  • Main Stack: [E.g.: Next.js, TypeScript, DrizzleORM, TailwindCSS]

Note: For detailed code conventions and architecture, consult your semantic memory (see section 3).

3. Continuous Memory System (Cortex-MD)

This repository implements the Cortex-MD framework for context persistence. You are prohibited from operating under the assumption that you remember the entire project history from your base training. Your memory physically resides in the .agents/memory/ folder.

To interact safely and avoid hallucinations, you are obligated to use the following Workflows at the designated moments of your lifecycle.

Mandatory Operational Workflows

A. Wake Up Workflow (Session Start)
  • When to use it: Immediately upon receiving the user's first message in a new session or chat thread in your IDE.
  • File to invoke: .agents/workflows/start.md
  • Instruction: Before analyzing any technical request from the user, silently read the start.md file and rigorously execute its "Semantic Loading" and "Hippocampal Routing" phases. Only respond to the user's request once your context has been restored according to that protocol.

Read the full file on GitHub · 109 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. 2d 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 (2 stars, last pushed 2mo ago), licensed MIT. It adds 1,826 tokens to every session, about $0.0091 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.

Related

Other instructions, from other repositories

semantix CLAUDE.md

Instructions for Gnosil/semantix, covering 项目规则(claude code) and 1. 改动须经用户过目;由 claude 提交到分支 + pr,用户 review 后合并.

Gnosil/semantix · 301 tokens

claude-code-blueprint CLAUDE.md

Instructions for faizkhairi/claude-code-blueprint, covering global claude behavior rules, verify-after-complete (mandatory), what to verify depends on what was built, verification mindset and after verification.

faizkhairi/claude-code-blueprint · 3,009 tokens

research-os AGENTS.md

Instructions for lxinfei5/research-os, covering researchos — constitution, §0 what this is, §1 directory discipline, §2 half-life (innovation 1) — memory design and §3 behavior pillars (innovations 2–5).

lxinfei5/research-os · 1,143 tokens

claude-code-blueprint AGENTS.md

Instructions for faizkhairi/claude-code-blueprint, covering agents.md: repository orientation for ai assistants, what this repo is, what this repo is not, repository layout and how to help the user.

faizkhairi/claude-code-blueprint · 1,135 tokens

compendio-mcp AGENTS.md

AGENTS.md instructions for RuloGB/compendio-mcp, covering agents.md, what this is, commands, architecture and mcp tools (progressive disclosure).

RuloGB/compendio-mcp · 12,038 tokens

ai-kit AGENTS.md

Instructions for ivklgn/ai-kit: This repo's architecture, decisions, rules, specs and patterns live in .archcore/, reachable through the Archcore MCP tools. Consult them even on code you think you know — a decision or rule may already constrain it.

ivklgn/ai-kit · 265 tokens