search_instincts
Find patterns by keyword across pattern key, metadata, and explain text. Uses FTS5 for fast ranked retrieval, with automatic fallback to LIKE for special characters.
Instructions
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.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | ||
| limit | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||