code-pattern-extractor

code-pattern-extractor is a skill for Claude Code, Codex from ArabelaTso/Skills-4-SE. It costs 62 tokens per session (1,333 once invoked), scanned A, original, Apache-2.0.

A code-analysis method for finding repeated code and recurring implementation approaches in a codebase. A monorepo is a single repository containing multiple projects or modules; this kind of analysis can be applied to a directory, file set, or component.

In plain words
What is it for?
Use it during refactoring, technical-debt reviews, abstraction planning, and documentation of repeated API, error-handling, or structural patterns.
Why use it?
It makes duplication and common patterns visible so you can decide what to reuse, simplify, or refactor.

Skill for Claude CodeCodex

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 skills/arabelatso/skills-4-se/code-pattern-extractor
Any agent
npx skills add ArabelaTso/Skills-4-SE --skill code-pattern-extractor
Clone the repo
git clone --depth 1 https://github.com/ArabelaTso/Skills-4-SE

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for code-pattern-extractor

README.md
[![agentmods](https://agentmods.dev/badge/skills/arabelatso/skills-4-se/code-pattern-extractor.svg)](https://agentmods.dev/skills/arabelatso/skills-4-se/code-pattern-extractor)
Your own site
<a href="https://agentmods.dev/skills/arabelatso/skills-4-se/code-pattern-extractor"><img src="https://agentmods.dev/badge/skills/arabelatso/skills-4-se/code-pattern-extractor.svg" alt="Measured on agentmods" height="20"></a>
Per session 62 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,333 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. 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.00062 $0.01333
Opus 5 $0.00031 $0.00666
Sonnet 5 $0.00012 $0.00267
Haiku 4.5 $0.00006 $0.00133

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

Security

Grade A, and why

code-pattern-extractor scanned grade A with 1 finding 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 4d ago.

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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

const response = await fetch(url);
skills/code-pattern-extractor/SKILL.md · 215 lines

How it starts

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

Code Pattern Extractor

Overview

Systematically analyze code in directories or modules to identify recurring patterns, code duplication, and implementation patterns that can be abstracted into reusable components, utilities, or design patterns.

Workflow

1. Define Analysis Scope

Identify the code to analyze:

  • Directory/module: Analyze all files in a specific directory
  • File set: Analyze a specific set of related files
  • Component: Analyze files related to a specific feature or component

Use Glob to find relevant files:

**/*.js, **/*.py, **/*.go, etc.

2. Scan for Code Duplication

Identify repeated code blocks that appear multiple times:

Look for:

  • Similar function implementations with minor variations
  • Repeated code blocks (>5 lines) across files
  • Copy-pasted code with slight modifications
  • Similar class structures or method patterns

Analysis criteria:

  • Similarity threshold: >70% code similarity
  • Minimum size: 5+ lines of code
  • Frequency: Appears 3+ times

3. Identify Implementation Patterns

Find recurring implementation approaches:

Common patterns:

  • API call patterns: Similar fetch/request handling
  • Error handling: Repeated try-catch or error checking
  • Data validation: Similar input validation logic
  • Data transformation: Repeated mapping/filtering operations
  • State management: Similar state update patterns
  • Configuration: Repeated configuration setup

Example patterns to detect:

// Pattern: API call with error handling
async function fetchX() {
  try {
    const response = await fetch(url);
    if (!response.ok) throw new Error();
    return await response.json();
  } catch (error) {
    console.error(error);
    return null;
  }
}

4. Categorize Patterns

Group identified patterns by type and impact:

Categories:

  • High-value: Appears frequently (5+ times), significant code size
  • Medium-value: Appears moderately (3-4 times), moderate complexity
  • Low-value: Appears rarely (2 times), simple code

Read the full file on GitHub · 215 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. 4d ago First seen · 215 lines · 62 tokens per session scan A 9f522f280340

Subscribe to this mod's changes

code-pattern-extractor is a skill published in the GitHub repository ArabelaTso/Skills-4-SE (247 stars, last pushed 13d ago), licensed Apache-2.0. It adds 62 tokens to every session and 1,333 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.