# finding-duplicate-functions

> Claude/Codex skill by [@obra](https://omgskills.com/library/obra/index.md) · 404 stars · Updated 2026-06-01

Use when auditing a codebase for semantic duplication - functions that do the same thing but have different names or implementations. Especially useful for LLM-generated codebases where new functions are often created rather than reusing existing ones.

## Install

```sh
git clone https://github.com/obra/superpowers-lab /tmp/superpowers-lab && ln -s /tmp/superpowers-lab/skills/finding-duplicate-functions ~/.claude/skills/finding-duplicate-functions
```

## From README

Finding Duplicate-Intent Functions Overview LLM-generated codebases accumulate semantic duplicates: functions that serve the same purpose but were implemented independently. Classical copy-paste detectors (jscpd) find syntactic duplicates but miss "same intent, different implementation." This skill uses a two-phase approach: classical extraction followed by LLM-powered intent clustering. When to Use Codebase has grown organically with multiple contributors (human or LLM) You suspect utility functions have been reimplemented multiple times Before major refactoring to identify consolidation opportunities After jscpd has been run and syntactic duplicates are already handled Quick Reference | Phase | Tool | Model | Output | |-------|------|-------|--------| | 1. Extract | scripts/extract-functions.sh | - | catalog.json | | 2. Categorize | scripts/categorize-prompt.md | haiku | categorized.json | | 3. Split | scripts/prepare-category-analysis.sh | - | categories/.json | | 4.

## Links

- HTML page: https://omgskills.com/skills/obra/superpowers-lab/finding-duplicate-functions/
- GitHub: https://github.com/obra/superpowers-lab
- Author: [@obra](https://omgskills.com/library/obra/index.md)

## More from this repo

- [using-tmux-for-interactive-commands](https://omgskills.com/skills/obra/superpowers-lab/using-tmux-for-interactive-commands/index.md) — Used when you need to run interactive CLI tools (vim, git rebase -i, Python REPL, etc.) that require real-time...
   - [@obra](https://omgskills.com/library/obra/index.md) · 404 stars

## More skills by this author

- [systematic-debugging](https://omgskills.com/skills/obra/superpowers/systematic-debugging/index.md) — Used when encountering any bug, test failure, or unexpected behavior, before proposing fixes
   - [@obra](https://omgskills.com/library/obra/index.md) · 285k stars
- [brainstorming](https://omgskills.com/skills/obra/superpowers/brainstorming/index.md) — You MUST use this before any creative work - creating features, building components, adding functionality, or modifying...
   - [@obra](https://omgskills.com/library/obra/index.md) · 280k stars
