Local Harness Environment Cleanup
Last updated: 2026-05-28
Scope: reduce duplicate Harness skills/plugins across Claude Code, Codex CLI, and Cursor without destructive cleanup by default.
Why Duplicates Happen
Three separate mechanisms can stack:
- Harness repo design: source repo keeps Claude, Codex, and Cursor adapter metadata side by side.
- User home mirrors:
~/.codex/skills, Claude plugin cache, and old plugin versions can all expose the same skill names. - Cursor compatibility import: Cursor official docs load
.claude/skills,.codex/skills,~/.claude/skills, and~/.codex/skillsin addition to Cursor-native skill directories. Enabling Desktop import of Claude/Codex settings can reintroduce duplicates even after clean packages are installed.
Harness cannot force-disable Cursor Desktop compatibility import. Clean Mode reduces duplicates by keeping one Harness route per host and archiving obvious cross-host mirrors after user confirmation.
Profiles
| Profile | When to use | Harness behavior |
|---|---|---|
clean (default) | You want one Harness per tool and fewer duplicate entries | Diagnose all origins; recommend archive/disable of non-primary routes |
compatibility | You intentionally share Claude/Codex skills inside Cursor | Warn about duplicates; recommend explicit invocation ($harness-plan, /claude-code-harness:harness-plan) |
Recommended Primary Routes
| Host | Primary route | Avoid mixing with |
|---|---|---|
| Claude Code | claude-code-harness@claude-code-harness-marketplace plugin | --plugin-dir . while marketplace plugin is also enabled |
| Codex CLI | claude-code-harness@claude-code-harness-marketplace plugin or curated ~/.codex/skills mirror, not both | duplicate harness-* in global skills and plugin cache |
| Cursor | generated Cursor package / .cursor-plugin route | full ~/.codex/skills Harness mirror + Claude plugin cache when Clean Mode is desired |
Dry-Run Diagnosis
Run:
bash scripts/diagnose-harness-skill-duplication.sh
bash scripts/diagnose-harness-skill-duplication.sh --host cursor --profile clean
bash scripts/diagnose-harness-skill-duplication.sh --jsonThe script is dry-run only. It never deletes files or edits config.
Manual Cleanup Checklist (after diagnosis)
- Inventory: note every
harness-*,breezing, andmemoryskill path. - Claude cache: keep one installed version; archive old
~/.claude/plugins/cache/claude-code-harness-marketplace/claude-code-harness/*directories that are not your active version. - Codex route: choose plugin or global skills, then disable the other path (
[[skills.config]] enabled = falseor pluginenabled = false). - Cursor Clean Mode: archive Harness mirrors under
~/.codex/skillsand stale Claude cache copies if Cursor should show Cursor package skills only. - Cursor Desktop import: if Claude/Codex compatibility import stays ON, expect duplicate skill names; use Compatibility Mode guidance instead of assuming zero duplicates.
Cursor Local Plugin Install
Official install route:
bash scripts/setup-cursor.sh --check # build + validate only
bash scripts/setup-cursor.sh # install to ~/.cursor/plugins/local/Two Cursor-specific constraints break naive installs:
Symlinks are rejected. Cursor refuses a
~/.cursor/plugins/local/<name>symlink whose target is outside that directory (logged asloadUserLocalPlugin ... rejected: symlink target ... is outside ...). Install with a real directory copy, not a symlink:bashDIST="$HOME/.local/share/claude-code-harness/cursor" bash scripts/build-host-plugin-dist.sh --host cursor --out "$DIST" rm -rf "$HOME/.cursor/plugins/local/claude-code-harness" cp -R "$DIST" "$HOME/.cursor/plugins/local/claude-code-harness"user-invocable: trueskills are dropped. Cursor does not surface skills flagged for the Claude Code slash-only convention.scripts/build-host-plugin-dist.shrewrites them touser-invocable: falsefor the Cursor package so workflow skills (breezing,harness-plan,harness-work, ...) register as Agent-Decides skills invokable via/skill-name. Always install the generated Cursor package, not the raw repo skills.
After installing, run Developer: Reload Window in Cursor.
Rollback
Before any manual archive:
ARCHIVE_ROOT="$HOME/.harness-skill-cleanup-archive/$(date +%Y%m%d-%H%M%S)"
mkdir -p "$ARCHIVE_ROOT"
# move, do not delete
mv ~/.codex/skills/harness-plan "$ARCHIVE_ROOT/" # example onlyRestore by moving directories back from the archive root.
Verification
After cleanup:
bash scripts/diagnose-harness-skill-duplication.sh --host cursor --profile clean
bash scripts/build-host-plugin-dist.sh --host cursor --out /tmp/harness-cursor-dist
bash tests/test-host-plugin-dist.shRelated Docs
docs/distribution-scope.mddocs/CURSOR_INTEGRATION.mdspec.mdHost Distribution Contract and Clean/Compatibility profiles