capture-rule

capture-rule is a skill for Claude Code from atman-33/workhub. It costs 63 tokens per session (1,015 once invoked), scanned A, original, MIT.

A tool for saving a reusable, non-obvious project insight as a rule that can be automatically added in relevant future sessions.

In plain words
What is it for?
Use it to record conventions, tooling quirks, design constraints, and the reasons behind decisions.
Why use it?
It prevents the same project-specific discovery or explanation from being lost or repeated.

Skill for Claude Code

Written for Claude Code: argument-hint in frontmatter.

Part of the workhub plugin — 20 skills, 1 agent shipped together

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/atman-33/workhub/capture-rule
Any agent
npx skills add atman-33/workhub --skill capture-rule
Clone the repo
git clone --depth 1 https://github.com/atman-33/workhub

Made for: Claude Code.

Or install workhub, the plugin that ships this one along with the rest of its 20 skills, 1 agent.

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 capture-rule

README.md
[![agentmods](https://agentmods.dev/badge/skills/atman-33/workhub/capture-rule.svg)](https://agentmods.dev/skills/atman-33/workhub/capture-rule)
Your own site
<a href="https://agentmods.dev/skills/atman-33/workhub/capture-rule"><img src="https://agentmods.dev/badge/skills/atman-33/workhub/capture-rule.svg" alt="Measured on agentmods" height="20"></a>
Per session 63 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,015 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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.00063 $0.01015
Opus 5 $0.00032 $0.00508
Sonnet 5 $0.00013 $0.00203
Haiku 4.5 $0.00006 $0.00102

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

Security

Grade A, and why

capture-rule 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 6d 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.

plugins/workhub/skills/capture-rule/SKILL.md · 101 lines

How it starts

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

Capture Rule

Route durable knowledge to the home where it will auto-inject when next relevant.

Step 1 — Qualify the insight

Capture only knowledge that is reusable and non-obvious from code, git history, or existing instruction files: gotchas, build/tooling quirks, design invariants, conventions, the "why" behind a decision.

Skip (and tell the user why) if it is: a one-off fact for this task only, already documented in the repo, or plainly derivable by reading the code. If it does not qualify, stop here.

Establish the target repository the insight is about. If unclear, infer from the files touched this session and confirm with the user.

Step 2 — Route to a home

Pick exactly one:

Insight is about… Home
A specific repo's own code/tooling that repo's .claude/rules/<slug>.md
Target-repo files, but the rule must live in the harness workspace harness .claude/rules-ex/<slug>.md
The harness's own machinery harness .claude/rules/<slug>.md (often grow the internals notes file, e.g. harness-internals.md or vault-harness.md)
Personal/cross-project preference, feedback, or machine-local fact auto-memory (MEMORY.md + memory/)

If the home is auto-memory, do not write a rule — tell the user it belongs in memory and stop.

Step 3 — Dedup

Search the chosen directory for an existing rule on the same topic. If one exists, update it instead of creating a new file. One topic = one file.

Step 4 — Write the rule

Use a kebab-case slug. The body below the frontmatter is exactly what gets injected — keep it focused and imperative.

.claude/rules (native, lives in the repo it governs):

  • paths: is optional. Omit it to inject on every file touched in that repo; add repo-relative globs to scope it. Matching is permissive (an implicit leading **/ is tried), so src/** also matches nested paths.
---
paths:
  - "src/**/*.ts"
---
<the insight, imperative and focused>

Read the full file on GitHub · 101 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. 6d ago First seen · 101 lines · 63 tokens per session scan A c4748d99ac2a

Subscribe to this mod's changes

capture-rule is a skill published in the GitHub repository atman-33/workhub (2 stars, last pushed yesterday), licensed MIT. It adds 63 tokens to every session and 1,015 once invoked, about $0.0003 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

superbrain-distill

Internal SuperBrain skill — run by the detached capture child to distill a session-event delta into routed Obsidian notes. Not for direct user invocation.

m3talux/superbrain · 36 tokens

memory

Use this skill when Pioneer should proactively use durable memory or recalled context: decide whether memory can improve a turn, answer from remembered user/project facts, request memory tools, search/list/get stored memories, save durable preferences or project decisions, forget memories, audit or clean up memory, or…

pioneerdotai/pioneer · 64 tokens

trellis-update-spec

Captures executable contracts and coding conventions into .trellis/spec/ documents. Use when learning something valuable from debugging, implementing, or discussion that should be preserved for future sessions.

fy-agent/fyagent · 40 tokens

trellis-session-insight

Reach into past AI conversation history through the trellis mem CLI. Use whenever the user asks 'how did we solve X last time', 'have we discussed this before', 'what was the decision on X', 'remind me what we did in this task', '上次怎么解的', '之前讨论过吗', '想起一段对话', or when starting a brainstorm that overlaps prior work…

fy-agent/fyagent · 140 tokens

recall

Retrieve session memory across 4 modes — TEMPORAL (date browsing), KEYWORD (FTS lookup), DEEP (cross-session synthesis), LOAD (specific file). Trigger on "what did I do yesterday/last week", "why did we...", "remind me...", "find the memo about...", "last time we...", "patterns across projects", "load the X topic". Do…

linxule/memex-plugin · 112 tokens

memo-writing

How to write effective session memos — format, frontmatter schema, observation extraction, topic-signal append. Trigger on /memex:save, "save this for later", "remember this", "save what we discussed", "document this session", "create a memo", or when the [memex] activity nudge appears in context. Do NOT trigger for…

linxule/memex-plugin · 125 tokens