EveryInc/compound-engineering-plugin · error · Error

Could not verify removal (reported ${status.mode})

Error message

Could not verify removal (reported ${status.mode})

What it means

`removeCodexDevInstallation()` removes all Compound Engineering plugins and the local collection, then verifies with `inspectCodexDevStatus` that the mode is `"absent"`. If any plugin or collection artifact survives (mode reports `mixed`, `local`, `drifted`, or `remote`), this error is thrown.

Source

Thrown at src/dev/codex-dev.ts:653

  await removeLocalCollection(context)
  const status = await inspectCodexDevStatus(context, runner)
  if (status.mode !== "remote") {
    throw new Error(`Could not verify remote Codex mode (reported ${status.mode})`)
  }
  return status
}

export async function removeCodexDevInstallation(
  context: CodexDevContext,
  runner: CommandRunner = new BunCommandRunner(),
): Promise<CodexDevStatus> {
  const plugins = await listCompoundEngineeringPlugins(context, runner)
  await removeLocalPluginConflicts(context, runner, plugins)
  await removeLocalCollection(context)
  const status = await inspectCodexDevStatus(context, runner)
  if (status.mode !== "absent") {
    throw new Error(`Could not verify removal (reported ${status.mode})`)
  }
  return status
}

function statusLines(context: CodexDevContext, status: CodexDevStatus): string[] {
  const branch = context.branch ?? "detached HEAD"
  const worktree = context.linkedWorktree ? "linked worktree" : "primary worktree"
  const dirty =
    context.modifiedCount === 0 && context.untrackedCount === 0
      ? "clean"
      : `${context.modifiedCount} modified, ${context.untrackedCount} untracked`
  const lines = [
    `Mode: ${status.mode}`,
    `Codex home: ${context.codexHome}`,
    `Collection: ${context.collectionPath}`,
    `Source checkout: ${context.repoRoot}`,
    `Worktree: ${worktree}`,
    `Branch: ${branch}`,

View on GitHub (pinned to c9c10f8c75)

Solutions

  1. Run `codex plugin list --json` to find surviving plugins and remove them manually
  2. Delete `$CODEX_HOME/skills/compound-engineering-local` manually if it persists
  3. Check filesystem permissions on `$CODEX_HOME`
  4. Re-run `bun run codex:dev -- remove` after cleanup

Example fix

// after
rm -rf ~/.codex/skills/compound-engineering-local
bun run codex:dev -- remove
Defensive patterns

Strategy: validation

Validate before calling

const status = await inspectCodexDevStatus(context)
if (status.mode === "absent") return // nothing to remove
const removable = status.plugins.filter((p) => p.installed)
if (status.collection.kind === "broken" || status.collection.kind === "collision") {
  console.warn("Manual cleanup of the local collection may be required after removal")
}

Type guard

function isAbsent(status: CodexDevStatus): boolean { return status.mode === "absent" }

Try / catch

try {
  await removeCodexDevInstallation(context, runner)
} catch (error) {
  if (String(error).includes("verify removal")) {
    console.error("Some state survived; run `codex plugin list --json` and check $CODEX_HOME/skills manually")
  } else throw error
}

Prevention

When it happens

Trigger: Calling `removeCodexDevInstallation(context, runner)` when `codex plugin remove` leaves config entries behind, the local collection path cannot be deleted, or a second Compound Engineering plugin appears between listing and verification.

Common situations: Read-only `$CODEX_HOME` or permission errors on `~/.codex/skills`; Codex CLI failing silently on remove; leftover state written concurrently by another session.

Related errors


AI-assisted analysis of EveryInc/compound-engineering-plugin@c9c10f8c75 (2026-08-31). Data as JSON: /api/errors/7fdbc67bd80e0a37. Report an issue: GitHub.