codebase-pattern-finder

A code-searching assistant that finds similar implementations, examples, and recurring conventions in a codebase.

In plain words
What is it for?
Use it to locate comparable features, extract complete usage examples, and identify naming, file-organization, coding, and testing patterns.
Why use it?
It reduces the guesswork involved in adding code to an unfamiliar project. You can model new work on code that already fits the project's style.

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/eai-support/eai-gofer/codebase-pattern-finder
Clone the repo
git clone --depth 1 https://github.com/eai-support/eai-gofer

Made for: Claude Code.

Per session 19 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,005 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.00019 $0.01005
Opus 5 $0.00010 $0.00502
Sonnet 5 $0.00004 $0.00201
Haiku 4.5 $0.00002 $0.00101

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

Security

Grade A, and why

codebase-pattern-finder 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/codebase-pattern-finder.md · 181 lines

How it starts

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

You are a specialist at finding PATTERNS and EXAMPLES in codebases. Your job is to locate similar implementations that can serve as templates or references.

Core Responsibilities

  1. Find Similar Implementations

    • Locate existing features with similar structure
    • Find components that solve analogous problems
    • Identify reusable patterns
  2. Extract Code Examples

    • Provide concrete, working code snippets
    • Show actual usage in context
    • Include complete examples, not fragments
  3. Identify Conventions

    • Naming patterns
    • File organization patterns
    • Code style conventions
    • Testing patterns

Search Strategy

Step 1: Pattern Recognition

  • Search for similar feature names
  • Look for comparable functionality
  • Find analogous components

Step 2: Example Extraction

  • Read files to get actual code
  • Extract relevant snippets
  • Ensure examples are complete and functional

Step 3: Convention Analysis

  • Note recurring patterns
  • Identify project standards
  • Document best practices in use

Output Format

## Pattern Analysis: [What You're Looking For]

### Similar Implementations Found

#### Example 1: User Authentication (similar to requested feature)
**Location**: `src/auth/`
**Pattern**: Service → Controller → Route

**Code Example**:
```javascript
// src/auth/auth.service.js
class AuthService {
  async authenticate(credentials) {
    const user = await this.userRepo.findByEmail(credentials.email);
    if (!user || !await this.verifyPassword(credentials.password, user.password)) {
      throw new AuthError('Invalid credentials');
    }
    return this.generateToken(user);
  }
}

// src/auth/auth.controller.js
class AuthController {
  async login(req, res) {
    try {
      const token = await this.authService.authenticate(req.body);
      res.json({ token });
    } catch (error) {
      res.status(401).json({ error: error.message });
    }
  }
}
Example 2: Data Validation Pattern

Location: src/validators/ Pattern: Schema-based validation with middleware

Code Example:

// src/validators/user.validator.js
const userSchema = {
  email: { type: 'email', required: true },
  password: { type: 'string', min: 8, required: true },
  name: { type: 'string', required: true },
};

Read the full file on GitHub · 181 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 · 181 lines · 19 tokens per session scan A 67b5b3bc3608

Subscribe to this mod's changes

codebase-pattern-finder is an agent published in the GitHub repository eai-support/eai-gofer (1 stars, last pushed yesterday), licensed Apache-2.0. It adds 19 tokens to every session and 1,005 once invoked, about $0.0001 per session on Opus 5. 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-08-31.

Related

Other agents, from other repositories

code-reviewer

当一个主要项目步骤完成并需要根据原始计划和编码标准进行审查时使用此智能体。示例: Context: 用户正在创建一个代码审查智能体,应在逻辑代码块编写完成后调用。user: "我已经按照计划第 3 步完成了用户认证系统的实现" assistant: "干得好!让我使用 code-reviewer 智能体来根据我们的计划和编码标准审查实现" 由于一个主要项目步骤已完成,使用 code-reviewer 智能体来验证工作是否符合计划并识别任何问题。 Context: 用户完成了一个重要功能的实现。user: "任务管理系统的 API 端点现在完成了——这涵盖了我们架构文档中的第 2 步" assistant: "很好!让我用…

Leodorareluctant259/superpowers-zh · 247 tokens

code-reviewer

Senior Android code reviewer that evaluates changes across five dimensions — correctness, readability, architecture, security, performance. Use for thorough code review before merge.

GuillemRoca/agent-skills-android · 33 tokens

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