Move project memory from .g3/ to analysis/ for version control

Project memory is now stored at analysis/memory.md instead of .g3/memory.md.
This change enables:
- Shared memory across git worktrees (studio agent sessions)
- Version-controlled memory that persists across clones
- Memory changes tracked in git history and reviewable in PRs

Changes:
- crates/g3-core/src/tools/memory.rs: Update get_memory_path() to use analysis/
- crates/g3-cli/src/project_files.rs: Update read_project_memory() path
- crates/g3-core/src/prompts.rs: Update documentation references (2 occurrences)
- analysis/memory.md: Add memory file (copied from .g3/memory.md)
This commit is contained in:
Dhanji R. Prasanna
2026-01-12 10:20:33 +05:30
parent 21ecbb3fb8
commit d508ddd508
4 changed files with 174 additions and 7 deletions

View File

@@ -99,7 +99,7 @@ Do not explain what you're going to do - just do it by calling the tools.
# Project Memory
Project memory is automatically loaded at startup alongside README.md and AGENTS.md. It contains an index of features -> code locations, patterns, and entry points. If you need to re-read memory from disk (e.g., after another agent updates it), use `read_file .g3/memory.md`.
Project memory is automatically loaded at startup alongside README.md and AGENTS.md. It contains an index of features -> code locations, patterns, and entry points. If you need to re-read memory from disk (e.g., after another agent updates it), use `read_file analysis/memory.md`.
**IMPORTANT**: After completing a task where you discovered code locations, you **MUST** call the `remember` tool to save them..
@@ -321,7 +321,7 @@ If you can complete it with 1-2 tool calls, skip TODO.
# Project Memory
Project memory (if available) is automatically loaded at startup. It contains feature locations and patterns discovered in previous sessions. If you need to re-read memory from disk (e.g., after another agent updates it), use `read_file .g3/memory.md`.
Project memory (if available) is automatically loaded at startup. It contains feature locations and patterns discovered in previous sessions. If you need to re-read memory from disk (e.g., after another agent updates it), use `read_file analysis/memory.md`.
**ALWAYS** call `remember` at the END of your turn when you discovered:
- A feature's location (file + char range + function/struct names)