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.
npx agentmods add rules/whitequeen306/code-cortex-loop/learning-loopgit clone --depth 1 https://github.com/whitequeen306/code-cortex-loopWhat 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 | $0.00018 | $0.02443 |
| Opus 5 | $0.00009 | $0.01222 |
| Sonnet 5 | $0.00004 | $0.00489 |
| Haiku 4.5 | $0.00002 | $0.00244 |
Grade A, and why
learning-loop 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.
How it starts
The opening of the file, as written. The whole thing — 221 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Learning Loop (CodeCortexLoop v2.2)
Purpose
CodeCortexLoop learns from Direct fixes via a playbook (.cortexloop/playbook.json). Before analysis, query relevant entries; after Direct fixes, reflect and record new patterns.
Anti-hallucination goal: memory is recall (where to look), not authority (what to conclude). Self-reinforcing echo chambers are blocked by verified-outcome confidence, two tiers, external oracles, diversity requirements, and time decay.
Core principles
Recall, not authority
Playbook hits tell the agent where to investigate first, not what the answer is:
- Re-derive every fix from current code context
- Re-verify with tests and refactor-safety rules
- Never paste a stored fix method as a diff or blind patch
Suggestions, not mandatory
Playbook hits do not:
- Skip any analysis pass
- Override suppressions or scope rules
- Force a fix without understanding context
Hits must be verified
When applying a playbook-suggested fix:
- Follow
rules/refactor-safety.mdc - Run tests after the change group
- Re-verify with analysis if in Direct mode
Bad or stale memory must never cause silent breakage. If a pattern does not fit, ignore it and record --outcome=rejected.
Negative signals must be recorded
If a suggested fix fails tests, is reverted, or is judged inapplicable, run playbook.mjs feedback with --outcome=failed or --outcome=rejected. Do not leave failed memories at high confidence.
Two tiers
| Tier | Meaning | Query behavior |
|---|---|---|
| candidate | Unconfirmed hypothesis | Hidden by default; shown only with --include-candidates, labeled as guesses — do NOT apply |
| verified | Trusted recall | Shown by default in Step 0.5 |
| quarantined | Failed / too low confidence | Never shown in query; pruned with --drop-quarantined |
Promotion to verified requires ALL of:
confidence >= 0.7verifiedCount >= 2distinctContexts >= 2(diverse evidence, not one file repeated)
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.
- yesterday First seen · 221 lines · 18 tokens per session scan A c03d5d43c3f4
learning-loop is a cursor rule published in the GitHub repository whitequeen306/code-cortex-loop (15 stars, last pushed 1mo ago), licensed MIT. It adds 18 tokens to every session and 2,443 once invoked, about $0.0001 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-30.
Other cursor rules, from other repositories
angular-20
This rule provides comprehensive best practices and coding standards for Angular development, focusing on modern TypeScript, standalone components, signals, and performance optimizations.
dev-standard
Apache Superset development standards and guidelines for Cursor IDE.
typescript
Changes to these high-fan-out internals can affect every message, delta, element, or rerun. Keep work in them minimal, and benchmark changes with representative stress-test apps.
coolify-ai-docs
Master reference to all Coolify AI documentation in .ai/ directory.
python_lib
Tips and guidelines specific to the development of the Streamlit Python library, not applicable to scripts and e2e tests.
specs
This directory contains product and tech specs for Streamlit features.