deep

deep is a skill for Claude Code, Codex from oprogramadorreal/optimus-claude. It costs 80 tokens per session (2,831 once invoked), scanned A, original, MIT.

An automated loop that repeatedly reviews, refactors, or tests a codebase. Refactoring means improving code structure without changing what it does; coverage measures how much code tests exercise.

In plain words
What is it for?
Use it for repeated code review, refactoring, or unit-test coverage work after the required project setup is available.
Why use it?
It carries fixes and test runs across fresh work cycles, investigates failed tests, and stops when the chosen improvement process converges or reaches its limit.

Skill for Claude CodeCodex

Installs and runs on its own, but its text points at files inside its plugin — anything it tells you to read at a ${CLAUDE_PLUGIN_ROOT} path is only there once the plugin is installed. Installing the plugin gets both.

Part of the optimus plugin — 19 skills, 15 agents, 3 hooks shipped together

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/oprogramadorreal/optimus-claude/deep
Any agent
npx skills add oprogramadorreal/optimus-claude --skill deep
Clone the repo
git clone --depth 1 https://github.com/oprogramadorreal/optimus-claude

Made for: Claude Code, Codex.

Or install optimus, the plugin that ships this one along with the rest of its 19 skills, 15 agents, 3 hooks.

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 deep

README.md
[![agentmods](https://agentmods.dev/badge/skills/oprogramadorreal/optimus-claude/deep.svg)](https://agentmods.dev/skills/oprogramadorreal/optimus-claude/deep)
Your own site
<a href="https://agentmods.dev/skills/oprogramadorreal/optimus-claude/deep"><img src="https://agentmods.dev/badge/skills/oprogramadorreal/optimus-claude/deep.svg" alt="Measured on agentmods" height="20"></a>
Per session 80 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,831 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00080 $0.02831
Opus 5 $0.00040 $0.01416
Sonnet 5 $0.00016 $0.00566
Haiku 4.5 $0.00008 $0.00283

Measured today against content hash f7728eb30a2a, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

deep scanned grade A with 0 findings 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 today.

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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/deep/SKILL.md · 142 lines

How it starts

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

Deep Mode

Orchestrate a base skill in an iterative auto-fix loop. Each iteration runs in a fresh subagent context, so the loop is not bounded by single-conversation context decay. All state lives in the target's progress file; the harness_common.cli helper applies fixes, runs tests, bisects failures, and decides termination.

Targets

Target Base skill (--skill) Progress file Cap flag (default/hard) Loop reference Focus
review code-review .claude/code-review-deep-progress.json --max-iterations 8/20 references/orchestrator-loop-single.md no
refactor refactor .claude/refactor-deep-progress.json --max-iterations 8/20 references/orchestrator-loop-single.md yes
coverage unit-test .claude/unit-test-deep-progress.json --max-cycles 5/10 references/orchestrator-loop-paired.md no — pinned to testability for its refactor phase; a user-supplied focus is rejected

The progress-file paths are load-bearing CLI defaults — never rename them. The coverage target counts cycles, not iterations: each cycle dispatches a unit-test phase (write tests, measure coverage, flag untestable code) and, when untestable items are pending, a refactor phase with testability focus.

Step 1: Parse Arguments and Guard Against Re-entry

Re-entry guard

If your invocation prompt body already contains HARNESS_MODE_INLINE, stop immediately with: "Deep mode cannot run inside deep mode." This prevents a misbehaving subagent from spawning a recursive deep run.

Parse invocation arguments

  1. Target — the first standalone token must be review, refactor, or coverage; otherwise stop and show the usage from the argument hint. All table lookups below use this target's row.
  2. --resume and --no-commit flags (present/absent)
  3. --yes flag — auto-confirm every confirmation prompt in this skill (the Step 3 prompt and Step 4's coverage red-baseline confirmation); required when invoked under claude -p or any other non-interactive session that cannot answer AskUserQuestion.
  4. Cap — the target's cap flag from the table (--max-iterations N or --max-cycles N), default and hard cap per the table.
  5. Focus — refactor target only; stop on any other value or any other target (the CLI rejects both). Accept either --focus testability|guidelines or a bare testability/guidelines token, applying the Focus detection rules in $CLAUDE_PLUGIN_ROOT/skills/refactor/SKILL.md — read that section when parsing this item; it is the single source for the rule (do not paraphrase it here). A token consumed as focus is removed from the scope text before item 7 — otherwise deep refactor guidelines src would lose the src path scope.
  6. --allow-red-baseline — review/refactor only; coverage always tolerates a red baseline (see Step 4).
  7. Everything else → scope text. An existing path scopes the run to that path; any other text is recorded as intent only — it does not filter. Default scope: review covers the branch diff; refactor covers the feature-branch diff when one exists, otherwise the full project, widening per iteration to files with active findings and newly modified files; coverage covers the full project.

Read the full file on GitHub · 142 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. today Changed f7728eb30a2a
  2. 4d ago First seen · 142 lines · 80 tokens per session scan A 0f4861a7d8ac

Subscribe to this mod's changes

deep is a skill published in the GitHub repository oprogramadorreal/optimus-claude (73 stars, last pushed yesterday), licensed MIT. It adds 80 tokens to every session and 2,831 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.