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/larens94/codedna/cursorrulesgit clone --depth 1 https://github.com/Larens94/codednaWhat 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.01291 | $0.01291 |
| Opus 5 | $0.00646 | $0.00646 |
| Sonnet 5 | $0.00258 | $0.00258 |
| Haiku 4.5 | $0.00129 | $0.00129 |
Grade A, and why
cursorrules 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.
How it starts
The opening of the file, as written. The whole thing — 142 lines — stays where its author put it; the contents beside it link to each section on GitHub.
CodeDNA v0.9 — In-Source Communication Protocol
Setup: pipx install git+https://github.com/Larens94/codedna.git && codedna install --path . --tools cursor --no-wiki-sync && codedna init . --no-llm
Every supported source file must start with a CodeDNA header using valid native comment syntax. Python uses a module docstring; never copy Python delimiters into another language.
Required command workflow
- Onboarding:
codedna doctor --path . - Before a public change:
codedna impact <file-or-symbol> --path . - After structural edits:
codedna verify .; review evidence, runcodedna refresh ., then verify again if stale - Automation: add
--json; verification covers structural fields, not semantic truth
Module docstring format
"""filename.py — <what it does, ≤15 words>.
exports: public_function(arg) -> return_type
used_by: consumer_file.py → consumer_function
rules: <hard constraint agents must never violate>
agent: <model-id> | <provider> | <YYYY-MM-DD> | <session_id> | <what you did and what you noticed>
"""
Rules on every edit
- Read
.codednaat repo root first — project structure and recent session history - Re-read
rules:as your first step — never violate these constraints - Read
Rules:in function docstrings before writing logic there - Check
used_by:after changes — update callers if signatures change - Never rename
exports:symbols without explicit instruction - If you discover a constraint or fix a bug, add it to
rules:for the next agent - After editing a file, append a new
agent:line to the module docstring. Keep only the last 5 entries — drop the oldest if adding a 6th. Full history is in git and.codedna.
Rules on generate
- Write the module docstring before any imports
- Every public function must have a
Rules:docstring - Use semantic variable names:
list_dict_users_from_db = get_users()
Writing good rules:
rules: must be specific and actionable — never vague.
# ✅ Good rules:
rules: get_invoices() returns ALL tenants — caller MUST filter is_suspended() before aggregating
rules: amount is in cents not euros — divide by 100 before display
rules: soft-delete via deleted_at — NEVER use DELETE, always SET deleted_at = NOW()
# ❌ Bad rules:
rules: handle errors gracefully
rules: follow best practices
rules: none ← when there ARE constraints but nobody wrote them
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.
- 2d ago First seen · 142 lines · 1,291 tokens per session scan A fc2ee0707f96
cursorrules is a cursor rule published in the GitHub repository Larens94/codedna (145 stars, last pushed 5d ago), licensed MIT. It adds 1,291 tokens to every session, about $0.0065 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
mempalace-recall-always
Always-on MemPalace recall — search the palace before answering about past work, people, projects, or prior decisions.
simple-language
when writing documentation.
pagerduty-mcp-server
This file provides context for how Goose and large language models should interact with the pagerdutymcpserver repository.
backend-python
Cursor rule "backend-python" from coeusyk/inference-x, covering backend python rules, stack assumptions, code style, fastapi conventions and schema conventions.
api-tester
Expert API testing specialist focused on comprehensive API validation, performance testing, and quality assurance across all systems and third-party integrations.
cursorrules
You are working on stripe-mcp, an MCP server and SOTA React webapp providing Stripe payment tools and Austrian/EU tax compliance.