Bug Description
When a system username contains an underscore (e.g. michal_mikes), opcode reconstructs project paths incorrectly, causing "Failed to send prompt" on every prompt submission in the Projects view.
Root Cause
Claude CLI encodes project paths into directory names under ~/.claude/projects/ by replacing both / and _ with -. For example:
/home/michal_mikes/projects → -home-michal-mikes-projects
When opcode reads this directory name and reconstructs the original path, it only performs the reverse of / → -, yielding:
-home-michal-mikes-projects → /home/michal/mikes/projects ❌
The underscore in the username is lost, producing a path that does not exist on disk. Claude CLI then fails to start because the working directory is invalid, and opcode surfaces this as "Failed to send prompt".
The correct path should be /home/michal_mikes/projects ✅
Steps to Reproduce
- Use a Linux/macOS system where the username contains an underscore (e.g.
john_doe)
- Open opcode and navigate to the Projects tab
- Select any project
- Type any prompt and press Enter
Result: "Failed to send prompt" error immediately.
Workaround
Manually fix the corrupted projectPath values in opcode's localStorage SQLite database:
~/.local/share/opcode.asterisk.so/localstorage/tauri_localhost_0.localstorage
Values are UTF-16LE encoded JSON. Replace occurrences of /home/john/doe/ with /home/john_doe/ in the projectPath fields.
Expected Behavior
The path reconstruction from the Claude project directory name should either:
- Read the
cwd field directly from the session .jsonl files inside the project directory (which contain the correct original path), or
- Use a reversible encoding that distinguishes
/ from _ (e.g. encode only / as - and leave _ as-is, or use a different separator)
Environment
- OS: Ubuntu 22.04 LTS
- opcode version: 0.2.0
- Claude Code version: 2.1.139
- Username: contains underscore
Related Issues
Bug Description
When a system username contains an underscore (e.g.
michal_mikes), opcode reconstructs project paths incorrectly, causing "Failed to send prompt" on every prompt submission in the Projects view.Root Cause
Claude CLI encodes project paths into directory names under
~/.claude/projects/by replacing both/and_with-. For example:When opcode reads this directory name and reconstructs the original path, it only performs the reverse of
/→-, yielding:The underscore in the username is lost, producing a path that does not exist on disk. Claude CLI then fails to start because the working directory is invalid, and opcode surfaces this as "Failed to send prompt".
The correct path should be
/home/michal_mikes/projects✅Steps to Reproduce
john_doe)Result: "Failed to send prompt" error immediately.
Workaround
Manually fix the corrupted
projectPathvalues in opcode's localStorage SQLite database:Values are UTF-16LE encoded JSON. Replace occurrences of
/home/john/doe/with/home/john_doe/in theprojectPathfields.Expected Behavior
The path reconstruction from the Claude project directory name should either:
cwdfield directly from the session.jsonlfiles inside the project directory (which contain the correct original path), or/from_(e.g. encode only/as-and leave_as-is, or use a different separator)Environment
Related Issues