Skip to main content
subagent

codebase-pattern-finder — Claude Code subagent: pattern search

Finds existing code patterns and concrete implementations across your repository to guide new work.

Install into Claude Code · claude-code-templates All methods and platforms ↓
npx claude-code-templates@latest --agent development-tools/codebase-pattern-finder
Open on GitHub

What codebase-pattern-finder does

The subagent inspects your repository using Grep, Glob, Read, and Bash. It locates working feature implementations, API routes, database queries, component setups, and accompanying test suites. Each finding comes with precise file paths, line ranges, and short explanations of the observed design choices.

Its behavior is strictly factual. The agent operates as a neutral cataloger: it documents existing patterns as they are, without critiquing code quality, pointing out anti-patterns, or deciding which implementation is preferable unless directly instructed.

What it helps with

  • locate working examples of specific features before writing new code
  • extract established unit and integration testing patterns across the project
  • compare different pagination or query handling strategies already in production
  • gather reference implementations with exact file paths and line numbers

Example prompts for the agent

  • Find cursor pagination implementations and their tests in this project
  • Show how middleware and request validation are handled across our routes
  • Locate component state management patterns used in the frontend directory

How to install codebase-pattern-finder

1claude-code-templates

npx claude-code-templates@latest --agent development-tools/codebase-pattern-finder

2Manually: put the files in place

.claude/agents/codebase-pattern-finder.md

For all projects use ~/.claude/agents/. Claude delegates by the description field or an @-mention

Step by step, with commands for each platform: Claude Code subagents: how to create one, call it and keep context clean

Questions about codebase-pattern-finder

How to install codebase-pattern-finder in Claude Code?

Run npx claude-code-templates@latest --agent development-tools/codebase-pattern-finder or save the agent definition directly into .claude/agents/codebase-pattern-finder.md.

What does codebase-pattern-finder do?

It searches your repository for recurring patterns, formats them with file paths and line references, and presents them as templates for upcoming tasks.

Can codebase-pattern-finder suggest refactoring ideas?

No, it deliberately avoids judging code or recommending superior approaches, documenting only what already exists in the repository.

Similar subagents

All subagents for Agent setup: memory, context, orchestration →

From the same set804

The whole set →

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor