pattern-matcher — Claude Code subagent: setup and use
The pattern-matcher subagent breaks down tasks, finds related solutions in ReasoningBank, and adapts them to a new context.
no license ★ 850 updated 2026-10-26
.claude/agents/pattern-matcher.mdWhat pattern-matcher does
pattern-matcher examines a request through structural, algorithmic, domain, and functional traits. It then searches ReasoningBank for related cases, compares the matches, and reshapes a suitable approach for the current task. This makes it useful when a solution from one area needs to be applied elsewhere.
The agent file includes frontmatter with its description, priority, and ReasoningBank settings. A pre-run hook calls npx agentic-flow@latest reasoningbank retrieve to look up related patterns; a post-run hook sends extracted patterns to reasoningbank distill. Those hooks depend on npx agentic-flow@latest being available, so the ReasoningBank steps will not run without it.
What it helps with
- break a task into reusable patterns
- search stored experience for related solutions
- adapt an approach from another domain
- compare several possible solution paths
- save patterns discovered during a task
Example prompts for the agent
- Ask
pattern-matcherto decompose this task and search ReasoningBank for related solutions. - Find a previous solution with a similar structure and adapt it to this project.
- Extract reusable patterns from the completed task and store them in ReasoningBank.
How to install pattern-matcher
Manually: put the files in place
.claude/agents/pattern-matcher.mdFor all projects use ~/.claude/agents/. Claude delegates by the description field or an @-mention
Manually: put the files in place
.codex/agents/pattern-matcher.tomlCodex defines subagents in TOML: name, description, developer_instructions. Move the Markdown text into developer_instructions by hand. For all projects use ~/.codex/agents/
Manually: put the files in place
.cursor/agents/pattern-matcher.mdCursor also reads .claude/agents/
Step by step, with commands for each platform: Claude Code subagents: how to create one, call it and keep context clean
Questions about pattern-matcher
How do I install pattern-matcher in Claude Code?
Save the subagent file at .claude/agents/pattern-matcher.md.
What does pattern-matcher do?
It breaks a task into recognizable traits, retrieves related cases through ReasoningBank, and adapts a selected approach to the current context.
What are pattern-matcher's hooks used for?
The pre-run hook retrieves related cases, while the post-run hook stores extracted patterns. Both steps call npx agentic-flow@latest.