rafal-qa/slopo

Embedding-based discovery of duplicated logic for projects too large or messy to maintain reliably

What it solves

Slopo detects "hidden" code duplication—cases where the same logic is implemented in different ways across a codebase. While AI coding agents are excellent at tasks within their immediate context, they often miss existing implementations elsewhere in large or poorly structured projects. Slopo identifies these duplicates regardless of how they are written, helping developers avoid redundant code and reducing the cost of AI agents by offloading the search for existing solutions.

How it works

Slopo uses embedding models to convert code snippets into mathematical vectors. By comparing these vectors, the tool identifies code units (functions, methods, or blocks) that share similar meanings even if the syntax differs. It prioritizes code that is physically distant within the project, as this is where duplication is most likely to go unnoticed. The tool can be used via a command-line interface or integrated directly into AI coding agents to provide them with focused, relevant context.

Who it’s for

This tool is designed for developers working on large or complex codebases who want to maintain clean architecture and reduce technical debt. It is best suited for users comfortable with configuring AI models and making technical decisions, rather than those looking for a fully automated, "magic" fix.

Highlights

  • Language Support: Works with Python, TypeScript, JavaScript, Java, Kotlin, C, C++, C#, Go, Rust, PHP, Elixir, Ruby, and Swift.
  • Agent Integration: Includes specific skills for Claude Code and Codex to allow agents to review changes or analyze the entire codebase for duplicates.
  • Cost-Effective: Uses inexpensive embedding models to filter code, saving expensive AI agent tokens for actual analysis and refactoring.
  • Flexible Deployment: Supports cloud-based APIs like Jina AI and Voyage AI, or local execution via Ollama.
  • Configurable Analysis: Allows fine-tuning of similarity thresholds and exclusion patterns to balance precision and noise.

Related

  • Dispatch
  • Project
  • Project
  • Project
  • Project