cortex AGENTS.md

Project instructions for Cortex, a local, Obsidian-compatible knowledge vault for AI agents with linked Markdown notes, search, backlinks, and a web graph view.

In plain words
What is it for?
Setting up, seeding, testing, serving, or connecting Cortex through its command line, web interface, or MCP server.
Why use it?
They explain how to keep an agent's stored knowledge searchable and connected, while avoiding setup mistakes such as using the wrong port setting.

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

Made for: Codex, OpenCode.

Per session 918 This file is loaded in full into every session.
When invoked 918 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.00918 $0.00918
Opus 5 $0.00459 $0.00459
Sonnet 5 $0.00184 $0.00184
Haiku 4.5 $0.00092 $0.00092

Measured yesterday against content hash a2cfcfbfa004, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

cortex 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 yesterday.

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 · 66 lines

How it starts

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

AGENTS.md — cortex

🧠 A local, Obsidian-compatible second brain for agents. A wikilinked markdown vault with a knowledge graph (backlinks, auto-healing links), FTS5 search, self-maintenance, and a live graph web view. CLI + web + MCP. Part of tools-for-agents.

Setup

node --version                                   # 22+ required. Nothing to install.
npm test                                         # = node --test (~12s)
CORTEX_VAULT=./vault node scripts/seed.js        # put real notes in a vault
CORTEX_VAULT=./vault node src/cli.js serve --port 7800
npm run mcp                                      # the MCP server, stdio

Zero runtime dependencies, and that is a hard rule. No dependencies in package.json, ever. Node 22+ gives you node:sqlite and a test runner.

Env For
CORTEX_VAULT the vault directory — always point this at a temp dir in tests
PORT serve port (default 7800). ⚠️ There is no CORTEX_PORT — it is --port or PORT; anything else is silently ignored and it binds 7800 anyway.

The rules this repo is built on

1. Only the picture is evidence. Run iris against any UI change and look at the shot before you say it works. This repo was spotless on a desktop and broken four ways on a 390px phone — with green CI the whole time. Audit phone,tablet,desktop, both themes.

2. Open the doors. Every state behind a button is a state nothing has ever rendered, and every door opened in this kit so far had a bug behind it. .results is display:none until you type — the gate named .results .r in its hover list for months, matched nothing, and reported clean about a state it never reached. Drive the page with --pre, then look.

3. A list that names more than the view renders lies, and it lies in the direction of "clean". Keep each gate's hover: list to what that page actually shows; put the rest behind a job that opens their door.

Read the full file on GitHub · 66 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. yesterday First seen · 66 lines · 918 tokens per session scan A a2cfcfbfa004

Subscribe to this mod's changes

cortex AGENTS.md is an instructions file published in the GitHub repository tools-for-agents/cortex (0 stars, last pushed 27d ago), licensed MIT. It adds 918 tokens to every session, about $0.0046 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.