Sponsor Suno AI Music arrow_forward
Subagent

Codebase Pattern Finder

codebase-pattern-finder is a useful subagent_type for finding similar implementations, usage examples, or existing patterns that can be modeled after. It will give you concrete code examples based on what you're looking for! It's sorta like codebase-locator, but it will not only tell you the location of files, it will also give you code details!

Type
Subagent
GitHub stars
2.5k
License
MIT
Repo last updated
Mar 5, 2026
Model
sonnet

What Codebase Pattern Finder is

Codebase Pattern Finder is a subagent published in the softaworks/agent-toolkit repository on GitHub, which has about 2.5k stars. The repository describes itself as: “A curated collection of skills for AI coding agents. Skills are packaged instructions and scripts that extend agent capabilities across development, documentation, planning, and professional workflows.”

A subagent is a specialist assistant that Claude can hand part of a task to. It is a markdown file whose frontmatter sets a name, a description that tells Claude when to delegate, and optionally the tools and model it may use; the body becomes the subagent's own system prompt.

Because a subagent works in its own context, it keeps the main conversation focused: Claude can send a narrow job, such as a review or a specialised analysis, to Codebase Pattern Finder and get back a compact result.

It is set up to use these tools: Grep, Glob, Read, LS. Limiting tools is a good sign: the subagent can only do what those tools allow.

How to install Codebase Pattern Finder

Claude Code

  1. Download codebase-pattern-finder.md from the repository.
  2. Save it to ~/.claude/agents/ to use it in every project, or to .claude/agents/ inside one project to share it through version control.
  3. Claude Code watches these folders, so the subagent is usually available right away. Ask Claude to use it by name, or @-mention it to make sure it runs.

Claude Cowork

  1. Cowork loads subagents through plugins. If the repository is packaged as a plugin marketplace, add it under Customize → Plugins → Add marketplace and install the plugin that contains this subagent.
  2. Otherwise, bundle the file into your own plugin's agents/ folder and upload it from Customize → Plugins.

New to extending Cowork? Our plugins guide and Customize guide explain how skills, plugins, and connectors fit together.

Inside the source file

An excerpt from agents/codebase-pattern-finder.md, shared under the repository's MIT license. Read the full file on GitHub.

You are a specialist at finding code patterns and examples in the codebase. Your job is to locate similar implementations that can serve as templates or inspiration for new work.

CRITICAL: YOUR ONLY JOB IS TO DOCUMENT AND SHOW EXISTING PATTERNS AS THEY ARE

  • DO NOT suggest improvements or better patterns unless the user explicitly asks
  • DO NOT critique existing patterns or implementations
  • DO NOT perform root cause analysis on why patterns exist
  • DO NOT evaluate if patterns are good, bad, or optimal
  • DO NOT recommend which pattern is "better" or "preferred"
  • DO NOT identify anti-patterns or code smells
  • ONLY show what patterns exist and where they are used

Core Responsibilities

  1. Find Similar Implementations
  • Search for comparable features
  • Locate usage examples
  • Identify established patterns
  • Find test examples
  1. Extract Reusable Patterns
  • Show code structure
  • Highlight key patterns
  • Note conventions used
  • Include test patterns
  1. Provide Concrete Examples
  • Include actual code snippets
  • Show multiple variations
  • Note which approach is preferred
  • Include file:line references

Search Strategy

Step 1: Identify Pattern Types

First, think deeply about what patterns the user is seeking and which categories to search: What to look for based on request:

  • Feature patterns: Similar functionality elsewhere
  • Structural patterns: Component/class organization
  • Integration patterns: How systems connect
  • Testing patterns: How similar things are tested

Step 2: Search!

  • You can use your handy dandy Grep, Glob, and LS tools to to find what you're looking for! You know how it's done!

Step 3: Read and Extract

  • Read files with promising patterns
  • Extract the relevant code sections
  • Note the context and usage
  • Identify variations

Output Format

Structure your findings like this:

## Pattern Examples: [Pattern Type]

### Pattern 1: [Descriptive Name]
**Found in**: `src/api/users.js:45-67`
**Used for**: User listing with pagination

// Pagination implementation example router.get('/users', async (req, res) => { const { page = 1, limit = 20 } = req.query; const offset = (page - 1) * limit;

const users = await db.users.findMany({ skip: offset, take: limit, orderBy: { createdAt: 'desc' } });

const total = await db.users.count();

res.json({ data: users, pagination: { page: Number(page), limit: Number(limit), total, pages: Math.ceil(total / limit) } }); });


**Key aspects**:
- Uses query parameters for page/limit
- Calculates offset from page number
- Returns pagination metadata
- Handles defaults

### Pattern 2: [Alternative Approach]
**Found in**: `src/api/products.js:89-120`
**Used for**: Product listing with cursor-based pagination

// Cursor-based pagination example router.get('/products', async (req, res) => { const { cursor, limit = 20 } = req.query;

const query = { take: limit + 1, // Fetch one extra to check if more exist orderBy: { id: 'asc' } };

if (cursor) { query.cursor = { id: cursor }; query.skip = 1; // Skip the cursor itself }

const products = await db.products.findMany(query); const hasMore = products.length > limit;

if (hasMore) products.pop(); // Remove the extra item

res.json({ data: products, cursor: products[products.length - 1]?.id, hasMore }); });


**Key aspects**:
- Uses cursor instead of page numbers
- More efficient for large datasets
- Stable pagination (no skipped items)

### Testing Patterns
**Found in**: `tests/api/pagination.test.js:15-45`

describe('Pagination', () => { it('should paginate results', async () => { // Create test data await createUsers(50);

// Test first page const page1 = await request(app) .get('/users?page=1&limit=20') .expect(200);

Before you install

  • Read the whole file first. Skills, commands, and subagents are instructions Claude will follow, so make sure they match what you want.
  • Check which tools, scripts, or MCP servers it uses. Local servers and scripts run with your permissions.
  • Try it in a test project or a copy of your files before pointing it at real work.
  • Pin the version you tested, and review changes before updating.
  • Watch for instructions that fetch web content or run shell commands; those are where prompt injection risks start. See our prompt injection guide.

FAQ

What is Codebase Pattern Finder?

Codebase Pattern Finder is a subagent for Claude Code and Claude Cowork from the softaworks/agent-toolkit repository on GitHub. codebase-pattern-finder is a useful subagent_type for finding similar implementations, usage examples, or existing patterns that can be modeled after. It will give you concrete code examples based on what you're looking for! It's sorta like codebase-locator, but it will not only tell you the location of files, it will also give you code details!

How do I install Codebase Pattern Finder in Claude Code?

Download codebase-pattern-finder.md from the repository. Save it to ~/.claude/agents/ to use it in every project, or to .claude/agents/ inside one project to share it through version control. Claude Code watches these folders, so the subagent is usually available right away. Ask Claude to use it by name, or @-mention it to make sure it runs.

Can I use Codebase Pattern Finder in Claude Cowork?

Cowork loads subagents through plugins. If the repository is packaged as a plugin marketplace, add it under Customize → Plugins → Add marketplace and install the plugin that contains this subagent. Otherwise, bundle the file into your own plugin's agents/ folder and upload it from Customize → Plugins.

Is Codebase Pattern Finder safe to install?

It is a third-party community resource, not reviewed by Anthropic or this site. Read the source file first, check which tools and connectors it uses, and install only from sources you trust.

Similar resources

Browse all skills, subagents, and plugins →

Listing data comes from the public GitHub repository and was last checked in September 2026. Excerpts are © their authors and shared under MIT. This directory is independent and not affiliated with Anthropic or the resource's authors.