Phase 4-A: Backend CLAUDE.md Memory Browser #50

Open
opened 2026-05-24 16:55:19 -05:00 by null · 0 comments
Owner

Source plan: /home/kaspa/.claude/plans/with-our-backend-created-precious-owl.md

Feature context: Feature 4: CLAUDE.md Memory Browser

Scope

Phase 4-A — Backend

Summary

Add GET /claude-code/projects/{encoded_project_dir}/memory that walks the project's working directory for CLAUDE.md files and returns their content.

Problem

Users lose track of what instructions are in their CLAUDE.md files across projects. Pipeline knows each project's working directory from session data but does not expose the memory files.

Affected area

  • Backend service: Claude Code reader
  • API: /claude-code

Affected files

  • backend/app/services/claude_code_reader.py — add get_project_memory_files() function
  • backend/app/api/claude_code.py — add new route
  • backend/app/schemas/claude_code.py — add MemoryFileRead, ProjectMemoryResponse schemas

Affected routes or endpoints

  • GET /api/v1/claude-code/projects/{project_dir}/memory
    • project_dir is URL-encoded project directory name (the ~/.claude/projects/ subdir name)

Expected behavior

  • Reads the cwd for the project from session data
  • Walks the cwd directory tree for files named CLAUDE.md (case-insensitive), up to 3 levels deep
  • Returns list of {relative_path, content, size_bytes, last_modified} objects
  • Also reads the global ~/.claude/CLAUDE.md if it exists and includes it as {relative_path: "~/.claude/CLAUDE.md", ...}
  • Returns empty list if project cwd is unknown or no CLAUDE.md files exist
  • File content truncated at 50 000 chars

Steps to reproduce (acceptance criteria)

  1. Call GET /api/v1/claude-code/projects/{any_project}/memory
  2. Returns at least the global ~/.claude/CLAUDE.md if it exists
  3. Returns project-level CLAUDE.md files if present
  4. Returns empty array (not 404) when no memory files found

Source plan: `/home/kaspa/.claude/plans/with-our-backend-created-precious-owl.md` Feature context: **Feature 4: CLAUDE.md Memory Browser** ## Scope ### Phase 4-A — Backend #### Summary Add `GET /claude-code/projects/{encoded_project_dir}/memory` that walks the project's working directory for `CLAUDE.md` files and returns their content. #### Problem Users lose track of what instructions are in their CLAUDE.md files across projects. Pipeline knows each project's working directory from session data but does not expose the memory files. #### Affected area - Backend service: Claude Code reader - API: `/claude-code` #### Affected files - `backend/app/services/claude_code_reader.py` — add `get_project_memory_files()` function - `backend/app/api/claude_code.py` — add new route - `backend/app/schemas/claude_code.py` — add `MemoryFileRead`, `ProjectMemoryResponse` schemas #### Affected routes or endpoints - `GET /api/v1/claude-code/projects/{project_dir}/memory` - `project_dir` is URL-encoded project directory name (the `~/.claude/projects/` subdir name) #### Expected behavior - Reads the `cwd` for the project from session data - Walks the `cwd` directory tree for files named `CLAUDE.md` (case-insensitive), up to 3 levels deep - Returns list of `{relative_path, content, size_bytes, last_modified}` objects - Also reads the global `~/.claude/CLAUDE.md` if it exists and includes it as `{relative_path: "~/.claude/CLAUDE.md", ...}` - Returns empty list if project `cwd` is unknown or no CLAUDE.md files exist - File content truncated at 50 000 chars #### Steps to reproduce (acceptance criteria) 1. Call `GET /api/v1/claude-code/projects/{any_project}/memory` 2. Returns at least the global `~/.claude/CLAUDE.md` if it exists 3. Returns project-level CLAUDE.md files if present 4. Returns empty array (not 404) when no memory files found ---
null changed title from 4-A: Backend to Phase 4-A: Backend CLAUDE.md Memory Browser 2026-05-24 16:56:10 -05:00
Sign in to join this conversation.
No description provided.