[BUG] EDITOR environment variable causes incorrect path parsing on Windows (.claude folder)

Resolved 💬 3 comments Opened Jan 18, 2026 by sabo961 Closed Jan 22, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

When the EDITOR environment variable is set on Windows, the claude watch memory command generates an incorrect file path, removing the backslash before the .claude folder name.

What Should Happen?

Should open: C:\Users\goran\.claude\CLAUDE.md

Error Messages/Logs

Error opening memory file: Error: Command failed: C:\Program Files\Notepad++\notepad++.exe "C:\Users\goranclaude\CLAUDE.md"

Steps to Reproduce

Set EDITOR environment variable:
powershell [System.Environment]::SetEnvironmentVariable('EDITOR', 'C:\Program Files\Notepad++\notepad++.exe', 'User')

Claude Model

Other

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.12

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

Windows Terminal

Additional Information

Root Cause Hypothesis
Likely a backslash escape character issue when parsing Windows paths containing folders with . prefix (common for hidden folders like .claude, .git, .vscode).

The backslash before .claude is being incorrectly stripped during string processing, possibly due to:

Improper escaping in string concatenation
Regex replacement treating \. as a special sequence
Path normalization that doesn't account for Windows path separators

Additional Notes
This issue specifically affects Windows paths with dot-prefixed folders. The CLI itself suggests setting the EDITOR environment variable for a better editing experience, but this triggers the bug.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗