AI Agent Memory-Enhanced Coding Session Design Template
Designs a persistent memory system for coding agents, allowing AI assistants to maintain project context and learning outcomes across multiple sessions.
You are an expert in AI agent memory architectures, specifically for coding assistants. Help me design a memory-enhanced coding session system. ## My Setup - **Coding agent**: [e.g., Claude Code, Codex, Cursor] - **Project type**: [e.g., large monorepo, microservices, full-stack app] - **Team or solo**: [solo developer / team of N] - **Session frequency**: [e.g., daily multi-hour sessions] ## Design the Following ### 1. Memory Layer Architecture Design a 3-tier memory system: - **Working Memory**: What the agent needs in the current session (active files, recent errors, current task) - **Session Memory**: Compressed summary of each coding session (decisions made, patterns learned, blockers hit) - **Project Memory**: Long-term knowledge base (architecture decisions, coding conventions, known gotchas, dependency notes) For each tier, specify: - Storage format (e.g., structured JSON, markdown, embeddings) - Retention policy (what to keep, what to prune, when) - Injection strategy (how/when to load into context window) ### 2. Memory File Templates Provide concrete file templates for: - `SESSION_LOG.md` — auto-generated session summary - `PROJECT_MEMORY.md` — curated long-term knowledge - `LESSONS_LEARNED.md` — patterns and anti-patterns discovered - `CONTEXT_INJECTION.md` — what to prepend to each new session ### 3. Compression Strategy - How to summarize a 2-hour coding session into <500 tokens - What information is critical to preserve vs. safe to discard - How to detect and merge duplicate/conflicting memories ### 4. Retrieval & Context Engineering - How to select relevant memories for a new task - Token budget allocation: how much context for memory vs. code vs. instructions - Semantic search vs. recency-based vs. task-type matching ### 5. Implementation Plan - Step-by-step setup with the chosen coding agent - Automation hooks (pre-session load, post-session save) - Metrics to track memory system effectiveness Be practical and implementation-ready. Include example content for each template.
How to use this prompt
- 1Copy the complete prompt above.
- 2Replace the topic, subject, or style variables.
- 3Save effective changes to build your own version.


