anchor-write

anchor-write is a skill for Claude Code, Codex from unknowbug/anchorlaw. It costs 41 tokens per session (502 once invoked), scanned A, a copy of anchor.write, MIT.

A code-annotation workflow for attaching verification records to public functions. An anchor is a note that points to a test, debugging trace, memory dump, or an honest statement that verification is not yet possible.

In plain words
What is it for?
Use it after implementing or refactoring public Python, TypeScript, or C++ functions, then validate the annotations with anchor.test.
Why use it?
It makes function claims traceable and prevents unsupported test evidence from being presented as proof.

Skill for Claude CodeCodex

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 skills/unknowbug/anchorlaw/anchor-write
Any agent
npx skills add unknowbug/anchorlaw --skill anchor-write
Clone the repo
git clone --depth 1 https://github.com/unknowbug/anchorlaw

Made for: Claude Code, Codex.

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 anchor-write

README.md
[![agentmods](https://agentmods.dev/badge/skills/unknowbug/anchorlaw/anchor-write.svg)](https://agentmods.dev/skills/unknowbug/anchorlaw/anchor-write)
Your own site
<a href="https://agentmods.dev/skills/unknowbug/anchorlaw/anchor-write"><img src="https://agentmods.dev/badge/skills/unknowbug/anchorlaw/anchor-write.svg" alt="Measured on agentmods" height="20"></a>
Per session 41 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 502 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin 92% copy Near-identical to another mod 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.00041 $0.00502
Opus 5 $0.00020 $0.00251
Sonnet 5 $0.00008 $0.00100
Haiku 4.5 $0.00004 $0.00050

Measured today against content hash 02c042d12469, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

anchor-write 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 today.

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.

Origin

This is a copy

92% identical to anchor.write — 3 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

dsh/skills/anchor-write/SKILL.md · 43 lines

What it actually says

anchor.write — 写 Anchor 标注

Protocol: spec/protocol-v0.20.md §5.1/§5.2/§5.5, §13 Layer: L2 (Anchors) Execution: inline

触发场景

实现或重构完一个公开函数后,为该函数声明验证锚点。

规则

  1. 每个公开函数必须有 ≥1 个 test 或 ≥1 个 idk(§5.1 compile-time check)。
  2. @anchor.test 必须带 source(§5.5): source="<type>:<binary_or_file>!<function>#<id>, offset=<addr>, <key_observations> observed <ISO8601>"
    • source 类型:trace(动态调试快照)/ memory(内存转储)→ 允许 @test
    • static(静态分析推断)→ 仅允许 @idk;@test 用它或缺失 → INVALID
  3. 无法验证的边界 → 诚实写 @anchor.idk(§5.2),禁止写假 test 凑数。
  4. source 字符串实现 MUST 原样保留(审计用途)。

三语言语法(§13)

语言 声明位置 验证载体
Python 装饰器 test_fn lambda
TypeScript JSDoc 注释(inert) 运行时 assert
C++ 行注释 // @anchor.test("desc", source="...") / // @anchor.idk("desc")(inert) 独立 probe binary

输出

写入的 anchor 标注(含合法 source)。

约束

  • 语义照 §5,不复制协议原文。
  • 写完后跑 anchor.test 验证。
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. today Changed 02c042d12469
  2. 4d ago First seen · 43 lines · 41 tokens per session scan A 97f82e30ec3f

Subscribe to this mod's changes

anchor-write is a skill published in the GitHub repository unknowbug/anchorlaw (5 stars, last pushed 3d ago), licensed MIT. It adds 41 tokens to every session and 502 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. It is 92% identical to anchor.write, differing in 3 lines, and is treated as a copy.

Related

Other skills, from other repositories

permanent-memory-loader

Loads permanentmemory.md summary lines (≤120 always-loaded tokens, hard cap 200). Surfaces durable wisdom from past Epics into the current session. Silent if .claude/memory/ does not exist.

nguyenthienthanh/aura-frog · 48 tokens

optimize-model-precision

Use when evaluating FP16, BF16, or supported quantization formats for a TensorRT-Model-Connect model. Establishes a model-owned correctness baseline, changes one effective build option at a time, detects ineffective precision, and retains comparable parity, memory, bundle, and performance evidence.

NVIDIA/TensorRT-Model-Connect · 64 tokens

openspec-plus-apply

MANDATORY skill that activates whenever the OpenSpec apply phase begins. Triggers: /opsx-apply runs, the openspec-apply-change vanilla skill is referenced or active, openspec instructions apply is invoked, or the user asks to implement, apply, execute, or build out an OpenSpec change ('implement the change', 'apply…

sudokar/openspec-plus · 110 tokens

openspec-plus-spec

MANDATORY skill that activates whenever the OpenSpec specification phase begins. Triggers: /opsx-new or /opsx-continue runs; openspec-new-change, openspec-continue-change, or openspec-explore is active; openspec instructions spec or openspec instructions specs is invoked; or the user wants to create, update, review…

sudokar/openspec-plus · 88 tokens

openspec-plus-tdd

MANDATORY skill that activates whenever code is written to implement an OpenSpec change task. Triggers: openspec-plus-apply is active, /opsx-apply is running, the user is implementing tasks from an OpenSpec change, an implementer subagent dispatched by openspec-plus-apply is starting work, or the user invokes phrases…

sudokar/openspec-plus · 190 tokens

openspec-plus-proposal

MANDATORY skill that activates whenever the OpenSpec proposal phase begins. Triggers: /opsx-new or /opsx-continue runs; openspec-new-change, openspec-continue-change, or openspec-explore is active; openspec instructions proposal is invoked; or the user wants to create, update, review, refine, or discuss an OpenSpec…

sudokar/openspec-plus · 82 tokens