Borrowing it
Nothing to install: this file belongs to abdul-hamid-achik/cortex. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/abdul-hamid-achik/cortex/main/AGENTS.mdgit clone --depth 1 https://github.com/abdul-hamid-achik/cortexWrote 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.
[](https://agentmods.dev/instructions/abdul-hamid-achik/cortex/agents-md)<a href="https://agentmods.dev/instructions/abdul-hamid-achik/cortex/agents-md"><img src="https://agentmods.dev/badge/instructions/abdul-hamid-achik/cortex/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.
<a href="https://agentmods.dev/instructions/abdul-hamid-achik/cortex/agents-md"><img src="https://agentmods.dev/badge/instructions/abdul-hamid-achik/cortex/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.09511 | $0.09511 |
| Opus 5.5 | $0.03804 | $0.03804 |
| Sonnet 5.5 | $0.01902 | $0.01902 |
| Haiku 4.5 | $0.00951 | $0.00951 |
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 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.
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.
How it starts
The opening of the file, as written. The whole thing — 532 lines — stays where its author put it; the contents beside it link to each section on GitHub.
AGENTS.md
Instructions for AI agents (and humans) working on the cortex codebase. This is the
canonical source-of-truth doc. README.md is the public-facing
intro. Architecture, behavior, and contributor rules that must remain durable belong here.
Design rationale and working notes belong in the Obsidian vault at ~/notes/projects/cortex/,
not the repo.
Project Overview
cortex is a local-first, evidence-guided agent kernel for software-engineering agents. It sits between an LLM and a set of specialist tools (Bob, codemap, vecgrep, cairntrace, glyphrun, fcheap, vidtrace, tvault, veclite) and enforces a stateful reasoning loop:
orient → investigate → form hypotheses → declare a boundary → change → verify → preserve evidence
Cortex does not replace the model's planning or coding ability. It supplies what models are bad at preserving across long tool-using tasks: a durable case file, explicit evidence and uncertainty, disciplined tool routing, bounded changes, and verification tied to user-visible behavior.
Two surfaces over one kernel (the ecosystem pattern — cf. codemap/vecgrep):
- CLI — human commands and
--jsonmachine output for agents (Cobra + Charm v2 lipgloss). - MCP server —
cortex serve(stdio), a 23-toolagentprofile by default;--profile allexposes the full 30-tool operator surface.
Product docs: docs/quick-start.md (humans), docs/mcp.md (agents). Monitor sessions with
cortex sessions / cortex show --json instead of the removed Studio TUI (docs/studio.md).
Directory Structure
cortex/
├── cmd/cortex-trajectory/ # opt-in trusted empirical harness; separate from runtime/release CLI
├── cmd/cortex-trajectory-claude/ # reference arm launcher (Claude Code CLI, isolated raw_tools/cortex arms)
├── cmd/cortex/ # Cobra CLI, split per-command. Each RunE is THIN → builds a
│ # kernel (kernelFor) → calls internal/kernel. Files carry the
│ # header `/* Copyright © 2026 abdul hamid <[email protected]> */`.
│ ├── main.go # root command, persistent --workspace/-C and --json flags
│ ├── open / start / investigate / plan / change / verify / remember / status .go
│ ├── note / decision / handoff / doctor / serve .go
│ ├── longrunning.go # finding / dossier / coverage / workplan / resume / job command groups
│ └── render.go # lipgloss v2 styled view + --json emit (TTY-gated color)
├── internal/
│ ├── domain/ # core types — NO deps on adapters/store/transport
│ │ ├── case.go # CaseFile + Phase machine (transitions, invariants)
│ │ ├── acceptance.go # optional immutable criteria + transport-independent bounds
│ │ ├── evidence.go # Evidence, EvidenceKind, Confidence, Sensitivity
│ │ ├── hypothesis.go # Hypothesis + Disproof (the disproof-path gate)
│ │ ├── plan.go # Plan + planning-gate validation
│ │ ├── verification.go # typed claims + VerificationRecord + statuses
│ │ ├── lease.go decision.go # change ownership + resumable human decisions
│ │ ├── envelope.go # the shared MCP/CLI result envelope
│ │ ├── policy.go # routing matrix, budget, surface→verifier map
│ │ └── finding.go dossier.go coverage.go workplan.go job.go # long-running work records
│ ├── kernel/ # SHARED SERVICE LAYER — CLI + MCP both call this
│ │ ├── kernel.go # Kernel struct, evidence stamping, phase transition helper
│ │ ├── orient.go open.go # new task + idempotent open/resume
│ │ ├── investigate.go # Investigate (route → discovery → candidates → structural expansion → record evidence)
│ │ ├── plan.go # Plan (rejects no-disproof / no-boundary plans)
│ │ ├── change.go lease.go # explicit begin-change + bounded ownership
│ │ ├── verify.go assessment.go # typed verification + canonical task assessment
│ │ ├── persist.go # Remember (durable memory + summary.md + completion invariant)
│ │ ├── resolve.go # Resolve (confirm/challenge/reject a hypothesis)
│ │ ├── recall.go # Cross-case disproof recall: index hooks + recall
│ │ ├── observe.go decision.go handoff.go actions.go artifact.go # human/agent collaboration + projections
│ │ ├── status.go # Status / AbortTask / ReadEvidence / ListTasks
│ │ ├── scope.go # scope-drift detection vs the declared boundary
│ │ ├── freshness.go # evidence `commit` stamping + stale detection (git ChangedSince, bounded)
│ │ ├── finding.go dossier.go survey.go workplan.go checkpoint.go jobs.go # long-running work (docs/long-running.md)
│ │ └── jobs_unix.go jobs_other.go # detached worker spawn (Setsid) + terminate
│ ├── adapters/ # one file per tool; flat package sharing exec/redact plumbing
│ │ ├── adapter.go # Adapter interface, Request/Result/Fact, Capability/Status
│ │ ├── exec.go # runner (fakeable), timeout, redaction, ErrToolMissing
│ │ ├── registry.go # Registry + concurrent Health probe
│ │ ├── bob.go codemap.go vecgrep.go fcheap.go cairntrace.go glyphrun.go vidtrace.go tvault.go veclite.go command.go
│ │ └── util.go # pluralize / decodeJSON / clip helpers
│ ├── store/
│ │ ├── casefs/ # JSON/JSONL case-file persistence ($XDG_STATE_HOME/cortex/sessions/<repo>/<id>/)
│ │ │ # + findings/coverage/workplan/jobs/checkpoint files and RepoStore (repos/<slug>/dossier.json)
│ │ └── redact/ # secret-shape redaction (last-line filter before model output)
│ ├── mcp/server.go # stdio MCP server — THIN pass-through (23 agent / 30 all; longrunning.go holds the six long-running tools)
│ ├── tui/board.go # Legacy Charm v2 board (not wired to the CLI)
│ ├── config/ # XDG paths + cortex.yaml (budget/redact/cases_dir/recall/verifiers) + env
│ ├── ids/ # time-sortable Crockford-base32 IDs (task_/ev_/hyp_/vr_/dec_/raw_)
│ ├── eval/ # deterministic scorecard + separate opt-in trajectory runner contract
│ ├── forge/forge.go # PR review action (ModeReview: PR fetch + APPROVE/REQUEST CHANGES verdict)
│ └── version/version.go # Version/Commit/Date (ldflags-injected)
├── docs/ # VitePress site (product docs ONLY) → deploy to Vercel
├── desktop/ # Cortex Deck — Electron operator console over CLI+MCP+case store;
│ # no bundler/framework; own README, tests (node --test) and a
│ # headless smoke pass that screenshots every view
├── contracts/v1/ # public deterministic JSON/MCP conformance schema + fixtures
├── evaluations/ # trusted empirical manifests, repository fixtures, and independent oracles
├── specs/ # glyphrun E2E specs (*.yml)
├── .github/workflows/ # ci.yml (test+race+build+lint+docs) · release.yml (goreleaser on tags)
├── Taskfile.yml .golangci.yml .goreleaser.yaml
└── README.md AGENTS.md CHANGELOG.md LICENSE
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.
- 1mo ago Changed · +17 lines · +409 tokens per session 5344735e3bc2
- 1mo ago Changed · +13 lines · +231 tokens per session ac62cfec0cf4
- 2mo ago Changed · +62 lines · +1,266 tokens per session 53250ff4ec86
- 2mo ago First seen · 440 lines · 7,605 tokens per session scan A da5d55d4aae0
cortex AGENTS.md is an instructions file published in the GitHub repository abdul-hamid-achik/cortex (1 stars, last pushed 1mo ago), licensed MIT. It adds 9,511 tokens to every session, about $0.0380 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.
cortex AGENTS.md compared with instructions from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| cortex AGENTS.mdabdul-hamid-achik/cortex | Instructions file | 1 | 1mo ago | MIT | A | 9,511 | Codex, OpenCode |
| vscode buildNext.instructions.mdmicrosoft/vscode | Instructions file | 195k | today | MIT | A | 9,719 | GitHub Copilot |
| vscode oss-third-party-notices.instructions.mdmicrosoft/vscode | Instructions file | 195k | today | MIT | A | 5,516 | GitHub Copilot |
| next.js AGENTS.mdvercel/next.js | Instructions file | 143k | yesterday | MIT | A | 7,461 | Codex, OpenCode |
| langchain AGENTS.mdlangchain-ai/langchain | Instructions file | 149k | today | MIT | A | 4,680 | Codex, OpenCode |
| vscode copilot-instructions.mdmicrosoft/vscode | Instructions file | 195k | today | MIT | A | 3,093 | GitHub Copilot |
| vscode model-prompts.instructions.mdmicrosoft/vscode | Instructions file | 195k | today | MIT | A | 2,022 | GitHub Copilot |