learn — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited learn (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
<objective> Analyze the current session's interactions to extract behavioral instincts — corrections the user made, confirmations of non-obvious approaches, and recurring tool-usage patterns — then persist them as scored instinct files for future sessions. </objective>
You are extracting instincts — learned behavioral rules that improve future sessions. Be conservative. Only extract clear, repeatable patterns, never one-off instructions or obvious behaviors.
First, determine the current date and session scope:
TODAY=$(date +%Y-%m-%d)
MONTH=$(date +%Y-%m)
EVENT_LOG="$HOME/.claude/instincts/events/${MONTH}.ndjson"Read the event log if it exists (filter to today's entries):
if [ -f "$EVENT_LOG" ]; then
grep "\"$TODAY" "$EVENT_LOG" | tail -100
fiThen review the current conversation for these signal categories:
Also check for any --project-only flag in the invocation arguments. If present, only extract project-scoped instincts.
For each detected pattern, formulate it as a structured behavioral rule:
always-run-ruff-after-python-edit)Be specific. "Be careful with files" is useless. "Run ruff check after every Python file edit in this project" is an instinct.
For each candidate instinct, check against existing instincts using the similarity utility:
python3 -c "
import sys; sys.path.insert(0, '$HOME/.claude/instincts/lib')
from similarity import find_similar
results = find_similar('<candidate_rule_text>', '$HOME/.claude/instincts/global/')
for r in results: print(f'{r[\"id\"]}|{r[\"similarity\"]:.2f}|{r[\"name\"]}')
"If the similarity library is not available, fall back to a manual grep-based search:
grep -rl '<key_phrase>' ~/.claude/instincts/global/ ~/.claude/instincts/projects/ 2>/dev/nullDecision logic:
confirmations or corrections count, update updated_at timestamp. Do NOT create a duplicate.Generate a unique ID for each new instinct:
SUFFIX=$(python3 -c "import secrets; print(secrets.token_hex(2))")
ID="INS-$(date +%Y%m%d)-${SUFFIX}"Determine scope:
~/.claude/instincts/projects/<project-slug>/ if the pattern is specific to the current project (references project-specific files, tools, APIs, or conventions).~/.claude/instincts/global/ if the pattern is universal (general coding practices, tool usage patterns, communication preferences).--project-only was passed, always use project scope.Derive <project-slug> from the current working directory's basename or git remote name.
Create the instinct file at the appropriate path using this exact format:
---
id: <ID>
name: "<kebab-case-name>"
description: "<one-line summary>"
type: feedback
scope: project|global
status: candidate
confidence: 0.50
score:
successes: 0
failures: 0
confirmations: 1
corrections: 0
last_applied_at: "<ISO-8601 timestamp>"
half_life_days: 21
decay_floor: 0.05
signals:
trigger_patterns:
- "<pattern1>"
- "<pattern2>"
anti_patterns: []
evidence:
- session: "<session_id_or_date>"
kind: correction|confirmation|pattern
summary: "<what happened>"
ts: "<ISO-8601 timestamp>"
lineage:
parent_ids: []
cluster_id: null
promoted_from: null
version: 1
created_at: "<ISO-8601 timestamp>"
updated_at: "<ISO-8601 timestamp>"
---
## Operational Rule
<The behavioral rule — a clear, prescriptive instruction that an AI agent can follow.
Write it as an imperative: "Always X when Y" or "Never X unless Y".
Include the WHY if it is not obvious.>Set initial confidence based on evidence strength:
Ensure the appropriate INSTINCTS.md index file exists (create if needed):
~/.claude/instincts/global/INSTINCTS.md for global instincts~/.claude/instincts/projects/<slug>/INSTINCTS.md for project instinctsAppend one line per new or updated instinct:
- <ID> | <status> | <confidence> | "<name>" | created <YYYY-MM-DD>For merged/updated instincts, find and replace the existing line with updated confidence.
Output a clear summary:
## Instinct Extraction Report
**Session**: <date>
**Scope**: <global|project|both>
### New Instincts Created (N)
- INS-XXXXXXXX-XXXX | "<name>" | confidence: 0.XX | scope: <scope>
→ "<one-line description>"
### Existing Instincts Updated (N)
- INS-XXXXXXXX-XXXX | "<name>" | confidence: 0.XX → 0.XX
→ merged evidence from this session
### Skipped (N)
- "<pattern>" — reason: <too weak / one-off / already covered by INS-XXX>If no instincts were extracted, say so honestly and explain why (e.g., "Session was straightforward with no corrections or non-obvious confirmations").
mkdir -p).~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.