agentleFS
search-atlas-groupsearch-atlas-group/amm-founding-circle/skills/instinct-learn/SKILL.md

learn

Skill0 starsChanged 5 months agoMITView on GitHub

Extract instincts from the current session — corrections, confirmations, and tool-usage patterns

195 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use add-anydoc, add-clidash and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • TomGranotSkill

    add-anydoc

    Add local office-document-to-Markdown conversion to NanoClaw agent containers with the pinned Firecrawl AnyDoc CLI. Use when agents need to read attached Word, PowerPoint, Excel, OpenDocument, RTF, EPUB, CSV, or text-based PDF files without uploading them to a hosted parser.

    Also in 5 projects that use this

  • TomGranotSkill

    add-clidash

    Add clidash — a zero-dependency, read-only web dashboard that derives its tabs and tables at runtime from any CLI that lists resources as JSON. Ships pre-wired for NanoClaw's ncl CLI (agent groups, sessions, channels, users, roles), plus message-activity charts, a log tail, and a read-only file viewer for group skills/CLAUDE.md/profiles.

    Also in 5 projects that use this

  • seek888Skill

    open-gstack-browser

    Launch GStack Browser — AI-controlled Chromium with the sidebar extension baked in. Opens a visible browser window where you can watch every action in real time. The sidebar shows a live activity feed and chat. Anti-bot stealth built in. Use when asked to "open gstack browser", "launch browser", "connect chrome", "open chrome", "real browser", "launch chrome", "side panel", or "control my browser". Voice triggers (speech-to-text aliases): "show me the browser".

    Also in 11 projects that use this

  • Saqlain-811Skill

    ios-sync

    Regenerate the iOS debug bridge against the latest upstream gstack templates. (gstack)

    Also in 6 projects that use this

  • MicrosoftSkill

    add-codex

    Use Codex (CLI + AppServer) as the full agent provider — planning, tool orchestration, native compaction, MCP tools, session resume — in place of the Claude Agent SDK. ChatGPT subscription or OPENAI_API_KEY. Per-group via agent_provider. Distinct from using OpenAI as an MCP tool (where Claude remains the planner).

    Also in 6 projects that use this

  • MicrosoftSkill

    add-deltachat

    Add DeltaChat channel integration via @deltachat/stdio-rpc-server. Native adapter — no Chat SDK bridge. Email-based messaging with end-to-end encryption.

    Also in 6 projects that use this

  • +5 more from TomGranot
  • +1 more from microsoft

The file

We split this skill into the rules it gives an agent

11 rules. 0 are common, 6 are distinctive, and 5 are very specific to this project.

  • 0

    Common

    Most of the 170 edited versions we read keep these.

  • 6

    Distinctive

    This author's own choices. Worth a look.

  • 5

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Read the event log if it exists (filter to today's entries):

    line 36
  2. Distinctive:

    If the similarity library is not available, fall back to a manual grep-based search:

    line 77
  3. Very specific:

    Use ~/.claude/instincts/projects/<project-slug>/ if the pattern is specific to the current project (references project-specific files, …

    line 97
  4. Very specific:

    Use ~/.claude/instincts/global/ if the pattern is universal (general coding practices, tool usage patterns, communication preferences).

    line 98
  5. Very specific:

    If --project-only was passed, always use project scope.

    line 99
  6. Distinctive:

    Create the instinct file at the appropriate path using this exact format:

    line 103
  7. Very specific:

    Ensure the appropriate INSTINCTS.md index file exists (create if needed):

    line 154
  8. Distinctive:

    If no instincts were extracted, say so honestly and explain why (e.g., "Session was straightforward with no corrections or non-obvious …

    line 188
  9. Distinctive:

    Never fabricate patterns: If you are unsure whether something is an instinct, skip it and mention it in the "Skipped" section.

    line 192
  10. Distinctive:

    One instinct per behavioral rule: Do not bundle multiple unrelated rules into a single instinct.

    line 195
  11. Very specific:

    Ensure directories exist: before writing files (mkdir -p).

    line 196

“Common” is measured: kept by at least 6 in 10 of the 170 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md
<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>

Instructions

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.

Thresholds for Extraction

  • A correction must be emphatic ("no, never do X", "stop doing X", "wrong") or repeated (same correction given 2+ times) to qualify. A gentle redirect ("actually, try Y instead") counts only if the original behavior was a plausible default.
  • A confirmation must be for a non-obvious behavior. "Yes" to "should I save the file?" is NOT an instinct. "Yes, always use that flag" or "exactly, that ordering matters" IS an instinct.
  • A tool-usage pattern must appear 3+ times in the session to qualify. Two occurrences is coincidence.

Step 1: Gather Session Context

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
fi

Then review the current conversation for these signal categories:

  1. Corrections — Look for user messages containing: "no", "don't", "stop", "wrong", "not that", "never", "instead", "actually". The message AFTER the correction contains the desired behavior.
  2. Confirmations — Look for user messages containing: "yes", "exactly", "perfect", "good", "that's right", "keep doing that". The behavior being confirmed is the instinct.
  3. Tool-order patterns — Look for repeated sequences of tool usage (e.g., edit → lint → test, or read → grep → read).

Also check for any --project-only flag in the invocation arguments. If present, only extract project-scoped instincts.

Step 2: Extract Candidate Instincts

For each detected pattern, formulate it as a structured behavioral rule:

  • Name: Short descriptive kebab-case name (e.g., always-run-ruff-after-python-edit)
  • Description: One-line summary of the rule
  • Trigger patterns: What activates this instinct — file types, tool combinations, keywords, contexts
  • Anti-patterns: What should NOT trigger this instinct (to avoid false positives)
  • Operational rule: The prescriptive instruction — what the agent should DO

Be specific. "Be careful with files" is useless. "Run ruff check after every Python file edit in this project" is an instinct.

Step 3: Check for Duplicates

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/null

Decision logic:

  • Similarity > 0.68 with an existing instinct → MERGE: Update the existing instinct's evidence array, bump confirmations or corrections count, update updated_at timestamp. Do NOT create a duplicate.
  • Similarity <= 0.68 or no match → CREATE: Write a new instinct file.

Step 4: Write Instinct Files

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:

  • Use ~/.claude/instincts/projects/<project-slug>/ if the pattern is specific to the current project (references project-specific files, tools, APIs, or conventions).
  • Use ~/.claude/instincts/global/ if the pattern is universal (general coding practices, tool usage patterns, communication preferences).
  • If --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:

  • Single emphatic correction → 0.50
  • Repeated correction (2+ times) → 0.65
  • Explicit user instruction ("from now on, always...") → 0.75
  • Observed pattern (tool sequence) → 0.40

Step 5: Update Index

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 instincts

Append 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.

Step 6: Report

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").

Important Constraints

  • Never fabricate patterns. If you are unsure whether something is an instinct, skip it and mention it in the "Skipped" section.
  • Prefer project scope unless the pattern is clearly universal (applies regardless of project).
  • Do not extract instincts from your own behavior — only from USER corrections, confirmations, or repeated user-driven workflows.
  • One instinct per behavioral rule. Do not bundle multiple unrelated rules into a single instinct.
  • Ensure directories exist before writing files (mkdir -p).

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.