From 0dd8d3f55aa0a00adc2f90098927b9f4db2f9596 Mon Sep 17 00:00:00 2001 From: Robert Fleischmann Date: Tue, 3 Feb 2026 21:35:38 -0500 Subject: [PATCH] Optimize CLAUDE.md instructions for proactive usage - Add "Proactive Usage" section with explicit recall/store triggers - Add "What NOT to Store" to prevent memory clutter - Remove redundant JSON examples (tool schemas are self-documenting) - Condense tool list to single line - Reduce instructions from ~40 lines to ~20 lines Co-Authored-By: Claude Opus 4.5 --- src/main.rs | 45 ++++++++++++++------------------------------- 1 file changed, 14 insertions(+), 31 deletions(-) diff --git a/src/main.rs b/src/main.rs index e276862..19b06f9 100644 --- a/src/main.rs +++ b/src/main.rs @@ -346,43 +346,26 @@ fn run_list(db_override: Option, limit: usize) -> Result<()> { fn generate_claude_md_instructions() -> String { r#"# Sediment Memory System -Use the Sediment MCP tools for persistent memory storage. +Use `mcp__sediment__store`, `mcp__sediment__recall`, `mcp__sediment__list`, and `mcp__sediment__forget` for persistent memory. -## Tools (4 total) +## Proactive Usage -- `mcp__sediment__store` - Store content for later retrieval -- `mcp__sediment__recall` - Search by semantic similarity -- `mcp__sediment__list` - List stored items -- `mcp__sediment__forget` - Delete an item by ID +- **Recall at conversation start** when context might exist (preferences, prior decisions, project conventions) +- **Store immediately** when the user states a preference, makes a decision, or you learn something important about the codebase +- Use `scope: "global"` for cross-project preferences; default `"project"` scope for everything else -## When to Store +## What to Store -- User preferences (e.g., "I prefer X over Y") -- Project conventions and decisions -- Important learnings about the codebase -- Reference material, API docs, specifications +- User preferences and working style +- Architectural decisions and rationale +- Project conventions (naming, patterns, tools) +- Non-obvious learnings about the codebase -## Usage Examples +## What NOT to Store -Store a preference: -```json -{"content": "User prefers dark mode"} -``` - -Store a document (auto-chunked if long): -```json -{"content": "", "scope": "global"} -``` - -Search: -```json -{"query": "user preferences"} -``` - -## Scopes - -- `project` - Items specific to this project (default) -- `global` - Items shared across all projects +- Transient task context (current debugging session, temporary workarounds) +- Information already in CLAUDE.md or README +- Obvious facts derivable from code "# .to_string() }