instinct
AIエージェントは同じミスを繰り返します。セッション間であなたの好みを忘れてしまいます。繰り返しから学習することはありません。
instinctはこれを解決します。エージェントのセッションからパターンを観察し、時間の経過とともに信頼度を追跡し、繰り返し発生するパターンをエージェントが従う提案へと自動的に昇格させます。あなたが同じことを繰り返す必要はありません。
MCP互換エージェントであれば何でも動作します:Claude Code、Cursor、Windsurf、Goose、Codexなど。
目次
仕組み
observe track promote suggest
┌───────┐ ┌───────┐ ┌───────┐ ┌───────┐
You │Record │ +1 │ Count │ >=5 │Mature │ >=10 │ Rule │
work │pattern├──────>│ hits ├───────>│suggest├───────>│ auto- │
└───────┘ └───────┘ └───────┘ │ apply │
└───────┘観察 (Observe) — エージェントの作業中にパターン(ツールシーケンス、好み、繰り返し発生する修正)を記録します
追跡 (Track) — 再観察されるたびに信頼度が上がります
昇格 (Promote) — 信頼度 >= 5 で
mature(提案対象)、>= 10 でrule(自動適用)になります提案 (Suggest) —
matureなパターンが、明示的な指示なしにエージェントの行動をガイドします
機能
自動昇格 — 信頼度しきい値に基づき、パターンは成熟度レベル(raw → mature → rule → universal)を自動的に昇格します
自動チェーン検出 — 観察タイムスタンプからシーケンシャルパターン(
seq:A->B)を自動的に発見します。手動でのシーケンス定義は不要です (v1.4.0)有効性スコアリング — 提案されたパターンがその後の観察で確認されたかどうかを追跡し、確認率を計算します (v1.4.0)
信頼度履歴 — 各パターンの信頼度が時間の経過とともにどのように進化したかの完全なタイムライン
プロジェクト横断学習 — 2つ以上のプロジェクトで観察されたルールは、自動的に
universalレベルに昇格しますマルチプラットフォームエクスポート — ルールを CLAUDE.md、.cursorrules、.windsurfrules、または Codex 形式にエクスポートします
エージェントスキルエクスポート — ルールを agentskills.io と互換性のある SKILL.md としてエクスポートします
CLAUDE.md インジェクション — CLAUDE.md ファイルへのルールの注入/インポート(冪等)
ニア重複検出 — 類似パターンを見つけ、エイリアスを介してマージします
パターンエイリアス — 表記ゆれによる観察結果を正規のパターンにリダイレクトします
全文検索 — FTS5 を活用したパターン、メタデータ、説明の全文検索
ガベージコレクション — 古いパターンの減衰、重複のマージ、孤立したデータのクリーンアップ、インデックスの再構築
バックアップと復元 — ヘルスチェック付きの SQLite レベルのバックアップと復元
インストール
pip install instinct-mcp60秒で始める
まだインストールしていない場合は、
pip install instinct-mcpを実行してください。MCPクライアントに
instinctを追加します。Claude Code (ワンライナー):
claude mcp add instinct -- instinct serveCursor / Windsurf / Goose / その他のMCPクライアント — クライアントのMCP設定に追加してください:
{ "mcpServers": { "instinct": { "command": "instinct", "args": ["serve"] } } }パターンを1つ記録し、提案をリクエストします:
instinct observe "seq:test->fix->test"
instinct suggestsuggest が空のリストを返す場合は、繰り返し発生するパターンを観察し続けてください。信頼度が mature レベルに達すると提案が表示されます。
クイック検証
instinct observe "seq:test->fix->test"
instinct suggestリポジトリの健全性
CIとCodeQLはプッシュおよびプルリクエスト時に実行されます
Dependabotが毎週の更新を追跡します(GitHub Actions + pip)
保護されたデフォルトブランチ(
master)には、レビューと会話の解決が必要です
クイックスタート
1. エージェントに追加する
Claude Code — プロジェクトルートの .mcp.json に追加:
{
"mcpServers": {
"instinct": {
"command": "instinct",
"args": ["serve"]
}
}
}Codex CLI — ~/.codex/config.toml に追加:
[mcp_servers.instinct]
command = "instinct"
args = ["serve"]Cursor / Windsurf — MCP設定に追加:
{
"mcpServers": {
"instinct": {
"command": "instinct",
"args": ["serve", "--transport", "sse"]
}
}
}2. 学習を見守る
作業を進めると、エージェントがパターンに気づき始めます:
Session 1: observe("seq:test->fix->test") → confidence 1 (raw)
Session 3: observe("seq:test->fix->test") → confidence 3 (raw)
Session 5: observe("seq:test->fix->test") → confidence 5 (mature ✓)
suggest() → "When tests fail, apply fix and re-run tests"十分な繰り返しが行われると、instinctはそのパターンを提案し始めます。エージェントがあなたの作業スタイルに適応します。
パターンの形式
# Tool sequences your agent repeats
instinct observe "seq:lint->fix->lint"
instinct observe "seq:build->test->deploy"
# Your preferences it should remember
instinct observe "pref:style=black" --cat preference
instinct observe "pref:commits=conventional" --cat preference
# Fixes it keeps rediscovering
instinct observe "fix:missing-import" --cat fix_pattern
instinct observe "fix:utf8-encoding-windows" --cat fix_pattern
# Tools that work better together
instinct observe "combo:pytest+coverage" --cat combo命名規則
プレフィックス | 用途 | 例 |
| アクションシーケンス |
|
| ユーザーの好み |
|
| 繰り返し発生する修正 |
|
| ツール組み合わせ |
|
成熟度レベル
レベル | 信頼度 | 動作 |
raw | < 5 | 観察・保存済み、まだアクション不可 |
mature | >= 5 |
|
rule | >= 10 |
|
universal | rule + 2プロジェクト | プロジェクト横断ルール、どこでも提案される |
MCPツール
ツール | 内容 |
| パターンを記録する(繰り返しで信頼度が自動増加) |
| 現在の行動をガイドする成熟したパターンを取得する |
| フィルター付きで観察された全パターンを閲覧する |
| 特定のパターンを検索する |
| 信頼度しきい値を超えたパターンを昇格させ、チェーンを検出する |
| パターンとメタデータの全文検索 |
| instinctストアの統計概要 |
| ルールレベルのパターンを構造化データとしてエクスポートする |
| 重複パターンをマージするためのエイリアスを作成する |
| 辞書リストからパターンを一括インポートする |
| 自動統合機能付きのセッション終了スナップショット |
| 最近の期間で最も成長しているパターンを表示する |
| CLAUDE.md 用にフォーマットされたルールをエクスポートする |
| ルールをエージェントスキル(SKILL.md / agentskills.io)としてエクスポートする |
| CLAUDE.md ファイルにルールを注入する(冪等) |
| マージ用の重複に近いパターンを見つける |
| CLAUDE.md ファイルからパターンをインポートする |
| 時間経過に伴うパターンの信頼度履歴 |
| Cursor、Windsurf、Codex などのルールをエクスポートする |
| ガベージコレクション:減衰 + 重複排除 + 孤立データ削除 + FTS再構築 |
| タイムスタンプからシーケンシャルパターンチェーンを自動検出する |
| 提案の有効性スコア(確認率)を表示する |
MCPプロンプト
プロンプト | 内容 |
| エージェントの指示としてすべてのinstinctルールを取得する |
| 現在のプロジェクトの成熟したパターン提案を取得する |
CLIリファレンス
# Core
instinct observe <pattern> # Record/reinforce a pattern
instinct get <pattern> # Look up a specific pattern
instinct list # List all instincts
instinct suggest # Get mature suggestions
instinct consolidate # Auto-promote + detect chains
instinct stats # Summary statistics
instinct delete <pattern> # Remove a pattern
# Analysis
instinct trending # Fastest-growing patterns
instinct history <pattern> # Confidence history over time
instinct effectiveness # Suggestion confirmation rates
instinct detect-chains # Auto-detect sequential chains
# Export
instinct export-rules # Export rules as JSON
instinct export-claude-md # Export rules as CLAUDE.md markdown
instinct export-skill # Export rules as Agent Skill (SKILL.md)
instinct export-platform <fmt> # Export for cursor/windsurf/codex
instinct export-all # Export all instincts as JSON
# Import & Sync
instinct inject <path> # Inject rules into CLAUDE.md (idempotent)
instinct import-claude-md <path> # Import patterns from CLAUDE.md
instinct import <file.json> # Bulk import from JSON
# Maintenance
instinct gc # Garbage collection (decay + dedup + cleanup)
instinct decay # Reduce stale patterns
instinct dedup # Find/merge near-duplicate patterns
instinct alias <pat> <target> # Create a pattern alias
instinct aliases # List all aliases
# Infrastructure
instinct serve # Start MCP server
instinct fingerprint # Print project fingerprint for cwd
instinct backup # Create database backup
instinct restore <file> # Restore from backup
instinct doctor # Run health checksすべてのコマンドは構造化出力のために --json をサポートしています。
Observe オプション
instinct observe "seq:a->b" \
--cat sequence # Category: sequence|preference|fix_pattern|combo
--source claude-code # Which agent/tool recorded this
--project auto # Project fingerprint (auto-detected from cwd)
--explain "why this matters"サーバーオプション
instinct serve # stdio (default, for Claude Code)
instinct serve --transport sse # SSE for remote/HTTP clients
instinct serve --transport streamable-http # Streamable HTTP
instinct serve --port 3777 # Custom port (default: 3777)Pythonライブラリ
from instinct.store import InstinctStore
store = InstinctStore() # uses ~/.instinct/instinct.db
# Record patterns
store.observe("seq:test->fix->test", source="my-tool")
store.observe("seq:test->fix->test") # confidence = 2
# Query
suggestions = store.suggest() # mature+ patterns
results = store.search("test") # full-text search
rules = store.export_rules() # rule-level only
# Lifecycle
store.consolidate() # promote + detect chains
store.decay(days_inactive=90) # fade stale patterns
# Auto-chain detection
chains = store.detect_chains(window_minutes=5, min_occurrences=3)
# Effectiveness scoring
eff = store.effectiveness(days=30)
# Stats
print(store.stats())
# {'total': 42, 'raw': 30, 'mature': 10, 'rules': 2, 'avg_confidence': 4.2, ...}カスタムデータベースパス
store = InstinctStore(db_path="/path/to/custom.db")プロジェクト横断学習
instinctは作業ディレクトリをハッシュ化してプロジェクトのフィンガープリントを作成します。つまり:
プロジェクト固有のパターンは、そのプロジェクト内にいるときのみ提案されます
グローバルパターン(空のプロジェクトフィールド)はどこでも提案されます
ユニバーサルルール — 2つ以上のプロジェクトで
ruleレベルに達したパターンは自動的にuniversalに昇格し、すべてのプロジェクトで提案されます
# See your current project's fingerprint
instinct fingerprint
# → a1b2c3d4e5f6ストレージ
データベース: SQLite (WALモード)
~/.instinct/instinct.db依存関係:
mcp>=1.0.0のみPython: >= 3.11
設定: しきい値オーバーライド用のオプション
~/.instinct/config.toml
比較
instinct | 手動 CLAUDE.md | .cursorrules | |
自動学習 | はい | いいえ | いいえ |
セッション間メモリ | はい | はい | はい |
信頼度スコアリング | はい | いいえ | いいえ |
自動チェーン検出 | はい | いいえ | いいえ |
有効性追跡 | はい | いいえ | いいえ |
古いパターンの減衰 | はい | いいえ | いいえ |
プロジェクト横断学習 | はい | いいえ | いいえ |
エージェント横断動作 | はい (MCP) | Claudeのみ | Cursorのみ |
マルチプラットフォームエクスポート | はい | N/A | N/A |
手動編集が必要 | いいえ | はい | はい |
ライセンス
Available Tools
23 toolsalias_patternA
Redirect all future observations of one pattern onto another.
Use this to merge duplicates: when the same concept has been recorded
under two keys (e.g. "seq:a->b" and "seq:a -> b" with a space), alias
the stray into the canonical one. Existing confidence is summed into
the target so no learning is lost.
The target must already exist. Use find_duplicates() to discover
merge candidates, then call this to apply them.
Args:
pattern: The key to retire. Future observations of this key will
be rerouted silently.
target: The canonical key to absorb into. Must already exist in
the store.
Returns:
On success: {"aliased": <pattern>, "target": <target>}.
On failure (target missing): {"error": "target pattern '<target>'
not found"} — check for the "error" key.
| Name | Required | Description | Default |
|---|---|---|---|
| pattern | Yes | ||
| target | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Describes side effects (future observations rerouted silently, confidence summed), error condition, and return format. No annotations provided, but description fully compensates.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Well-structured with sections, but slightly verbose in docstring style. Could be more concise without losing clarity.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Covers purpose, usage, parameters, return values, and error handling. Even references a sibling tool for discovery. Complete for a non-trivial merge operation.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 0%, but description provides clear semantics for both parameters: pattern as key to retire, target as canonical key to absorb into.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Clear verb 'alias' and resource 'pattern', with specific use case of merging duplicates. Differentiates from sibling tools by explicitly mentioning companion find_duplicates.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly states when to use (merge duplicates), prerequisite (target must exist), and suggests find_duplicates to discover candidates.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
consolidateA
Re-evaluate pattern levels; promote via confidence thresholds and detect chains.
Promotes patterns that crossed a level boundary since the last run:
raw -> mature (confidence >= 5), mature -> rule (>= 10), rule ->
universal (observed in 2+ distinct projects). Patterns seen in the
last 7 days get a +1 recency bonus toward the mature threshold.
Side effects: (1) writes new "promoted" values, (2) runs detect_chains()
to discover sequential patterns from the observation log, (3) rebuilds
the FTS5 search index. Idempotent across promotion: already-promoted
patterns are untouched. session_summary() invokes this automatically.
Call after a bulk import_patterns() / import_claude_md() or at the
end of an agent session so downstream queries (suggest,
export_rules, inject_claude_md) see the latest promotions.
Returns:
{"promoted_to_mature": int, "promoted_to_rule": int,
"promoted_to_universal": int, "chains_detected": int,
"chains_created": int, "total": int, "timestamp": iso8601}
"total" is the current row count after promotion. "chains_*"
fields reflect the bundled detect_chains() pass: "detected"
counts candidate pairs above threshold, "created" counts new
seq:A->B records actually inserted.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description thoroughly discloses side effects: writes promoted values, runs detect_chains(), rebuilds FTS5 index. It also states idempotency (already-promoted patterns untouched) and details the exact return structure. This fully informs the agent of consequences.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-structured with clear sections: action, thresholds, side effects, return value. It is slightly verbose but every sentence adds value. The front-loading is effective.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the complexity and presence of an output schema in the description, the description is complete. It explains the return fields in detail, covers side effects, and provides usage context. No gaps remain for decision-making.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool has zero parameters and schema coverage is 100%. The description provides no parameter info, but none is needed. The description adds value by explaining the tool's behavior without needing parameter semantics.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool re-evaluates pattern levels and promotes based on confidence thresholds with specific rules for each level. It distinguishes itself from sibling tools like detect_chains by noting that detect_chains is invoked internally, and mentions that session_summary calls it automatically, providing context for when to use it.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explicitly states when to call consolidate: after bulk imports (import_patterns, import_claude_md) or at the end of an agent session. It also notes that session_summary invokes it automatically, giving guidance on when manual invocation is unnecessary. This clearly differentiates from alternatives.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
detect_chainsA
Mine the observation log to auto-create "seq:A->B" patterns for recurring chains.
Scans the confidence log for pairs of patterns observed close in
time, and creates a new sequence pattern for any pair seen enough
times. This is how instinct learns tool chains without being told
what to track.
Safe to run periodically. Does not overwrite existing chains; only
appends confidence for new pairs.
Args:
window_minutes: Maximum gap between two observations to consider
them sequential. Smaller (1-2) = tight chains only. Larger
(10+) = loose associations. Default 5 is a good balance.
min_occurrences: Threshold for recording a chain. A pair must
appear at least this many times in the log before it becomes
a pattern. Default 3 filters out one-off coincidences.
Returns:
Dict with keys: "chains_created" (int — new patterns added),
"chains_reinforced" (int — existing patterns whose confidence
rose), "candidates_seen" (int — raw pair count before threshold).
| Name | Required | Description | Default |
|---|---|---|---|
| window_minutes | No | ||
| min_occurrences | No |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Despite no annotations, the description fully discloses behavior: scans confidence log, pairs patterns close in time, only appends confidence, safe to run periodically, and explains the algorithm's non-destructive nature. This exceeds what annotations would typically provide.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Well-structured with clear sections: overview, safety note, parameter explanations, return value. Slightly verbose in places but front-loaded with key information. Could tighten minor phrasing.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's simplicity (2 optional params, no annotations, output schema described in full), this description provides comprehensive coverage. No missing details about purpose, usage, parameters, or return values.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Despite 0% schema coverage, the description explains both parameters in detail, including defaults, practical guidance (e.g., 'Tight chains only' for smaller window), and thresholds. Adds significant meaning beyond the bare schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description clearly identifies the tool's purpose: mining observation logs to auto-create sequence patterns (A->B). It distinguishes from siblings by specifying it creates new patterns without overwriting, which is unique among sibling tools like 'observe' or 'alias_pattern'.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
States 'Safe to run periodically' and 'Does not overwrite existing chains; only appends', providing context for when to use it. However, does not explicitly mention when to avoid using or compare with alternatives like 'trending' or 'suggest'.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
effectivenessA
Measure how often suggested patterns were reinforced by a later observe().
Each suggest() call logs the patterns it returned; each observe()
confirms the most recent unconfirmed suggestion for that pattern.
A high confirmation rate means the pattern is genuinely useful
guidance; a low rate means it is noise worth pruning via
alias_pattern() merges or gc() decay. Read-only.
For a raw observation-velocity view use trending(days). For
promotion/level distribution use stats().
Args:
days: Look-back window in days. Default 30. Shorter (7)
surfaces recent drift; longer (90) measures long-term
value.
Returns:
{"patterns": [<row>, ...],
"summary": {"total_suggested": int, "total_confirmed": int,
"overall_rate": float, "period_days": int}}
Each <row>: {"pattern": str, "suggested": int,
"confirmed": int, "rate": float in [0.0, 1.0] rounded to
3 decimals}. Rows ordered by confirmed desc, then suggested
desc. "overall_rate" is total_confirmed / total_suggested
(0.0 when no suggestions in window). Empty "patterns" list
means no suggest() calls happened in the window — not an
error.
| Name | Required | Description | Default |
|---|---|---|---|
| days | No |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
The description discloses read-only nature, explains the underlying process of suggest/observe, the confirmation rate logic, and clarifies that an empty patterns list is not an error. This fully compensates for the lack of annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-structured: a concise one-line summary, followed by mechanism, sibling differentiation, parameter details, and return format. Every sentence adds value without redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a tool with one parameter and no annotations, the description covers purpose, behavior, parameter, return format, and edge cases (empty list). The inclusion of the output schema in text makes it fully complete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The single parameter 'days' is described in the Args section with default value (30) and guidance for choosing short (7) or long (90) windows. This compensates for the 0% schema description coverage.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: 'Measure how often suggested patterns were reinforced by a later observe().' It explains the mechanism linking suggest() and observe(), and distinguishes itself from siblings like trending() and stats().
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides explicit alternatives: 'For a raw observation-velocity view use trending(days). For promotion/level distribution use stats().' It also explains the meaning of high/low confirmation rates, guiding when to use pruning actions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
export_claude_mdA
Render rule-level patterns as Markdown ready to paste into CLAUDE.md.
Use this when a Claude client needs a compact Markdown block of learned
rules to include manually in CLAUDE.md. It reads promoted rule-level
patterns only; no files are modified.
Produces one bullet per rule with pattern key, category tag, confidence
count, and explain text. The output is a freestanding Markdown section;
no surrounding headers or context are added.
For idempotent in-place injection into an existing CLAUDE.md (preserving
other content via marker tags), use inject_claude_md() instead.
For multi-platform output (Cursor, Windsurf, Codex), use
export_platform() instead.
Returns:
Dict with keys: "markdown" (str — the rendered block; empty
string if no rules exist), "rule_count" (int).
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Describes read-only operation, output structure (bullet per rule with key, category, confidence count, explain text), and return type. No annotations exist, so description fully carries behavioral disclosure.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Well-structured with purpose, usage, and output sections. Slightly verbose in middle paragraph, but front-loaded and clear.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Complete for a zero-parameter tool: covers purpose, usage, output format, return type, and alternatives. No missing context given simplicity.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Zero parameters, so baseline is 4. Description does not add parameter info, but none is needed. Focus on output is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Clearly states it renders rule-level patterns into Markdown for CLAUDE.md, specifying verb, resource, and output format. Distinguishes from siblings like inject_claude_md and export_platform.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly says when to use (when a compact Markdown block is needed for manual inclusion) and what it does not do (no file modification, only promoted rules). Provides alternatives for idempotent injection and multi-platform export.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
export_platformA
Render rule-level patterns in a target editor's config format.
Use this when you want rules in a specific platform's rules file —
e.g. Cursor's .cursorrules, Windsurf's .windsurfrules, or Codex's
AGENTS.md — without hand-translating the output of export_rules().
Use fmt="claude-md" for the same Markdown renderer as
export_claude_md(); prefer export_claude_md() when you only need
Claude's CLAUDE.md shape.
For Anthropic-specific outputs (CLAUDE.md, SKILL.md), the dedicated
export_claude_md() and export_skill() tools keep the intent explicit.
Prefer this tool for non-Claude targets like .cursorrules,
.windsurfrules, or AGENTS.md.
Args:
fmt: Target platform. One of: "claude-md" (default),
"cursorrules", "windsurfrules", "codex". Unknown values are
rejected by validation instead of silently guessing.
Returns:
Dict with keys: "content" (str — formatted text ready to write
to disk; empty string when no rules exist), "format" (str —
echoed), "rule_count" (int).
| Name | Required | Description | Default |
|---|---|---|---|
| fmt | No | claude-md |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Despite no annotations, the description discloses return format (dict with keys content, format, rule_count), behavior on unknown values (rejected via validation), and edge case of empty content. This provides comprehensive behavioral insight beyond what annotations would offer.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Well-structured with sections for purpose, usage context, args, and returns. Every sentence adds value; no redundant phrasing. Information is front-loaded with purpose, then detailed guidance.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool has one optional parameter and an output schema, the description fully covers input possibilities, output shape, error handling, and usage differentiation from siblings. It is complete for effective tool selection and invocation.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 0% but the description lists all valid values for 'fmt' and explains validation behavior, adding meaning absent from the schema. The note about 'Unknown values are rejected by validation instead of silently guessing' provides critical usage guidance.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool renders rule-level patterns into target editor config formats, listing specific platforms like Cursor, Windsurf, Codex. It distinguishes from siblings like export_claude_md and export_skill by specifying when to use each.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly says when to use (for rules in a specific platform's file) and when to prefer alternatives, e.g., 'prefer export_claude_md() when you only need Claude's CLAUDE.md shape.' Provides clear context for non-Claude targets.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
export_rulesA
Export promoted-level patterns (rule + universal) as structured JSON.
Filters to patterns with promoted >= 2 — the threshold set by
consolidate() after enough reinforcement. Intended for programmatic
consumption: analytics pipelines, sibling agents, external
dashboards. Read-only; takes no parameters.
For human-readable Markdown use export_claude_md(). For platform-
specific formats use export_platform() (.cursorrules, .windsurf,
AGENTS.md) or export_skill() (anthropics/skills SKILL.md). For
lower-confidence audits use list_instincts(min_confidence=5).
Returns:
{"rules": [<record>, ...], "count": int, "hint": str}
Each <record> has: "pattern" (str key with prefix),
"category" ("sequence"|"preference"|"fix_pattern"|"combo"),
"confidence" (int observation count),
"promoted" (2=rule, 3=universal — lower levels are filtered out),
"level" ("rule"|"universal"),
"project" (str fingerprint, "" = global),
"source" (str origin tag), "metadata" (parsed dict),
"explain" (str human note),
"first_seen" and "last_seen" (ISO 8601 timestamps).
Sorted by promoted descending, then confidence descending.
Empty "rules" means no pattern has reached rule level yet —
the "hint" directs to run consolidate() first, then retry.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
The description declares the tool as read-only and takes no parameters, which is a key behavioral trait. It also details the return format, including the structure of each record and the meaning of an empty 'rules' array. With no annotations provided, the description fully covers the behavioral aspects.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-structured with a clear main statement, then usage guidelines, then return format in a bulleted list. Every sentence provides unique value, and the information is front-loaded. Despite its length, it remains focused and efficient.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given that the tool has no parameters, no annotations, but has a detailed output schema provided in the description, the description is fully complete. It covers purpose, usage, return format, and edge cases (empty results), leaving no gaps for an AI agent to misunderstand.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
There are zero parameters, and the schema description coverage is 100% (since no params exist). The description adds context by stating that the tool takes no parameters, which is sufficient. According to guidelines, baseline for 0 parameters is 4.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's action ('Export'), the resource ('promoted-level patterns (rule + universal)'), and includes a specific threshold (promoted >= 2). It also differentiates from sibling tools by naming alternatives like export_claude_md, export_platform, export_skill, and list_instincts.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explicitly states when to use this tool ('for programmatic consumption: analytics pipelines, sibling agents, external dashboards') and provides clear alternatives for other use cases (human-readable Markdown, platform-specific formats, lower-confidence audits). It also notes that if no patterns have reached rule level, the hint directs to run consolidate() first.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
export_skillA
Package rule-level patterns as a SKILL.md file (anthropics/skills format).
Builds a complete Skill document: YAML frontmatter (name,
description) followed by a Markdown body grouping each rule-level
pattern by category, with confidence and explain text. The returned
string is ready to write to disk as SKILL.md and install into a
skills-aware agent runtime (e.g. agentskills.io). Read-only.
For human-readable CLAUDE.md output use export_claude_md(). For
editor-specific formats (.cursorrules, AGENTS.md) use
export_platform(target). For raw JSON use export_rules().
Args:
name: Skill identifier written into the YAML frontmatter.
Becomes the Skill's name on disk. Default "instinct-rules".
description: One-sentence description in the frontmatter.
Empty string auto-generates "Learned patterns from N
observations" using the current rule count.
category: Filter rules by type. One of "sequence",
"preference", "fix_pattern", "combo". Empty string (default)
includes every category.
Returns:
On success: {"skill_md": str, "rule_count": int, "hint": str}.
"skill_md" is the full file content ready to write. "rule_count"
is parsed from the rendered body (number of rule bullets).
On empty store: {"skill_md": "", "rule_count": 0, "hint": str}.
"hint" explains the promoted >= 2 prerequisite and directs the
caller to run consolidate() first so mature patterns can cross
the threshold.
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | instinct-rules | |
| description | No | ||
| category | No |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided, so description carries full burden. It declares 'Read-only', details return values for success and empty store, and explains the hint about prerequisites. No contradictions.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Well-structured with purpose first, then alternative guidance, parameter docs, and return value. Slightly verbose but every sentence adds value. Could be tightened slightly.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given 3 params, no nested objects, and existence of output schema, the description covers all necessary context: parameters, usage, prerequisites, return values, and edge cases. Complete for effective use.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, but description provides detailed explanations for all 3 parameters (name, description, category) including default behavior and allowed values, going well beyond the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a specific verb 'Package' and resource 'rule-level patterns' outputting a SKILL.md file. It clearly distinguishes from siblings by naming alternative tools (export_claude_md, export_platform, export_rules).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly states when to use this tool vs alternatives with references to other functions. Also describes behavior on empty store, directing user to consolidate() as prerequisite.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
find_duplicatesA
Detect near-identical pattern keys that should probably be merged.
Compares every pattern against every other using token overlap and
prefix matching. Flags candidate pairs above the threshold so you
can apply alias_pattern() to consolidate them. Read-only — this
tool suggests merges but never performs them.
A common use case: after a bulk import_patterns() or import_claude_md(),
call this to catch formatting drift (spacing, casing, punctuation).
Args:
threshold: Similarity cutoff, 0.0 to 1.0. Default 0.75. Lower
thresholds (0.5) over-suggest; higher (0.9) under-suggest.
Start at default and tune per your noise tolerance.
Returns:
Dict with keys: "duplicates" (list of {pattern_a, pattern_b,
similarity}), "count" (int), "hint" pointing to alias_pattern
as the next step.
| Name | Required | Description | Default |
|---|---|---|---|
| threshold | No |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It states 'Read-only — this tool suggests merges but never performs them,' disclosing the behavioral trait. It also outlines the comparison logic and return structure, though more details on limitations could be given.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-structured with clear sections, front-loading the main purpose. It is concise yet informative, with no wasted sentences.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's simplicity (one parameter, read-only, complete output schema), the description covers all essential aspects: purpose, usage context, parameter semantics, and return value. It references sibling tools appropriately.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema coverage is 0%, but the description fully explains the threshold parameter: its range (0.0-1.0), default (0.75), effect on sensitivity, and tuning advice. This adds significant meaning beyond the bare schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: 'Detect near-identical pattern keys that should probably be merged.' It uses a specific verb ('detect') and resource ('pattern keys'), and the context of merging distinguishes it from sibling tools like alias_pattern.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides a common use case: after bulk import_patterns() or import_claude_md(). It also notes the tool is read-only and suggests using alias_pattern for actual merging. However, it does not explicitly mention when not to use this tool or alternatives.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
gcA
Run all store-maintenance tasks in one call: decay, dedup, orphans, FTS.
Combines four housekeeping steps:
1. Decay confidence on patterns idle beyond the staleness threshold.
2. Merge near-duplicates using the given similarity threshold.
3. Remove alias entries whose target no longer exists.
4. Rebuild the SQLite FTS index for accurate search results.
Safe and idempotent — running more than once per day is fine. For
finer control, the individual steps are available as find_duplicates()
+ alias_pattern() + (internal) decay.
Args:
dedup_threshold: Similarity cutoff for step 2, 0.0-1.0. Default
0.75. See find_duplicates() for tuning notes.
Returns:
Dict with keys: "decay" (dict with "decayed" and "deleted"),
"dedup" (dict with "found" and "applied"), "orphans_cleaned"
(int), "fts_rebuilt" (bool).
Prefer housekeep() for discoverability; gc() remains supported for
existing clients.
| Name | Required | Description | Default |
|---|---|---|---|
| dedup_threshold | No |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Despite no annotations, the description explains each step and asserts safety and idempotence. It discloses that it removes orphan aliases and rebuilds FTS, covering key behaviors without contradictions.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-structured with a summary, bullet steps, safety note, parameter explanation, and return format. It is front-loaded and each sentence is useful, though slightly verbose.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With an output schema present and only one parameter, the description covers return dict keys and parameter semantics. It also provides context on housekeeping and tool discoverability, making it complete for the tool's complexity.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 0%, but the description fully explains the single parameter dedup_threshold, including range, default, and reference to find_duplicates() for tuning notes, adding significant value beyond the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly identifies the tool's purpose: running all store-maintenance tasks in one call. It enumerates the four specific steps (decay, dedup, orphans, FTS) and distinguishes it from siblings like find_duplicates() and alias_pattern().
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly states the tool is safe and idempotent, and notes that finer control is available via individual tools. Also recommends housekeep() for discoverability, providing clear guidance on when to use this tool versus alternatives.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_instinctA
Fetch the full record for one pattern by its exact key.
Exact-match lookup; keys are case-sensitive and must include the
category prefix. Typically called after suggest() returns a compact
entry and you want the full context. Read-only.
For substring or keyword search use search_instincts(). For browsing
by category/project without a key use list_instincts(). For the
confidence timeline of this pattern, pair with history(pattern).
Args:
pattern: Exact pattern key including its category prefix.
Examples: "seq:lint->fix->lint", "pref:style=black",
"fix:null-deref-guard", "combo:eslint+prettier". Case-sensitive.
Returns:
On hit — the full record: {"pattern": str, "category":
"sequence"|"preference"|"fix_pattern"|"combo", "confidence": int,
"promoted": 0|1|2|3, "level": "raw"|"mature"|"rule"|"universal",
"project": str ("" = global), "source": str, "metadata": dict,
"explain": str, "first_seen": iso8601, "last_seen": iso8601}.
On miss — {"error": "Not found: <pattern>"}. Callers must check
for the "error" key before assuming a record was returned.
| Name | Required | Description | Default |
|---|---|---|---|
| pattern | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description fully discloses behavior: exact-match, case-sensitive, read-only, requires category prefix, returns full record on hit or error on miss, and instructs callers to check for error key. Provides rich behavioral context.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-structured with sections, bullet points, and examples. While slightly verbose, every sentence adds value; could be slightly more concise but remains clear.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the single parameter and existence of output schema, the description is thorough: covers input format, return structure, error handling, and usage context. Leaves no gaps for a simple lookup tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 0%, but the description provides extensive detail: examples of valid patterns, case-sensitivity, requirement for category prefix. This adds critical meaning beyond the bare schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states 'Fetch the full record for one pattern by its exact key,' which is a specific verb+resource combination. It distinguishes from sibling tools like search_instincts and list_instincts by contrasting exact-match versus substring search or browsing.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly states when to use (after suggest() returns a compact entry) and when to use alternatives (search_instincts for substring, list_instincts for browsing, history for confidence timeline). Provides clear usage context.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
historyA
Show how one pattern's confidence evolved over a time window.
Returns every observation recorded against the pattern in the window,
with timestamps and source projects — useful for spotting growth
velocity, cross-project adoption, or stale patterns that should decay.
For a snapshot of the current state (not the timeline), use
get_instinct() instead.
Args:
pattern: Exact pattern key. Same format as get_instinct() —
case-sensitive, includes prefix (e.g. "seq:lint->fix").
days: Look-back window in days. Default 30.
Returns:
Dict with keys: "pattern" (str — echoed), "history" (list of
{timestamp, source, project, delta}), "data_points" (int),
"projects" (list of distinct project fingerprints seen).
| Name | Required | Description | Default |
|---|---|---|---|
| pattern | Yes | ||
| days | No |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It describes the return format and that it is a read-only query of observations. There is no mention of error handling, rate limits, or authentication, but for a read tool the disclosures are adequate.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-structured with clear sections (Args, Returns) and front-loads the purpose. Every sentence adds value without wasting words. It is appropriately sized for the tool's simplicity.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool has a simple input schema, no annotations, and an output schema, the description provides all necessary context: what it does, how to use it, and what to expect. It also distinguishes from sibling tools, making it complete for agent use.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description must compensate. It adds detailed semantics for both parameters: 'pattern' is explained as an exact case-sensitive key with prefix, and 'days' is described as a look-back window with default 30. This adds significant meaning beyond the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: 'Show how one pattern's confidence evolved over a time window.' It uses a specific verb and resource, and distinguishes itself from the sibling tool get_instinct (snapshot vs. timeline).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explicitly tells when to use this tool (for timeline/history) and when not ('For a snapshot of the current state...use get_instinct() instead'). It does not cover all possible alternatives, but provides strong context.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
housekeepA
Run cleanup, deduplication, decay, orphan cleanup, and FTS rebuild.
Use this when you want to "clean up", "housekeep", "prune stale
patterns", or "rebuild search" after many observations or imports.
This is the natural-language alias for gc(); both tools are identical
and safe to run periodically.
Args:
dedup_threshold: Similarity cutoff for duplicate merging,
0.0-1.0. Default 0.75. See find_duplicates() for tuning notes.
Returns:
Dict with keys: "decay" (dict with "decayed" and "deleted"),
"dedup" (dict with "found" and "applied"), "orphans_cleaned"
(int), "fts_rebuilt" (bool).
| Name | Required | Description | Default |
|---|---|---|---|
| dedup_threshold | No |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description reasonably discloses behavior by listing operations and return value structure. It states it's 'safe to run periodically,' but could mention potential irreversible effects more explicitly.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise, with a clear bullet list of operations, usage note, and parameter description. Front-loaded main purpose. Could be slightly more streamlined but effective.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's complexity (multiple operations) and existence of output schema (return keys listed), the description is fairly complete. However, it omits potential preconditions or asynchronous behavior.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Despite 0% schema coverage, the description fully explains the single parameter 'dedup_threshold': range (0.0-1.0), default (0.75), and reference to find_duplicates() for tuning, adding significant meaning beyond the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose with specific verbs and resources: 'Run cleanup, deduplication, decay, orphan cleanup, and FTS rebuild.' It also distinguishes itself from the sibling 'gc' by noting they are identical.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly tells when to use: 'Use this when you want to clean up, housekeep, prune stale patterns, or rebuild search after many observations or imports.' Also notes it's safe to run periodically and is an alias for gc.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
import_claude_mdA
Parse a CLAUDE.md file and ingest its backtick-wrapped patterns.
Scans the file for patterns matching the instinct convention
(seq:..., pref:..., fix:..., combo:...) and imports each as an
observation. Extracts confidence counts and explain text when
present on the line.
Use this to bootstrap a fresh instinct store from an existing
project's CLAUDE.md, or to sync rules authored by hand.
Args:
source: Path to the CLAUDE.md file. Read-only — the source
file is not modified.
Returns:
Dict with keys: "imported" (int — new patterns), "merged"
(int — reinforced existing patterns), "skipped" (int — lines
that looked pattern-like but failed validation), "source" (str).
| Name | Required | Description | Default |
|---|---|---|---|
| source | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Discloses read-only nature ('the source file is not modified'), extraction details (confidence counts, explain text), and return dict keys. No annotations present, so description carries full burden and does well.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Description is concise with a clear head sentence and detailed follow-up. Could be slightly more front-loaded, but no unnecessary sentences.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given a simple tool with one parameter, no annotations, and an output schema, the description thoroughly covers purpose, usage, behavior, and return values. Complete for the context.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Single parameter 'source' has 0% schema description coverage. Description adds 'Path to the CLAUDE.md file', providing essential meaning. Minimal but adequate for a simple string path.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool parses a CLAUDE.md file and ingests backtick-wrapped patterns, with a specific verb and resource. It distinguishes itself from siblings like export_claude_md and inject_claude_md.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly states when to use (bootstrap or sync rules). Does not mention alternatives or when not to use, but context from siblings provides differentiation.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
import_patternsA
Bulk-insert many patterns in a single call; faster than looping observe().
Each input row is routed through observe() so existing patterns
have their confidence incremented rather than overwritten, matching
single-call observe() semantics. If an input row specifies a
"confidence" higher than the current stored value, the record is
raised to that target value (never lowered). Rows with missing or
empty "pattern" are skipped.
For importing a CLAUDE.md Markdown file use import_claude_md()
which handles the backtick-wrapped pattern parsing for you. Run
consolidate() after a large import so downstream exports see the
fresh promotions.
Args:
patterns: List of dicts. Each dict requires "pattern" (str key
with category prefix). Optional keys:
- "category": "sequence" | "preference" | "fix_pattern"
| "combo". Defaults to "sequence" if omitted.
- "source": str origin tag (e.g. "codex", "manual").
- "project": str fingerprint. Empty = global.
- "metadata": dict of free-form JSON-serializable data.
- "explain": str human-readable note (truncated at the
store-configured max length).
- "confidence": int starting count. Defaults to 1. If
greater than the current stored confidence for a
pre-existing pattern, the record is raised to this
value.
Returns:
{"imported": int, "updated": int, "errors": int, "hint": str}
"imported" = rows that created a new pattern. "updated" =
rows that reinforced an existing pattern. "errors" = rows
skipped because "pattern" was missing/empty or observe() raised
(count only — see server logs for per-row reasons). "hint"
points to consolidate() as the recommended follow-up.
| Name | Required | Description | Default |
|---|---|---|---|
| patterns | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided, so description carries full burden. Explains behavior: each row routed through observe(), confidence incremented but never lowered, rows with missing pattern skipped. Discloses mutation and return structure with counts and hint.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Description is well-structured with sections for purpose, parameters, and returns. Front-loaded with main action. Slightly verbose but every sentence adds value. Could be trimmed slightly without loss.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given tool complexity (bulk insertion with merging logic) and no annotations, description covers all essential aspects: behavior, parameter details, return format, and relationship to siblings. Output schema described in text. Complete for agent use.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Input schema has 0% coverage (only specifies array of objects with no properties). Description fully compensates by detailing required keys ('pattern'), optional keys with defaults and types (category, source, project, metadata, explain, confidence), and their semantics.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description clearly states 'Bulk-insert many patterns in a single call; faster than looping observe()', specifies verb and resource. Distinguishes from sibling tools like observe and import_claude_md by noting performance advantage and specific use case for Markdown imports.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly tells when to use (bulk insert, faster than observe) and when not (use import_claude_md for Markdown files). Recommends consolidate() after large import, providing clear context and alternatives.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
inject_claude_mdA
Idempotently write rule-level patterns into a CLAUDE.md file.
Updates only the block between <!-- instinct:start --> and
<!-- instinct:end --> markers; everything else in the file is
preserved. Creates the file (and markers) if they do not exist.
Safe to run on every commit or session end without producing churn.
For one-shot rendering without touching the filesystem, use
export_claude_md() and write the output yourself.
Args:
target: Absolute or relative path to the CLAUDE.md file. Parent
directories must exist; the file itself will be created.
Returns:
Dict with keys: "target" (str — echoed path), "rule_count"
(int), "changed" (bool — false when content matched existing
block, true when the file was actually rewritten).
| Name | Required | Description | Default |
|---|---|---|---|
| target | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description bears full responsibility. It discloses idempotent writes, marker-based partial updates, file creation if missing, and the return dict. It notes the prerequisite that parent directories must exist, but does not cover all potential side effects (e.g., permission issues) – a minor gap.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-structured with a leading one-sentence summary, followed by detailed behavior, an alternative tool mention, and structured Args/Returns sections. Every sentence provides essential information without redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's simplicity (one parameter, no nested objects, output schema indicated), the description covers purpose, usage, behavioral constraints, and return values thoroughly. However, it omits explicit error cases (e.g., missing parent directories would cause failure) and does not define 'rule-level patterns', assuming domain knowledge. Minor completeness gaps exist.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The sole parameter 'target' has 0% schema description coverage, so the description must compensate. It does so thoroughly: explains it is an absolute or relative path, that the file itself will be created, and that parent directories must exist. This adds significant meaning beyond the schema type.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description explicitly states 'Idempotently write rule-level patterns into a CLAUDE.md file' with a clear verb and resource. It distinguishes itself from the sibling tool export_claude_md by noting it modifies files versus one-shot rendering without filesystem impact.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides clear context: it is safe to run on every commit or session end, and it suggests using export_claude_md for one-shot rendering. It also explains idempotency and the marker-based block update, offering explicit usage guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_instinctsA
List recorded patterns with optional filters; includes low-confidence observations.
Unlike suggest() — which returns mature-only, compact payloads — this
surfaces seedlings too. Useful for audits, pruning noise via gc() or
alias_pattern(), and debugging why a pattern has not promoted.
Read-only; records sorted by confidence descending, then last_seen
descending.
For day-to-day agent guidance prefer suggest(). For keyword search
use search_instincts(). For a single exact-key lookup use
get_instinct().
Args:
min_confidence: Minimum observation count (inclusive). Examples:
1 returns everything including one-offs; 5 returns mature+;
10 returns rules only.
category: Filter by pattern type. One of: "sequence",
"preference", "fix_pattern", "combo". Empty string = all.
project: Filter by project fingerprint (repo hash or path hash).
Empty string returns every project including the global ""
bucket.
limit: Maximum records to return. Default 50; raise for full
dumps, lower for top-N views.
Returns:
{"instincts": [<record>, ...], "count": int, "hint": str}
Each <record> has: "pattern" (str key with prefix),
"category" ("sequence"|"preference"|"fix_pattern"|"combo"),
"confidence" (int observation count),
"promoted" (0=raw, 1=mature, 2=rule, 3=universal),
"level" ("raw"|"mature"|"rule"|"universal" — string form of promoted),
"project" (str fingerprint, "" = global),
"source" (str origin tag), "metadata" (parsed dict),
"explain" (str human-readable note),
"first_seen" and "last_seen" (ISO 8601 timestamps).
"hint" points to suggest() / search_instincts() / get_instinct()
as next-step tools depending on the audit goal.
| Name | Required | Description | Default |
|---|---|---|---|
| min_confidence | No | ||
| category | No | ||
| project | No | ||
| limit | No |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden. It declares read-only behavior and sorting order, and notes that low-confidence observations are included. However, it does not mention rate limits or any other behavioral constraints.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-structured with sections and front-loaded purpose. While informative, it is slightly verbose with detailed parameter explanations; a more concise version could still be effective.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool has 4 parameters, no required params, and an output schema, the description covers purpose, usage, parameters, return structure, and next-step hints. It is fully sufficient for an AI agent to select and use the tool correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, but the description thoroughly explains each parameter: min_confidence with examples, category with allowed values, project with fingerprint explanation, and limit with default and usage. This adds significant meaning beyond the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool lists recorded patterns with filters including low-confidence observations, and distinguishes itself from siblings like suggest(), search_instincts(), and get_instinct() by contrasting scope and use cases.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides explicit guidance on when to use this tool vs alternatives: 'For day-to-day agent guidance prefer suggest(). For keyword search use search_instincts(). For a single exact-key lookup use get_instinct().' It also lists specific use cases like audits and debugging.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
observeA
Record one observation of a behavioral pattern; increments its confidence counter.
Use this to log anything you want the agent to learn over time: a tool
sequence that worked, a user preference, a recurring fix, or a combo
of tools used together. Call once per occurrence — repeated calls on
the same pattern raise its confidence (1=new, 5=mature, 10=rule).
Do NOT use this for one-off notes; those belong in regular memory.
This tool is for patterns that may recur and become reliable.
Idempotent on pattern key: same pattern string merges into one entry.
Args:
pattern: Pattern key following the convention prefix:body.
Examples: "seq:lint->fix->lint" (tool sequence),
"pref:style=black" (user preference),
"fix:missing-import" (recurring fix),
"combo:pytest+coverage" (things used together).
category: Pattern type. One of: "sequence", "preference",
"fix_pattern", "combo". Defaults to "sequence".
source: Originating tool/agent name (e.g. "claude-code",
"cursor"). Empty string means unknown. Useful for filtering.
project: Project fingerprint. Empty string auto-detects from cwd
(recommended). Pass explicitly only for cross-project imports.
explain: One-line human-readable rationale for why this pattern
matters. Surfaces in suggestions and CLAUDE.md exports.
Returns:
Dict with keys: "pattern", "confidence" (int), "level"
("seedling" | "mature" | "rule"), "created" (bool — true on
first observation).
| Name | Required | Description | Default |
|---|---|---|---|
| pattern | Yes | ||
| category | No | sequence | |
| source | No | ||
| project | No | ||
| explain | No |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided, but description fully discloses behavioral traits: idempotent on pattern key, confidence levels (1=new, 5=mature, 10=rule), return values. It adds context beyond what structured fields could convey.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Well-structured with sections for purpose, usage, args, returns. Each sentence adds value. Slightly verbose but front-loaded and clear. Could tighten a few phrases without loss.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given no annotations, complex behavior, 5 parameters, and output schema, description is very complete. Covers when to use, parameter details, idempotency, return values, and conventions. Output schema exists but description explains return dict structure.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, but description explains each parameter with examples and conventions (e.g., pattern key format, category default, source and project usage). Adds significant meaning beyond bare schema properties.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description clearly states the tool records an observation of a behavioral pattern and increments confidence. It distinguishes from siblings by specifying it is for patterns that may recur, not one-off notes, and uses specific verbs like 'record' and 'log'.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly says when to use (log anything for agent learning) and when not to (one-off notes belong in regular memory). Provides guidance on repeated calls to raise confidence and contrasts with sibling tools like `alias_pattern` or `consolidate`.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
search_instinctsA
Find patterns by keyword across pattern key, metadata, and explain text.
Uses SQLite FTS5 for ranked, fast retrieval. Falls back to LIKE
substring matching automatically when the query contains special
characters that FTS5 cannot tokenize. Read-only; no side effects.
FTS5 query syntax:
- Bare word "lint" — matches any record containing the token.
- Multi-word "lint fix" — implicit AND; both tokens must appear.
- Explicit "lint OR format" — either token.
- Phrase '"exact phrase"' — contiguous match (note embedded quotes).
- Prefix "claude*" — any token starting with claude.
- Negation "lint NOT prettier" — excludes matches containing the
second term.
For exact-key lookup use get_instinct(). For unfiltered browsing or
category/project filters without a keyword, use list_instincts().
Args:
query: Search term in FTS5 syntax (see above). Case-insensitive.
Special characters trigger automatic LIKE fallback.
limit: Maximum results to return. Default 20; raise for broad
audits, lower for suggest-like focused views.
Returns:
{"results": [<record>, ...], "count": int, "hint": str}
Each <record> has: "pattern" (str key with prefix),
"category" ("sequence"|"preference"|"fix_pattern"|"combo"),
"confidence" (int observation count),
"promoted" (0=raw, 1=mature, 2=rule, 3=universal),
"level" ("raw"|"mature"|"rule"|"universal"),
"project" (str fingerprint, "" = global),
"source" (str origin tag), "metadata" (parsed dict),
"explain" (str human note),
"first_seen" and "last_seen" (ISO 8601 timestamps).
Ordered by confidence descending. Empty "results" means no match;
the "hint" points to list_instincts() or get_instinct() as
fallback next steps.
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | ||
| limit | No |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Discloses read-only nature, FTS5 behavior, automatic fallback to LIKE, and return format. With no annotations, this covers key traits effectively, though potential issues like timeouts are not mentioned.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Well-structured with sections and examples, but slightly verbose; every sentence adds value, but could be tightened slightly.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Covers search behavior, syntax, fallback, return schema, ordering, and fallback next steps, making it fully self-contained for an AI agent.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 0%, but the description explains the query parameter with FTS5 syntax and the limit parameter with default and usage guidance, adding substantial meaning.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states it finds patterns by keyword across specified fields and distinguishes from sibling tools (get_instinct, list_instincts).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly states when to use alternatives: 'For exact-key lookup use get_instinct(). For unfiltered browsing or category/project filters without a keyword, use list_instincts().' Also advises on limit adjustments.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
session_summaryA
End-of-session snapshot: what was learned, what's mature, and housekeeping.
Call this at the end of an agent session to get a one-call overview
suitable for a session log or memory append: recent activity (last
24h), top mature suggestions, and overall store stats.
Side effect: also runs consolidate() and rebuilds the FTS search
index. If you want a pure read-only summary, use stats() + suggest()
separately.
Args:
project: Project fingerprint to scope the summary. Empty string
auto-detects from cwd (recommended).
Returns:
Dict with keys: "session" (patterns_last_24h + recent list of
up to 10), "suggestions" (count + top 5 by confidence),
"stats" (full stats() payload), "consolidation"
(promotion counts from the consolidate() call).
| Name | Required | Description | Default |
|---|---|---|---|
| project | No |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Discloses side effect: runs consolidate() and rebuilds FTS search index. Lacks details on auth or error handling, but adequately covers behavioral impact.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Well-structured with clear sections for purpose, usage, side effect, args, returns. Slightly verbose but each sentence adds value; front-loaded.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Covers purpose, side effect, parameters, and return keys. Differentiates from siblings. Could mention edge cases or failure modes, but sufficient for typical use.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Adds meaning beyond schema: 'Project fingerprint to scope the summary. Empty string auto-detects from cwd (recommended).' Explains purpose and default behavior.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Clearly states 'End-of-session snapshot' and 'one-call overview' for session log or memory append. Distinguishes from siblings like stats and suggest by noting the side effect.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly says 'Call this at the end of an agent session' and provides alternative: 'If you want a pure read-only summary, use stats() + suggest() separately.'
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
statsA
Summary of the instinct store: totals, level distribution, category breakdown.
Use for a quick health check — how many patterns exist, how they
are distributed across promotion levels, which categories dominate,
and the average/peak confidence. Read-only; no side effects; no
params.
For a time-ranged view of what's been observed recently use
trending(days). For end-of-session snapshot that also runs
consolidate use session_summary().
Returns:
{"total": int, "raw": int, "mature": int, "rules": int,
"universal": int, "avg_confidence": float, "max_confidence": int,
"by_category": {<category>: {"count": int,
"avg_confidence": float}}}
Level counts partition "total": raw + mature + rules +
universal == total. "by_category" keys are a subset of
("sequence", "preference", "fix_pattern", "combo") — only
categories actually present appear as keys. Empty store returns
zero counts everywhere, not an error.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Despite no annotations, the description is fully transparent: 'Read-only; no side effects; no params.' It also explains empty store behavior and return structure, leaving no hidden traits.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is highly concise: a brief purpose statement, then usage guidelines, then a clear return spec. Every sentence earns its place without repetition or fluff.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a parameterless tool with an output schema, the description is complete: it covers all relevant aspects (purpose, usage, behavior, return details, edge cases), leaving no gaps.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
No parameters exist, so schema coverage is 100% trivially. The description adds value by detailing return fields and their relationships (e.g., level partition sums to total), which goes beyond the output schema alone.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states 'Summary of the instinct store' and lists specific metrics (totals, level distribution, category breakdown). It explicitly distinguishes from siblings by naming trending and session_summary as alternatives, fulfilling 'specific verb+resource, distinguishes from siblings'.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides explicit usage guidance: 'Use for a quick health check' and states when to use trending or session_summary instead. This gives clear context and exclusion criteria.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
suggestA
Retrieve mature patterns (confidence >= 5) to guide your current behavior.
Call this at the start of a task to learn how similar work has been
handled before: which tool sequences worked, what the user prefers,
which fixes recur. Results are sorted by confidence descending, so
the most-trusted patterns come first.
Prefer this over list_instincts when you want only validated patterns
(not every observation). Use list_instincts to see seedlings too.
Args:
project: Filter by project fingerprint. Empty string returns the
current project's patterns plus global ones. Pass a specific
fingerprint to audit another project.
category: Filter by pattern type. One of: "sequence", "preference",
"fix_pattern", "combo". Empty string returns all categories.
keyword: Substring match against pattern key, metadata, and
explain text. Case-insensitive. Empty string disables filter.
compact: True (default) returns ~50 tokens per pattern (key +
confidence + level only) — ideal for agent context. False
returns full metadata and explain text (~500 tokens each) —
use for audits or UI display.
Returns:
Dict with keys: "suggestions" (list of patterns, compact or
full depending on flag), "count" (int), and in compact mode a
"hint" pointing to get_instinct for details.
| Name | Required | Description | Default |
|---|---|---|---|
| project | No | ||
| category | No | ||
| keyword | No | ||
| compact | No |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Description reveals sorting order (by confidence descending), filtering behavior (empty strings return all), defaults, and return structure. With no annotations, it fully discloses behavioral traits, including the hint pointing to get_instinct for details.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Well-structured with sections for usage, args, and returns. Slightly lengthy but every sentence adds value. Could be more concise, but still effective.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given 4 parameters, no annotations, and an output schema, the description fully covers input/output behavior, usage context, and distinguishes from a key sibling. Sufficient for an agent to use correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
All four parameters are explained with semantics beyond the schema (which lacks descriptions). 'project' handling of empty string, 'category' enum values, 'keyword' substring matching, and 'compact' token counts are all detailed.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description clearly states the verb 'Retrieve' and resource 'mature patterns (confidence >= 5)' and distinguishes itself from sibling 'list_instincts' by noting it returns only validated patterns, not seedlings.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly advises when to call ('at the start of a task'), what to expect ('learn how similar work has been handled before'), and when to prefer alternatives ('Prefer this over list_instincts... use list_instincts to see seedlings'). Also clarifies compact vs full modes.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
trendingA
Rank patterns by observation velocity (reinforcements per window).
Counts entries in the confidence log per pattern within the window
and returns the busiest. A brand-new pattern observed 10 times
today outranks a long-mature pattern idle for weeks. Falls back to
last_seen ordering for patterns with no log entries (pre-history
data). Read-only.
For all-time leaderboards use list_instincts(min_confidence=10).
For the confirmation-rate view of whether trending patterns were
actually useful, pair with effectiveness(days).
Args:
days: Window size in days. Default 7. Smaller (1) = what is
hot right now; larger (30) = what is steady over the
month.
limit: Max patterns to return. Default 10, ordered by window
observation count descending.
Returns:
{"trending": [<record>, ...], "period_days": int}
Each <record> is a full pattern record (see list_instincts
for field list) augmented with an extra field
"observations_in_period": int — the number of reinforcements
counted in this window. When the fallback path runs (no log
history), this field is absent; ordering is then by
"confidence" and "last_seen" descending.
"period_days" echoes the input so callers can cache results
against a window size.
| Name | Required | Description | Default |
|---|---|---|---|
| days | No | ||
| limit | No |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided, but description fully discloses read-only behavior, fallback path, and return structure including extra field and its absence. Comprehensive behavioral context.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Front-loaded with key point. Every sentence adds value, but slightly lengthy. Could be trimmed slightly without losing clarity.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Output schema exists, but description complements it with detailed return format explanation, including extra field and fallback behavior. Complete and comprehensive.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 0%, but description adds extensive semantics: days explains window size for hot vs steady, limit explains max patterns and ordering. Adds significant value beyond schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool ranks patterns by observation velocity (reinforcements per window). It distinguishes itself from sibling tools like list_instincts (all-time leaderboards) and effectiveness (confirmation rate).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicit guidance: use for ranking by velocity, fallback ordering. Alternatives named: list_instincts for all-time, effectiveness for confirmation rate. Parameter guidance: days window size for hot vs steady patterns.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
TDQS
Most tools have distinct purposes, but there is some overlap between export functions (export_claude_md, export_platform, export_rules, export_skill) that could cause confusion about which to use for specific output formats. Additionally, session_summary and stats both provide summaries, though session_summary includes side effects. Overall, descriptions help differentiate, but the export cluster and summary tools require careful reading to avoid misselection.
Tool names follow a highly consistent snake_case pattern with clear verb_noun structures (e.g., alias_pattern, consolidate, detect_chains). All tools adhere to this convention, making them predictable and easy to parse. There are no deviations in naming style, ensuring a coherent and professional appearance.
With 22 tools, the count is borderline high for a pattern-learning server, potentially overwhelming for agents. While the domain (instinct management) is complex and may justify many operations, some tools like export_claude_md and export_platform have overlapping purposes that could be consolidated. The number feels heavy but not extreme, as each tool serves a specific function in the lifecycle.
The tool set provides complete coverage for the instinct domain, including observation (observe), analysis (detect_chains, effectiveness), management (consolidate, gc, alias_pattern), query (suggest, search_instincts, get_instinct), export (multiple formats), and import (import_patterns, import_claude_md). There are no obvious gaps; agents can perform full CRUD-like operations and handle the entire pattern lifecycle without dead ends.
Maintenance
Related MCP Connectors
Persistent memory and knowledge management for AI agents with semantic search and 50+ tools.
Shared control plane for AI coding agents — tasks, memory, decisions, file locks. 12 tools.
Universal memory runtime for AI agents — episodic, semantic, and procedural memory.
Collective memory for AI agents. One agent solves a bug — every agent gets the fix instantly.
Appeared in Searches
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/WRG-11/instinct'
If you have feedback or need assistance with the MCP directory API, please join our Discord server