Summary
We should leverage altimate-code's Post hooks (e.g., PostToolCall, PostResponse) to automatically inject and refresh the auto-memory system, rather than relying solely on the LLM to decide when to read/write memory during conversation.
Motivation
Currently, memory read/write is entirely LLM-driven — the model decides when to check MEMORY.md, when to save new memories, and when to update stale ones. This has several failure modes:
- Stale context at conversation start — memory is only loaded when the LLM "thinks" to check it, which may be too late or not at all
- Missed save opportunities — the LLM may forget to persist important feedback or project context learned mid-conversation
- No refresh on external changes — if another session updates memory files, the current session won't pick up changes
Proposal
Use altimate-code's hook system to automate memory lifecycle:
1. PostResponse hook — Memory refresh/injection
- After each assistant response, a lightweight script scans for memory-worthy signals (user corrections, project facts, explicit "remember this" requests)
- Optionally re-reads
MEMORY.md index to catch cross-session updates
2. PostToolCall hook — Context-aware memory triggers
- After specific tool calls (e.g.,
git commit, Write to memory files), trigger validation or indexing
- Example: after a
Write to a memory file, auto-verify MEMORY.md index is updated
3. Session start hook — Warm memory load
- On
UserPromptSubmit (first message), pre-load relevant memories based on working directory, recent git activity, or explicit tags
Implementation Ideas
- Hook scripts in
.altimate-code/hooks/ as shell or Node scripts
- Could use
jq to parse hook event JSON and decide whether to act
- Memory refresh script: read
MEMORY.md, check file mtimes, surface stale entries
- Memory save script: parse assistant output for patterns like "I'll remember that" and verify the file was actually written
Acceptance Criteria
Labels
Enhancement, Developer Experience
Summary
We should leverage altimate-code's Post hooks (e.g.,
PostToolCall,PostResponse) to automatically inject and refresh the auto-memory system, rather than relying solely on the LLM to decide when to read/write memory during conversation.Motivation
Currently, memory read/write is entirely LLM-driven — the model decides when to check
MEMORY.md, when to save new memories, and when to update stale ones. This has several failure modes:Proposal
Use altimate-code's hook system to automate memory lifecycle:
1.
PostResponsehook — Memory refresh/injectionMEMORY.mdindex to catch cross-session updates2.
PostToolCallhook — Context-aware memory triggersgit commit,Writeto memory files), trigger validation or indexingWriteto a memory file, auto-verifyMEMORY.mdindex is updated3. Session start hook — Warm memory load
UserPromptSubmit(first message), pre-load relevant memories based on working directory, recent git activity, or explicit tagsImplementation Ideas
.altimate-code/hooks/as shell or Node scriptsjqto parse hook event JSON and decide whether to actMEMORY.md, check file mtimes, surface stale entriesAcceptance Criteria
PostResponsememory refresh hookPostToolCallmemory validation hookUserPromptSubmitLabels
Enhancement, Developer Experience