Task: revdiff plugin Windows launcher (PowerShell + WezTerm)
Description
Port the Claude Code revdiff plugin's bash launcher to PowerShell so it works on Windows + WezTerm. The existing launch-revdiff.sh is ~290 lines covering tmux, kitty, wezterm, cmux, ghostty, iTerm2, and emacs vterm. The Windows port targets only WezTerm via wezterm cli spawn --new-tab. Add a detect-ref.ps1 sibling for the existing detect-ref.sh helper. Update the SKILL.md so the loader picks .ps1 on Windows.
Acceptance Criteria
Technical Details
Files to create
.claude-plugin/skills/revdiff/scripts/launch-revdiff.ps1 — ~150 lines.
.claude-plugin/skills/revdiff/scripts/detect-ref.ps1 — ~50 lines.
Files to modify
.claude-plugin/skills/revdiff/SKILL.md — add a small platform dispatch block (~5–10 lines). Use $IsWindows (PowerShell 6+) with a fallback to [System.Environment]::OSVersion.Platform -eq 'Win32NT' for Windows PowerShell 5.1 if the harness might invoke it that way.
Files to read (do not modify)
.claude-plugin/skills/revdiff/scripts/launch-revdiff.sh — read top-to-bottom. Identify:
- The full argument signature (positional + flag).
- The WezTerm code path (somewhere around line 84 per the audit) — port that logic.
- The exit code conventions and stdout/stderr expectations.
- The env vars Claude passes in (
CLAUDE_PROJECT_DIR, annotation file path, etc.).
.claude-plugin/skills/revdiff/scripts/detect-ref.sh — read fully, port the git-detection logic line-for-line into PowerShell using & git ... and $LASTEXITCODE.
.claude-plugin/skills/revdiff/SKILL.md — read the existing loader/dispatch section to understand where the platform branch goes.
WezTerm spawn pattern
$wezArgs = @('cli', 'spawn', '--new-tab', '--')
$wezArgs += 'revdiff.exe'
$wezArgs += $forwardedArgs
$paneId = & wezterm @wezArgs
if ($LASTEXITCODE -ne 0) { throw "wezterm cli spawn failed: $LASTEXITCODE" }
After spawning, poll for the pane to exit using wezterm cli list --format json or wait on a sentinel file the spawned process touches when it exits. The bash script's wait pattern is the reference; mirror its semantics, not its mechanism.
detect-ref.ps1 sketch
# detect-ref.ps1 — Windows port of detect-ref.sh.
# Output format MUST match the bash version exactly so callers parse it identically.
Set-StrictMode -Version Latest
$ErrorActionPreference = 'Stop'
$inGit = & git rev-parse --is-inside-work-tree 2>$null
if ($LASTEXITCODE -ne 0) { Write-Output 'no-git'; exit 0 }
# ... mirror the rest of detect-ref.sh's logic via & git symbolic-ref / show-ref / status --porcelain
Notes
- The audit found the bash launcher uses
osascript, emacsclient, tmux, kitty @, wezterm cli, etc. Do not port any of those to PowerShell — only port the WezTerm path.
- If the bash script exposes options like
--no-tab or --window for non-WezTerm terminals, do not implement them in the PowerShell version. Document the omission in the header comment.
- Per CLAUDE.md, after this task lands the plugin version should be bumped — but the bump itself is deferred to task 006 so it covers task 004 as well.
- PowerShell argument forwarding gotcha: when calling external programs, use the call operator
& with an array (@($arg1, $arg2)) rather than a single string. String interpolation invites injection if a ref name contains spaces or quotes.
Audit references
.claude-plugin/skills/revdiff/scripts/launch-revdiff.sh:1 — bash shebang
.claude-plugin/skills/revdiff/scripts/launch-revdiff.sh:84 — WezTerm overlay path (approximate)
.claude-plugin/skills/revdiff/scripts/launch-revdiff.sh:17,64,93,112,115,150,153,203,279,284 — mktemp /tmp/... calls to replace
.claude-plugin/skills/revdiff/scripts/detect-ref.sh:1–61 — full file to port
Dependencies
- None for creation — can start in parallel with task 001.
- For validation, requires task 001 (so
revdiff.exe exists and resolves config paths correctly) and task 002 (so the local build is reproducible).
- Validation in task 006 requires this task to be complete.
Effort Estimate
- Size: M
- Scope: ~150 lines of PowerShell across 2 files + a small SKILL.md edit. The bash original is 290+ lines but ~60% is non-WezTerm terminal handlers we are explicitly not porting.
Definition of Done
Task: revdiff plugin Windows launcher (PowerShell + WezTerm)
Description
Port the Claude Code
revdiffplugin's bash launcher to PowerShell so it works on Windows + WezTerm. The existinglaunch-revdiff.shis ~290 lines covering tmux, kitty, wezterm, cmux, ghostty, iTerm2, and emacs vterm. The Windows port targets only WezTerm viawezterm cli spawn --new-tab. Add adetect-ref.ps1sibling for the existingdetect-ref.shhelper. Update the SKILL.md so the loader picks.ps1on Windows.Acceptance Criteria
.claude-plugin/skills/revdiff/scripts/launch-revdiff.ps1created..claude-plugin/skills/revdiff/scripts/detect-ref.ps1created with output format byte-identical todetect-ref.sh..claude-plugin/skills/revdiff/scripts/launch-revdiff.shis byte-identical to master — no edits..claude-plugin/skills/revdiff/scripts/detect-ref.shis byte-identical to master — no edits..claude-plugin/skills/revdiff/SKILL.mdincludes a platform dispatch: on Windows it invokeslaunch-revdiff.ps1, elsewhere it invokeslaunch-revdiff.sh.launch-revdiff.ps1accepts the same argumentslaunch-revdiff.shaccepts (ref,--staged, annotation file path, etc.) and forwards them torevdiff.exe.launch-revdiff.ps1spawns revdiff viawezterm cli spawn --new-tab -- revdiff.exe <args>so the new tab lives in the same WezTerm window as the parent Claude session.wezterm cli spawn's stdout and waits for the spawned tab to exit before returning.$env:TEMP(viaNew-TemporaryFileor[IO.Path]::GetTempFileName) — no/tmp/...literals.Test-Path) orWait-Job— notmkfifo(named pipes work differently on Windows and aren't worth the complexity).try { } finally { }cleanup blocks guarantee temp files and pane references are released even on revdiff crash.Set-StrictMode -Version Latestand$ErrorActionPreference = 'Stop'at the top.wezterm cli spawnis properly quoted to avoid injection (use the array form, not string interpolation).launch-revdiff.shis unchanged — verify by running the bash script on macOS after the SKILL.md edit.Technical Details
Files to create
.claude-plugin/skills/revdiff/scripts/launch-revdiff.ps1— ~150 lines..claude-plugin/skills/revdiff/scripts/detect-ref.ps1— ~50 lines.Files to modify
.claude-plugin/skills/revdiff/SKILL.md— add a small platform dispatch block (~5–10 lines). Use$IsWindows(PowerShell 6+) with a fallback to[System.Environment]::OSVersion.Platform -eq 'Win32NT'for Windows PowerShell 5.1 if the harness might invoke it that way.Files to read (do not modify)
.claude-plugin/skills/revdiff/scripts/launch-revdiff.sh— read top-to-bottom. Identify:CLAUDE_PROJECT_DIR, annotation file path, etc.)..claude-plugin/skills/revdiff/scripts/detect-ref.sh— read fully, port the git-detection logic line-for-line into PowerShell using& git ...and$LASTEXITCODE..claude-plugin/skills/revdiff/SKILL.md— read the existing loader/dispatch section to understand where the platform branch goes.WezTerm spawn pattern
After spawning, poll for the pane to exit using
wezterm cli list --format jsonor wait on a sentinel file the spawned process touches when it exits. The bash script's wait pattern is the reference; mirror its semantics, not its mechanism.detect-ref.ps1 sketch
Notes
osascript,emacsclient,tmux,kitty @,wezterm cli, etc. Do not port any of those to PowerShell — only port the WezTerm path.--no-tabor--windowfor non-WezTerm terminals, do not implement them in the PowerShell version. Document the omission in the header comment.&with an array (@($arg1, $arg2)) rather than a single string. String interpolation invites injection if a ref name contains spaces or quotes.Audit references
.claude-plugin/skills/revdiff/scripts/launch-revdiff.sh:1— bash shebang.claude-plugin/skills/revdiff/scripts/launch-revdiff.sh:84— WezTerm overlay path (approximate).claude-plugin/skills/revdiff/scripts/launch-revdiff.sh:17,64,93,112,115,150,153,203,279,284—mktemp /tmp/...calls to replace.claude-plugin/skills/revdiff/scripts/detect-ref.sh:1–61— full file to portDependencies
revdiff.exeexists and resolves config paths correctly) and task 002 (so the local build is reproducible).Effort Estimate
Definition of Done
launch-revdiff.ps1anddetect-ref.ps1created