Skip to content

fix: add missing CLAUDE.md REST API routes in web server#445

Open
greasematic wants to merge 1 commit intowinfunc:mainfrom
greasematic:fix/claude-md-rest-api-routes
Open

fix: add missing CLAUDE.md REST API routes in web server#445
greasematic wants to merge 1 commit intowinfunc:mainfrom
greasematic:fix/claude-md-rest-api-routes

Conversation

@greasematic
Copy link

Summary

  • Adds three REST API route handlers in web_server.rs for CLAUDE.md file operations that were mapped in apiAdapter.ts but never implemented server-side
  • When Tauri invoke() fails (e.g., for projects in iCloud Drive paths with spaces/tildes), the frontend silently falls back to REST API mode — but the missing endpoints caused the fallback to also fail

Changes

src-tauri/src/web_server.rs — 3 new GET handlers + route registrations:

Route Handler Purpose
GET /api/claude-md?projectPath=... find_claude_md_files_handler List CLAUDE.md files in a project
GET /api/claude-md/read?filePath=... read_claude_md_file_handler Read a specific CLAUDE.md file
GET /api/claude-md/save?filePath=...&content=... save_claude_md_file_handler Save a CLAUDE.md file

The handlers call the existing pub async fn functions from commands::claude (no changes needed there). Follows the same pattern as all other endpoints in the file.

Fixes #444

Test plan

  • cargo check passes (CI will verify)
  • Open opcode with a project in an iCloud Drive path (spaces + tildes)
  • Verify "CLAUDE.md Memories" section loads successfully
  • Test reading and saving a CLAUDE.md file through the UI

🤖 Generated with Claude Code

When Tauri invoke fails (e.g., paths with spaces/special chars on iCloud
Drive), the frontend falls back to REST API mode. The CLAUDE.md endpoints
were mapped in apiAdapter.ts but had no corresponding handlers in
web_server.rs, causing the fallback to also fail with "Failed to load
CLAUDE.md files".

Adds three GET route handlers:
- /api/claude-md?projectPath=...  (find CLAUDE.md files)
- /api/claude-md/read?filePath=... (read a CLAUDE.md file)
- /api/claude-md/save?filePath=...&content=... (save a CLAUDE.md file)

Fixes winfunc#444

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

Failed to load CLAUDE.md files for projects in paths with spaces/special characters (iCloud Drive)

1 participant