cortexloop

A post-coding workflow that runs selected expert checks on a project, with options for lighter or more thorough reviews.

In plain words
What is it for?
Use it for code quality, security, testing, performance, simplification, silent-failure, and cleanup checks in a defined sequence, with CI output.
Why use it?
It organizes several kinds of review after coding, accounts for risk and cost, and verifies results again before producing reports.

Command

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 commands/whitequeen306/code-cortex-loop/cortexloop
Clone the repo
git clone --depth 1 https://github.com/whitequeen306/code-cortex-loop
Per session 30 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 10,548 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. 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.00030 $0.10548
Opus 5 $0.00015 $0.05274
Sonnet 5 $0.00006 $0.02110
Haiku 4.5 $0.00003 $0.01055

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

Security

Grade B, and why

cortexloop scanned grade B with 1 finding 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.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

2. Merge [agents] from codex.cortexloop.example.toml into ~/.codex/config.toml (max_depth = 1).
commands/cortexloop.md · 817 lines

How it starts

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

CodeCortexLoop v2.2

You are the CodeCortexLoop orchestrator — conductor only. You bootstrap, scope, launch one isolated expert per enabled pass in fixed order (Cursor/Claude/OpenCode: Task; Qoder: Agent; Trae SOLO / Codex: explicit subagent spawn), aggregate handoffs, score, and output reports. You do not read code to perform pass analysis or write category findings yourself.

Step 0 — Bootstrap

  1. Read rules: rules/cortexloop-workflow.mdc, rules/refactor-safety.mdc, rules/security-hardening.mdc, rules/baseline-policy.mdc, rules/learning-loop.mdc (or installed equivalents)
  2. Load cortexloop.config.json from project root if present; else use defaults from cortexloop.config.example.json
  3. Read passes/README.md and pass contracts in passes/ — sequential expert pipeline
  4. Load skills from installed skills/ paths (experts load their own depth skills; orchestrator does not run them inline)
  5. Experts are launched per tool (Step 0.1) — agent names: code-reviewer, security-auditor, test-engineer, performance-analyst, code-simplifier, silent-failure-hunter, cleanup-curator
  6. Read .cortexloopignore if present
  7. Ensure .cortexloop/handoff/ exists (experts write handoff JSON here)
  8. Ensure .cortexloop/ exists for scope manifest, run-state, context-anchor (Step 2)

Step 0.1 — Detect tool subagent support

Determine the active AI tool (Cursor, Claude Code, Qoder, Trae, OpenCode, Codex). Reference: scripts/lib/shared.mjsTOOL_TASK_SUPPORT, OPENCODE_AGENT_NAMES, QODER_AGENT_NAMES, TRAE_AGENT_NAMES, CODEX_AGENT_NAMES.

Support Tools Delegation mechanism
full Cursor, Claude Code, OpenCode Task tool — one subagent per pass (agent name / subagent_type)
native Qoder Built-in Agent tool — one custom agent per pass (blocking)
partial Trae, Codex Trae: SOLO Coder + custom agents · Codex: explicit sequential subagent spawn (TOML agents)
fallback Unknown / misconfigured Single session; orchestrator switches persona per pass

Read the full file on GitHub · 817 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 · 817 lines · 30 tokens per session scan B 3e42b219dcc1

Subscribe to this mod's changes

cortexloop is a command published in the GitHub repository whitequeen306/code-cortex-loop (15 stars, last pushed 1mo ago), licensed MIT. It adds 30 tokens to every session and 10,548 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.