learn-rule

learn-rule is a skill for Claude Code, Codex from strikersam/autonomous-ai-agency. It costs 38 tokens per session (713 once invoked), scanned A, original, MIT.

A rule for saving useful corrections and discoveries in a project's long-term learning file. The file records what happened and the concrete rule to follow next time.

In plain words
What is it for?
Use it after a user correction, a newly discovered project rule, or a workflow pattern that should be remembered.
Why use it?
It helps prevent the same mistake or repository-specific misunderstanding from happening again in later sessions.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions CLAUDE.md; installed under .agents/ (shared by several agents).

Good fit Use it after a user correction, a newly discovered project rule, or a workflow pattern that should be remembered.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/strikersam/autonomous-ai-agency/learn-rule
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 strikersam/autonomous-ai-agency --skill learn-rule
Clone the repo
git clone --depth 1 https://github.com/strikersam/autonomous-ai-agency

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/strikersam/autonomous-ai-agency/learn-rule/github.svg)](https://agentmods.dev/skills/strikersam/autonomous-ai-agency/learn-rule)
Your own site
<a href="https://agentmods.dev/skills/strikersam/autonomous-ai-agency/learn-rule"><img src="https://agentmods.dev/badge/skills/strikersam/autonomous-ai-agency/learn-rule/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 learn-rule

Your own site · 80×15
<a href="https://agentmods.dev/skills/strikersam/autonomous-ai-agency/learn-rule"><img src="https://agentmods.dev/badge/skills/strikersam/autonomous-ai-agency/learn-rule.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 38 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 713 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. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium Memory Poisoning · line 11
    Skill injects content designed to persist in agent memory or context across interactions. Persistent injection can alter agent behavior long after the initial interaction.
    Fix: Do not allow untrusted input to persist in agent memory or context. Validate all content before storing and implement memory isolation between sessions.
How audits are shown
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.00038 $0.00713
Opus 5 $0.00019 $0.00357
Sonnet 5 $0.00008 $0.00143
Haiku 4.5 $0.00004 $0.00071

Measured 12d ago against content hash 1a062b432da8, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

learn-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 12d 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.

.agents/skills/learn-rule/SKILL.md · 109 lines

How it starts

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

Skill: learn-rule

When to Use

Use this skill whenever:

  • The user corrects a mistake you made
  • You discover a repo-specific rule that isn't in CLAUDE.md
  • A pattern works unexpectedly (positively or negatively)
  • You want to persist a decision for future sessions

This is how Claude gets smarter at this specific repo over time.


Instructions

Step 1 — Identify the rule

Extract the core rule from the correction or discovery. A good rule is:

  • Specific — refers to a concrete situation
  • Actionable — tells you what to do or not do
  • Memorable — can be read in under 10 seconds

Bad rule: "Be careful with auth code." Good rule: "Always call risky-module-review before touching admin_auth.py — even for 1-line changes."

Step 2 — Append to learnings file

File: .claude/state/learnings.md

Create it if it doesn't exist. Always append — never overwrite.

## YYYY-MM-DD — <short title>

**Situation:** What was being worked on when this was learned.
**Mistake/Discovery:** What went wrong or what was surprising.
**Rule:** <One clear, actionable sentence starting with a verb.>
**Source:** user-correction | self-discovery | docs

Example entry:

## 2026-04-09 — Don't use git add -A

**Situation:** Committing the router refactor.
**Mistake:** Used `git add -A` which staged keys.json accidentally.
**Rule:** Always stage specific files by name; never use `git add -A` or `git add .`.
**Source:** user-correction

Step 3 — Check if CLAUDE.md should be updated

If the rule is general enough to apply to every future session:

  1. Read CLAUDE.md
  2. Add it to the "Coding Rules" section (numbered, concise)
  3. Use repo-memory-updater skill if multiple rules need updating

Learnings File Format

.claude/state/learnings.md:

# Session Learnings

Rules and corrections learned from working in this repo.
Read this at the start of sessions via the `replay-learnings` skill.

---

## YYYY-MM-DD — title

**Situation:** ...
**Mistake/Discovery:** ...
**Rule:** ...
**Source:** ...

---

Read the full file on GitHub · 109 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. 12d ago First seen · 109 lines · 38 tokens per session scan A 1a062b432da8

Subscribe to this mod's changes

learn-rule is a skill published in the GitHub repository strikersam/autonomous-ai-agency (8 stars, last pushed yesterday), licensed MIT. It adds 38 tokens to every session and 713 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.