/claude-auto-context:extract-rulesfrom claude-auto-context
Extracts conventions and implicit knowledge from session data into .claude/rules/local/ rules files.
Ships in claude-auto-context. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Analyze session data to find implicit conventions, then create glob-scoped rules in .claude/rules/local/.
Rules = "institutional memory" (Boris Cherny). When Claude makes a mistake, the correction becomes a permanent rule so it never repeats.
For every candidate rule, ask: "Would removing this cause Claude to make mistakes?" If no → don't create it. If yes → create it.
Rules capture what Claude CANNOT discover by reading code, configs, or package.json:
| Category | Example | Why it's a rule |
|---|---|---|
| Past mistake prevention | "Never use enum, always literal unions" | Correction from user, not in any config |
| Non-obvious commands | "Run bun run test:file -- 'glob'" | Can't guess the flag syntax |
| Prohibitions | "Never touch prod DB directly" | Safety rail, not in code |
| Hidden sequencing | "Refresh auth token before API calls" | Order dependency not obvious from code |
| Convention divergence | "Error handling: Result type, not try-catch" | Project chose non-default pattern |
| Gotchas | "File X re-exports from Y — edit Y, not X" | Non-obvious indirection |
| Bad Rule | Why | What to do instead |
|---|---|---|
| "This project uses TypeScript" | tsconfig.json exists | Nothing — Claude reads it |
| "Tests are in tests/" | Discoverable from directory structure | Nothing |
| "Use ES modules" | package.json type:module | Nothing |
| "Write clean code" | Self-evident, every project wants this | Nothing |
| "The API returns JSON" | Discoverable from reading route handlers | Nothing |
| Code style already enforced by linter | ESLint/Prettier handles it deterministically | Hook, not rule |
| Anything in CLAUDE.md already | Duplication wastes tokens | Reference CLAUDE.md |
| Frequently changing information | Goes stale, causes wrong behavior | Keep in code comments |
Key principle (Anthropic official): "Never send an LLM to do a linter's job." If something can be enforced deterministically (format, lint, type-check), it should be a hook, not a rule.
Focus on "User Prompts" section of session data. This is where corrections live:
Session "Tool Activity" is secondary — use it to verify patterns, not as primary extraction source.
---
description: "One-line summary — used for dedup and context display"
paths:
- "src/auth/**"
created: "2026-03-30"
last_validated: "2026-03-30"
---
[Rule in 1-3 sentences. Specific trigger → specific action.]
created: ISO date when the rule was first writtenlast_validated: ISO date when the rule was last confirmed still relevant (set to today on create/update)Size: Each rule file should be under 200 characters body. One rule per file. If you need more detail, you're writing documentation, not a rule.
Bad: 500 chars explaining the history and rationale of why Result type is used. Good: "Error handling: use Result<T, E>, not try-catch. Functions return {ok, error} shape."
.claude/rules/local/ with required description: in frontmattersrc/auth/** over **paths: — applies globallypaths: present): file/directory-specific conventionspaths:): project-wide prohibitions, non-obvious commands, safety railsIf a pattern is not yet strong enough (seen only once), write to .claude-auto-context/pending-observations.json:
[{"pattern_key": "descriptive-key", "session_id": "...", "evidence": "brief desc", "agent_source": "rules-agent"}]
Read existing file first, append entries. Rules require 2+ session evidence.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub getklaim/claude-auto-context --plugin claude-auto-context6 skills in this plugin
/cac-applyReview and apply structural suggestions from Auto Context. USE WHEN user types /cac-apply or mentions applying suggestions./cac-create-skillCreate SKILL.md files from auto-detected workflow prompts. USE WHEN user types /cac-create-skill or wants to generate a skill from detected patterns./context-hygieneContext Hygiene Check**CRITICAL**: You may only CREATE or MODIFY files in `.claude/rules/local/`./create-suggestionDetect structural issues and create proposal files in .claude-auto-context/suggestions/. USE WHEN file splits, directory reorganization, or pattern unification is needed./run-workerWorker 수동 실행 및 상태 확인. USE WHEN 워커 테스트, worker 실행, 워커 상태.Other plugins' skills for the same job