Analyze a codebase for algorithmic complexity hotspots and produce safe optimization reports. Finds nested loops, N+1 queries, sorts inside loops, .includes() instead of Set, and expensive render-path transforms. Report only by default — no files touched unless you ask.
Universal complexity optimizer for AI coding agents. Scans your codebase for algorithmic complexity hotspots (nested loops, N+1 queries, O(n^2) patterns) and produces safe optimization reports.
Works with every major AI coding agent: Claude Code, Codex, Pi, Cursor, Windsurf, GitHub Copilot, Gemini CLI, Cline/Roo Code, Aider, OpenCode, Continue.dev, Amazon Q Developer, and Zed AI.
Based on codex-complexity-optimizer by Kappaemme. See CREDITS.md for full attribution.
/plugin marketplace add sebastianbreguel/agent-complexity-optimizer
/plugin install complexity-optimizer@complexity-optimizer
Or via npx skills add:
npx skills add sebastianbreguel/agent-complexity-optimizer -a claude-code -g -y
npx skills add sebastianbreguel/agent-complexity-optimizer -a codex -g -y
Pi loads skills from npm packages with pi.skills metadata:
npm install -g agent-complexity-optimizer
npx agent-complexity-optimizer
The fallback installer auto-detects which agents you have (Cursor, Windsurf, Copilot, Gemini CLI, Cline/Roo, Aider, OpenCode, Continue.dev, Amazon Q, Zed AI) and installs the right format for each.
Use --dry-run to preview:
npx agent-complexity-optimizer --dry-run
| Agent | Install method | Config format |
|---|---|---|
| Claude Code | npx skills add | SKILL.md (slash command) |
| Codex (OpenAI) | npx skills add | SKILL.md + openai.yaml |
| Pi | npm install (pi.skills) | SKILL.md |
| Cursor | auto-detect installer | .mdc rule |
| Windsurf (Codeium) | auto-detect installer | .windsurfrules |
| GitHub Copilot | auto-detect installer | copilot-instructions.md |
| Gemini CLI | auto-detect installer | GEMINI.md |
| Cline / Roo Code | auto-detect installer | .clinerules |
| Aider | auto-detect installer | CONVENTIONS.md |
| OpenCode | auto-detect installer | AGENTS.md |
| Continue.dev | auto-detect installer | Custom command YAML |
| Amazon Q Developer | auto-detect installer | Rules .md |
| Zed AI | auto-detect installer | Assistant rules |
Ask your agent to analyze your codebase. The phrasing doesn't matter much:
Analyze this codebase for complexity hotspots and give me a report.
Scan this repo for performance issues — nested loops, N+1 queries, O(n^2) patterns.
For Codex specifically:
Use $complexity-optimizer to analyze this codebase and give me a full complexity report.
By default, reports don't modify files. To apply a fix:
Implement the lowest-risk optimization from the report and run the tests.
The Python scanner works independently of any agent:
python3 skills/complexity-optimizer/scripts/analyze_complexity.py /path/to/repo --format markdown
python3 skills/complexity-optimizer/scripts/analyze_complexity.py /path/to/repo --format json
Supports: Python, JavaScript, TypeScript, JSX/TSX, Java, Go, C, C++, C#, Ruby, PHP, Swift, Rust, Kotlin, Scala, Lua, Zig, Elixir, Erlang, Dart, R, Julia, OCaml, Clojure, and more.
includes(), indexOf(), in inside iterationIf the auto-installer doesn't detect your agent, copy files manually:
skills/complexity-optimizer/scripts/analyze_complexity.py to your agent's config directoryagents/<agent-name>/MIT. See CREDITS.md for attribution to the original project.
Own this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimOwn this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimBased on adoption, maintenance, documentation, and repository signals. Not a security audit or endorsement.
npx claudepluginhub sebastianbreguel/agent-complexity-optimizer --plugin complexity-optimizerPick up exactly where you left off. Per-project resume of your last task + next step. No DB, no API keys, no MCP.
Ultra-compressed communication mode. Cuts ~75% of tokens while keeping full technical accuracy by speaking like a caveman.
Frontend design skill for UI/UX implementation
Comprehensive UI/UX design plugin for mobile (iOS, Android, React Native) and web applications with design systems, accessibility, and modern patterns
Memory compression system for Claude Code - persist context across sessions
Marketing skills for AI agents — conversion optimization, copywriting, SEO, paid ads, ad creative, and growth
Standalone image generation plugin using Nano Banana MCP server. Generates and edits images, icons, diagrams, patterns, and visual assets via Gemini image models. No Gemini CLI dependency required.