rafal-qa/slopo
Embedding-based discovery of duplicated logic for projects too large or messy to maintain reliably
What it solves
Slopo is a CLI tool designed to find "hardest-to-detect" code duplicates—specifically, similar logic implemented in different ways that traditional copy-paste detectors miss. It targets the blind spot where AI coding agents or human developers might reimplement a solution that already exists elsewhere in a large or poorly maintained codebase.
How it works
The tool uses embedding models to represent the meaning of code snippets as vectors. By calculating the cosine similarity between these embeddings, Slopo can identify code that is functionally similar even if the syntax differs. It splits source code into "code units" (functions and blocks), strips comments, and ranks potential duplicates based on both similarity scores and their distance within the codebase (prioritizing code that is far apart).
Who it’s for
It is intended for developers working on large or messy codebases where existing implementations are hard to find, and for those using AI coding agents (like Claude Code or Codex) who want to reduce token costs and improve precision by providing agents with focused reports of potential duplicates.
Highlights
- Multi-language support: Works with Python, TypeScript, JavaScript, Java, Kotlin, C, C++, C#, Go, Rust, PHP, Elixir, Ruby, and Swift.
- AI Agent Integration: Includes dedicated skills for Claude Code and Codex to automate the review and filtering of duplicates.
- Flexible Model Support: Compatible with Jina AI, Voyage AI, and local models via Ollama (using LiteLLM).
- Distance-based Ranking: Boosts the priority of similar code found in different modules or far apart in the same file to highlight the-most-hidden duplicates.
Related
- Dispatch
- Project
- Project
- Dispatch
- Project