codedna: Agent for Claude Code

.claude/agents/codedna-protocol-enforcer.md

codedna-protocol-enforcer is an agent for Claude Code from Larens94/codedna. It costs 463 tokens per session (4,113 once invoked), scanned A, original, MIT.

A specialist reviewer for Python files that checks compliance with the CodeDNA v0.9 annotation standard, a format for recording file purpose, interfaces, dependencies, and rules.

In plain words
What is it for?
Adding or repairing module documentation, checking exported symbols and usage notes, enforcing function-level rules, and reviewing recently written Python files.
Why use it?
It helps keep Python code understandable to both people and other coding agents without changing the code's business logic.

Agent for Claude Code

Written for Claude Code: installed under .claude/. Also seen: model in frontmatter; mentions CLAUDE.md.

This is Larens94/codedna's own configuration. It tells Claude Code how to work on codedna itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything codedna configures →

Not installable: its command points at a path on the author’s own machine, so it runs nowhere else. The line is /Users/fabriziocorpora/Desktop/automation-lab/dynamic-bi-factory/codedna/.claude/agent-memory/codedna-protocol-enforcer/.

Reuse

Borrowing it

Nothing to install: this file belongs to Larens94/codedna. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/Larens94/codedna/main/.claude/agents/codedna-protocol-enforcer.md
Clone the repo
git clone --depth 1 https://github.com/Larens94/codedna

Made for: Claude Code.

Wrote 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.

agentmods badge for codedna-protocol-enforcer

README.md
[![agentmods](https://agentmods.dev/badge/agents/larens94/codedna/codedna-protocol-enforcer/github.svg)](https://agentmods.dev/agents/larens94/codedna/codedna-protocol-enforcer)
Your own site
<a href="https://agentmods.dev/agents/larens94/codedna/codedna-protocol-enforcer"><img src="https://agentmods.dev/badge/agents/larens94/codedna/codedna-protocol-enforcer/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.

agentmods 80×15 button for codedna-protocol-enforcer

Your own site · 80×15
<a href="https://agentmods.dev/agents/larens94/codedna/codedna-protocol-enforcer"><img src="https://agentmods.dev/badge/agents/larens94/codedna/codedna-protocol-enforcer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 463 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 4,113 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00463 $0.04113
Opus 5.5 $0.00185 $0.01645
Sonnet 5.5 $0.00093 $0.00823
Haiku 4.5 $0.00046 $0.00411

Measured 1mo ago against content hash 951d4594563e, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

codedna-protocol-enforcer 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.

.claude/agents/codedna-protocol-enforcer.md · 317 lines

How it starts

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

You are an elite inter-agent CodeDNA Protocol Enforcer, the authoritative specialist for the CodeDNA v0.9 annotation standard (https://github.com/Larens94/codedna). Your sole mission is to guarantee that every Python file in the codebase is a first-class citizen of the CodeDNA inter-agent communication protocol. You operate as a precision instrument used exclusively by other coding agents and by the primary assistant — never for general-purpose tasks.


Your Identity and Scope

You are not a general coding assistant. You enforce a strict structural contract between agents. Every file you touch or review must leave the codebase more legible, more safe, and more inter-agent-friendly than you found it. You do not write business logic unless it is already present — you annotate, validate, enforce, and repair CodeDNA metadata.


Core Responsibilities

1. Module Docstring Enforcement

Every Python source file MUST begin with a CodeDNA module docstring in exactly this 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 was implemented and what was noticed>
         message: "<open hypothesis or unverified observation for the next agent>"
"""
  • First line: filename.py — <purpose ≤15 words> — be precise, not vague.
  • exports: List every public symbol with its signature and return type. These are contracts. Never remove or rename them without explicit instruction.
  • used_by: List every known caller with the format file.py → function_name. Tag with [cascade] if a change here would force changes in callers.
  • rules: Hard constraints written for the next agent reading this file. Always actionable, never vague. Updated in-place — never append duplicate rules.
  • agent: Append-only session log. Format: model-id | provider | YYYY-MM-DD | session_id | narrative. Never edit existing lines.
  • message (under agent): Open hypotheses not yet certain enough to become rules:. Append-only.

Read the full file on GitHub · 317 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. 1mo ago First seen · 317 lines · 463 tokens per session scan A 951d4594563e

Subscribe to this mod's changes

codedna-protocol-enforcer is an agent published in the GitHub repository Larens94/codedna (151 stars, last pushed 9d ago), licensed MIT. It adds 463 tokens to every session and 4,113 once invoked, about $0.0019 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-30.

Related

Other agents, from other repositories

django-reviewer

Expert Django code reviewer specializing in ORM correctness, DRF patterns, migration safety, security misconfigurations, and production-grade Django practices. Use for all Django code changes. MUST BE USED for Django projects.

affaan-m/ECC · 45 tokens

pytorch-build-resolver

PyTorch runtime, CUDA, and training error resolution specialist. Fixes tensor shape mismatches, device errors, gradient issues, DataLoader problems, and mixed precision failures with minimal changes. Use when PyTorch training or inference crashes.

affaan-m/ECC · 52 tokens

python-reviewer

Expert Python code reviewer specializing in PEP 8 compliance, Pythonic idioms, type hints, security, and performance. Use for all Python code changes. MUST BE USED for Python projects.

affaan-m/ECC · 43 tokens

python-pro

Python 3.13 language expert for the ClosedLoop plugin monorepo. Reviews implementation plans for type annotation correctness, argparse CLI conventions, import isolation, fail-open/fail-closed boundary patterns, and pyright/ruff compliance. Produces type-patterns.md in legacy mode.

closedloop-ai/claude-plugins · 60 tokens

python-pro

Write idiomatic Python code with advanced features like decorators, generators, and async/await. Optimizes performance, implements design patterns, and ensures comprehensive testing. Use PROACTIVELY for Python refactoring, optimization, or complex Python features.

echoVic/blade-code · 51 tokens

python-script-reviewer

Reviews Python scripts for best practices, type safety, and project conventions.

closedloop-ai/claude-plugins · 19 tokens