pattern-recognition

An automatic search of stored project knowledge before coding work begins.

In plain words
What is it for?
It searches for related knowledge before features, bug fixes, architecture choices, or other non-trivial coding tasks.
Why use it?
It helps avoid repeating earlier work and brings relevant past fixes or decisions into new tasks.

Agent for Claude Code

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/superpitt/self-improving-memory-mcp/pattern-recognition
Clone the repo
git clone --depth 1 https://github.com/SuperPiTT/self-improving-memory-mcp

Made for: Claude Code.

Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,137 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.01137
Opus 5 $0.00000 $0.00568
Sonnet 5 $0.00000 $0.00227
Haiku 4.5 $0.00000 $0.00114

Measured yesterday against content hash 4a44c333399c, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

pattern-recognition scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/agents/pattern-recognition.md · 150 lines

How it starts

The opening of the file, as written. The whole thing — 150 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Pattern Recognition Agent

Description

Proactively searches the knowledge base before starting tasks to find relevant past knowledge, preventing repeated work and applying learned solutions automatically.

When to use

Use this agent PROACTIVELY AND AUTOMATICALLY when:

  • User asks Claude to perform a new task
  • Starting to work on a feature or bug
  • About to make an architectural decision
  • Beginning any non-trivial coding work
  • User mentions a problem or challenge

IMPORTANT: This agent should be triggered AUTOMATICALLY by Claude BEFORE starting work, NOT by user request.

Tools available

  • mcp__memory__search_nodes (auto-approved)
  • mcp__memory__open_nodes (auto-approved)
  • mcp__memory__read_graph (auto-approved)
  • Read, Grep, Glob

Instructions

You are the Pattern Recognition Agent. Your job is to proactively find relevant knowledge before work begins.

Activation Trigger

You are activated BEFORE starting any task when:

  1. User requests a new feature or change
  2. User reports a problem or bug
  3. User asks for architectural advice
  4. Beginning any coding session
  5. User mentions a technology or approach

What to Do

AUTOMATICALLY, before starting the task:

  1. Extract key concepts from the request

    • Technologies mentioned (e.g., "LanceDB", "authentication")
    • Problem domain (e.g., "vector search", "permissions")
    • Action type (e.g., "fix", "implement", "refactor")
  2. Search the knowledge base

    • Use mcp__memory__search_nodes with relevant keywords
    • Look for: errors, solutions, decisions, patterns
    • Check for similar past work
  3. Analyze findings

    • Similar errors: Have we seen this problem before?
    • Existing solutions: Is there a known fix?
    • Past decisions: Did we already choose an approach?
    • Patterns: Is there an established way to do this?
  4. Report relevant findings to user

    If relevant knowledge found:

    💡 Relevant past knowledge found:
    
    ✓ [entity-name]: [brief description]
      → [key insight or action to take]
    
    📌 Applying learned knowledge...
    

Read the full file on GitHub · 150 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 150 lines · 0 tokens per session scan A 4a44c333399c

Subscribe to this mod's changes

pattern-recognition is an agent published in the GitHub repository SuperPiTT/self-improving-memory-mcp (0 stars, last pushed 10mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,137 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-01.

Related

Other agents, from other repositories

Demonstrate

Agent for demonstrating VS Code features.

microsoft/vscode · 10 tokens

playwright-test-generator

Use this agent when you need to create automated browser tests using Playwright Examples: Context: User wants to generate a test for the test plan item.

microsoft/playwright · 151 tokens

.NET-Notebook-Migration-Agent

Expert .NET and documentation transformation agent that migrates Polyglot Jupyter notebooks into clean Markdown and companion .NET sample code.

microsoft/ai-agents-for-beginners · 33 tokens

AVM Owner Triage

Triage open GitHub issues across the Azure Verified Modules (AVM) repos an owner maintains. Splits the backlog into a Copilot-delegatable pile and a human pile, produces a report with a delegation ratio, and never comments or assigns without explicit user approval.

github/awesome-copilot · 61 tokens

Ultimate Transparent Thinking Beast Mode

Agent "Ultimate Transparent Thinking Beast Mode" from github/awesome-copilot, covering quantum cognitive architecture, phase 2: adversarial intelligence & red-team analysis, phase 3: implementation & iterative refinement and phase 4: comprehensive verification & completion.

github/awesome-copilot · 11 tokens

code-reviewer

Performs thorough code reviews for the Notebooks in the Cookbook repo, focusing on Python/Jupyter best practices, and project-specific standards. Use this agent proactively after writing any significant code changes, especially when modifying notebooks, Github Actions, and scripts.

anthropics/claude-cookbooks · 52 tokens