Repository navigation
OpenCode Prime v0.39.1
v0.39.1 — 2026-09-16
✨ New command: /clean-dead-code
Evidence-graded dead-code sweep & cleanup, orchestrated by @build. The governing principle: deletion is the user's decision; the agent's job is evidence. Nothing is deleted on suspicion, nothing is silently dismissed — every uncertain finding is handed to the user with a recommendation.
- Scopes —
[changes](default: uncommitted work, incl. deletions that orphan existing code),commit <ref>,<base>..<head>,pr <n|url>(viagh),all(whole project). Diff scopes report both directions: introduced-dead (the change added what nobody uses) and orphaned-by-diff (the change deleted the last caller). - Focus mode —
--focus="payment checkout", or just trailing free text (/clean-dead-code auth middleware), narrows findings to one feature's code area: the agent infers the area and the user confirms it before scanning. A focus narrows what is reported, never what is searched — references outside the area still count as live uses. - Taxonomy C1–C6 — unused declarations, unreachable code, orphan files/modules, unused dependencies, dead config & feature flags, orphan resources.
- Risk classes R1–R4 — R1/R2 support batch approval; R3 (public surface, test-only refs, deps, any unruled-out dynamic suspicion) is a per-item user decision and is never pre-approvable; R4 (entry points, generated/vendored, published API, exclusions) is untouchable. If R2-vs-R3 is arguable, it is R3.
- Evidence layers — project-installed scanners only (knip / vulture / staticcheck / rustc
dead_code/ ...; never auto-installed), code intelligence (Serena / CodeGraph / LSP) via@exploredispatch when available, whole-tree text sweep incl. reflection & dynamic-dispatch patterns, and an entry/public-surface whitelist. Scanner output is input, not verdict. - Safety model — report first (
→ .ocp/dead-code/<UTC>-<scope>[-<focus>].md), user approves every batch, a no-regress baseline (recorded build/typecheck/test state) verified per deletion batch, individually revertiblechore:commits, per-batch file-copy snapshots guard uncommitted WIP (snapshot lifetime = the undo window; consumed snapshots self-prune), history is never rewritten. Keep-decisions persist to.ocp/dead-code/exclusions.mdonly when the user picks the persist option (per-item choice).
Flags: --focus=.. · --cats=.. · --paths=.. · --exclude=.. · --report-only · --approve=R1,R2. Protocol: skills/clean-dead-code/SKILL.md.
🔖 Why a patch bump
DEVELOPING.md maps new features to a minor bump by default. This release is one purely additive command+skill riding a quiet train straight after v0.39.0, so the maintainer took the patch-bump route — now the documented discretionary option (DEVELOPING.md §Adding a new skill or command, step 6), with the reason recorded here as the rule requires.