anchor.scan

anchor.scan is a skill for Claude Code, Codex from unknowbug/anchorlaw. It costs 41 tokens per session (773 once invoked), scanned A, original, MIT.

A static code-review procedure that runs Anchor Law scanners to find defensive programming patterns and labels findings as errors, warnings, or information.

In plain words
What is it for?
Use it to scan Python or C++ code, investigate reported defensive patterns, fix errors, and decide whether warnings need code anchors or other changes.
Why use it?
It provides a required evidence-based check before code is merged or when a defensive-pattern report appears. This prevents agents from dismissing possible problems by inspection alone.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions AGENTS.md.

Good fit Use it to scan Python or C++ code, investigate reported defensive patterns…

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/unknowbug/anchorlaw/anchor.scan
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.

Any agent
npx skills add unknowbug/anchorlaw --skill anchor.scan
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.scan

README.md
[![agentmods](https://agentmods.dev/badge/skills/unknowbug/anchorlaw/anchor.scan.svg)](https://agentmods.dev/skills/unknowbug/anchorlaw/anchor.scan)
Your own site
<a href="https://agentmods.dev/skills/unknowbug/anchorlaw/anchor.scan"><img src="https://agentmods.dev/badge/skills/unknowbug/anchorlaw/anchor.scan.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 773 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.00041 $0.00773
Opus 5 $0.00020 $0.00387
Sonnet 5 $0.00008 $0.00155
Haiku 4.5 $0.00004 $0.00077

Measured 2d ago against content hash 23686588df85, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

anchor.scan 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.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

archive/reasonix/skills/anchor.scan/SKILL.md · 46 lines

What it actually says

anchor.scan — 静态审查

Protocol: spec/protocol-v0.20.md §6 (Scanner Pattern Catalog), §7 Level 1 Layer: L1 (Scanner) Execution: subprocess

触发场景(触发点,MUST 强度)

以下两个触发点 MUST 运行本 skill(改完代码待提交前,或收到防御性模式报告时):

  1. 模块并入审查前(流水线 stage 3)(与 §15.4 门禁中 judge 审查配套;v0.10 流水线 stage 5 并入审查):Worker 完成模块、或主 Agent 完成代码改动后,先跑 scan 获得 findings 清单并逐条处置,再交 Judge 并入审查——scan 的 findings 清单是 Judge 审查的机械证据来源之一(AGENTS.md 将 scan 列为「发散型优化例外」:触发必跑,执行方式 subprocess 可选,二者不冲突)。
  2. 收到防御性模式报告时:CI 报告 / scanner 输出 / 他人反馈疑似防御性模式,MUST 跑 scan 核实后再处置,不得凭感觉判断「没问题」。

计划预置(§15.4 Plan-time placement 精神):工作流计划(todo)在规划阶段预置本 skill 的触发步骤;到达并入审查步骤时发现未预置/未执行 → MUST 停下补跑 scan 再进入审查,不得跳过。

反模式(触发不完整即进入审查/提交)

  • 跳过 scan 直接交并入审查或交付,无 findings 处置记录
  • 收到防御性模式报告不跑 scan,直接凭感觉判断「没问题」
  • 静默忽略 WARNING(无「补 anchor 或修」处理决定,与操作步骤 §6.1 分级一致)

操作步骤

  1. 运行扫描(CLI,§14.4):
    • anchorlaw-scanner check <dir>(独立 scanner 包,Python 防御模式)
    • anchorlaw-scanner check --lang cpp <dir>(C++ @anchor 标注提取验证,§8 annotation-extraction)
    • anchorlaw check <dir>(完整包内置入口,--no-recursive 可关递归)
  2. 解读输出分级(§6.1):
    • ERROR → 必须修(吞噬异常、无意义测试等致命模式)
    • WARNING → 纯逻辑公开函数缺 anchor 等,高锚定价值 → 补 anchor 或修
    • INFO → I/O 类函数缺 anchor,锚定价值低 → 补 @anchor.idk 或忽略
  3. 提交前确认 ERROR = 0,且 WARNING 均有处理决定。

输出

findings 清单 + 每个 finding 的处理决定(修 / 补 idk / 忽略 / 挑战)。

约束

  • 只通过 CLI 扫描,不 import 内部 API(§14.4)。
  • 疑似误报必须走 anchor.challenge(§12),不得静默忽略。
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 Changed 23686588df85
  2. 6d ago First seen · 46 lines · 41 tokens per session scan A 9adc20a7076d

Subscribe to this mod's changes

anchor.scan is a skill published in the GitHub repository unknowbug/anchorlaw (5 stars, last pushed 6d ago), licensed MIT. It adds 41 tokens to every session and 773 once invoked, about $0.0002 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-31.

Related

Other skills, from other repositories

solid-principles

SOLID principles checklist with Java examples. Use when a class has too many responsibilities, an abstraction leaks, or a dependency points the wrong way, and when the user asks about Single Responsibility, Open/Closed, Liskov, Interface Segregation or Dependency Inversion. For naming, duplication and method length…

decebals/claude-code-java · 73 tokens

security-audit

Java security checklist covering OWASP Top 10, input validation, injection prevention, and secure coding. Works with Spring, Quarkus, Jakarta EE, and plain Java. Use when reviewing code security, before releases, or when user asks about vulnerabilities.

decebals/claude-code-java · 55 tokens

issue-triage

Triage and categorize GitHub issues with priority labels. Use when user says "triage issues", "check issues", "review open issues", or during regular maintenance of GitHub issue backlog.

decebals/claude-code-java · 44 tokens

ring:migrating-to-lib-observability

Migrating a Lerian Go app off lib-commons observability imports (deprecated shims or removed APIs) to lib-observability via a fixed mapping table, then bumps go.mod and validates the build; ring:backend-go applies the edits. Covers log/zap/runtime/assert, opentelemetry/tracing, HTTP middleware, context helpers, and…

LerianStudio/ring · 104 tokens

ring:searching-code

Forensic code search and analysis with optional Chain of Draft (CoD) ultra-concise mode. Five-phase methodology (clarification, planning, execution, analysis, synthesis) with severity assessment. Use for targeted investigation of specific patterns, bugs, or vulnerabilities. Skip for broad architecture mapping (use…

LerianStudio/ring · 74 tokens

ring:exploring-codebases

Exploring a codebase across phases: scopes the target, detects architecture, components, and layers, deep-dives each discovered perspective, then synthesizes findings into actionable guidance with file:line evidence. Use to understand how a feature or system works before planning changes, or to orient on an unfamiliar…

LerianStudio/ring · 91 tokens