Skip to content

fix: annotate-last fails on Windows with non-ASCII paths#340

Merged
backnotprop merged 1 commit into
mainfrom
fix/last-windows
Mar 19, 2026
Merged

fix: annotate-last fails on Windows with non-ASCII paths#340
backnotprop merged 1 commit into
mainfrom
fix/last-windows

Conversation

@backnotprop
Copy link
Copy Markdown
Owner

Summary

  • Aligns projectSlugFromCwd regex with Claude Code's actual normalization: [^a-zA-Z0-9-]- (was only replacing /)
  • Adds case-insensitive fallback for directory lookup to handle Windows drive letter casing (C: vs c:)
  • Adds tests for Windows backslashes, Cyrillic characters, underscores, spaces

Closes #339

Test plan

  • Pull on Windows machine with non-ASCII project path (e.g. Cyrillic) and run /plannotator-last
  • Verify session logs are found and last message renders in annotation UI
  • Test with underscore-containing paths
  • bun test apps/hook/server/session-log.test.ts passes (32/32)

Claude Code replaces all non-[a-zA-Z0-9-] characters with dashes when
deriving project slugs, but we only replaced forward slashes. This broke
annotate-last on Windows and with non-ASCII (e.g. Cyrillic) paths.

Also adds a case-insensitive fallback for directory lookup to handle
Windows drive letter casing differences (C: vs c:).

Closes #339

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@backnotprop
Copy link
Copy Markdown
Owner Author

Testing on Windows

Build from source (this PR)

# 1. Clone and checkout the branch
git clone https://github.com/backnotprop/plannotator.git
cd plannotator
git checkout fix/last-windows

# 2. Install deps and build the HTML assets
bun install
bun run build:hook

# 3. Compile the binary
bun build apps/hook/server/index.ts --compile --outfile plannotator.exe

# 4. Put it on PATH (or note the full path for step 5)
move plannotator.exe %USERPROFILE%\.local\bin\plannotator.exe

Use the local build instead of the marketplace install

Option A — --plugin-dir (uses the repo directly, no compile needed):

claude --plugin-dir ./apps/hook

Option B — Replace the compiled binary the marketplace plugin points to:

# Find where the current binary lives
where plannotator

# Replace it with the one you just built
copy /Y plannotator.exe <path-from-above>

What to test

  1. Open Claude Code in a project with non-ASCII path (e.g. C:\Users\alexey\Documents\1С_конфигурации\ERP_Medicine)
  2. Have at least one assistant response in the session
  3. Run /plannotator-last
  4. Verify the annotation UI opens with the last message
  5. Also test with underscore paths (e.g. my_project) and paths with spaces

@backnotprop backnotprop merged commit 5e940db into main Mar 19, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

annotate-last fails on Windows with non-ASCII (Cyrillic) project paths

1 participant