Windows Scaffold Setup Mirrors
Windows Scaffold Setup Mirrors
Initial Debt
Issue 58 reports dp scaffold setup on Windows 11 reaches the final .agents/scripts/sync-subagents.mjs step, then fails with EPERM while creating prompt mirror symlinks such as .codex/AGENTS.md from .agents/AGENTS.md. The same report notes .claude/settings.json is overwritten with a hooks-only object instead of merged into existing Claude permissions.
Why Matters
Setup has already generated the consumer repo assets when this step runs. Failing at the mirror step leaves Windows users with an apparently broken scaffold, and replacing Claude settings can delete user-authored allow-lists.
Resolution
Generated subagent sync now uses Windows-compatible directory junctions where symlinks are still appropriate, and copies managed mirror files or directories when symlink creation is blocked by EPERM. Harness Claude hooks are merged into existing .claude/settings.json instead of replacing unrelated settings.
Acceptance Checks
- RED: throwaway
HEADworktree with only the new sync-subagents tests failed for Claude settings preservation andEPERMmirror fallback. - GREEN:
bun run --cwd apps/cli test src/data/scripts/sync-subagents.test.ts. - GREEN:
bun run --cwd apps/cli test src/data/scripts/sync-subagents.test.ts src/scaffold/run.test.ts src/update/run.test.ts. - GREEN:
bun run --cwd apps/cli check-types. - GREEN:
bun run --cwd apps/cli check. - GREEN:
git diff --check.