Skip to content
This repository was archived by the owner on Sep 23, 2025. It is now read-only.

Commit 6f96114

Browse files
committed
Complete memory approaches documentation restructuring
Major organizational improvements: - Restructured memory approaches with consistent structure (README + prompts) - Added 'Tracking Task Status Explicitly' section covering GitHub issues and .ongoing files - Created 'AI Insights Comments' section for contextual memory in code - Enhanced retaining-context.md with collaborative partnership framing - Added 'Different audiences' section highlighting individual vs shared knowledge needs - Removed redundant 'Per-project prompts' section from SUMMARY.md - Updated all cross-references to new structure - Applied voice alignment principles throughout Key insights captured: - Different audiences need both individual and shared memory systems - Productive desynchronization as a feature (individual memory can drift from project) - Need for organizational systems that avoid overwhelming Claude or humans Documentation now provides clear navigation through memory experimentation approaches while maintaining focus on practical collaborative partnership goals.
1 parent c3b535b commit 6f96114

File tree

8 files changed

+99
-23
lines changed

8 files changed

+99
-23
lines changed

src/SUMMARY.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,21 @@
88
- [User prompt](./prompts/user/README.md)
99
- [main.md, the main prompt](./prompts/user/main.md)
1010
- [main.md v0, an older version](./prompts/user/main-v0.md)
11-
- [Per-project prompts](./prompts/project/README.md)
12-
- [AI Insight comments](./prompts/project/ai-insights.md)
13-
- [Github tracking issues](./prompts/project/github-tracking-issues.md)
14-
- [.ongoing files](./prompts/project/ongoing-work-tracking.md)
1511

1612
# Memory: Retaining context
1713

1814
- [Retaining context](./retaining-context.md)
15+
- [Tracking Task Status Explicitly](./tracking-task-status/README.md)
16+
- [GitHub Issues Prompt](./prompts/project/github-tracking-issues.md)
17+
- [.ongoing Files Prompt](./prompts/project/ongoing-work-tracking.md)
18+
- [AI Insights Comments](./ai-insights-comments/README.md)
19+
- [Prompt](./prompts/project/ai-insights.md)
1920
- [Official Memory Server](./official-memory-server/README.md)
21+
- [Prompt](./prompts/project/official-memory-server.md)
2022
- [Custom Memory Bank](./memory-bank/README.md)
2123
- [Design Foundation](./memory-bank/design-foundation.md)
2224
- [Current State](./memory-bank/current-state.md)
2325
- [Frequently asked questions](./memory-bank/faq.md)
24-
- [AI Insights Comments](./prompts/project/ai-insights.md)
2526

2627
# Dialectic
2728

src/ai-insights-comments/README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# AI Insights Comments
2+
3+
Contextual memory embedded directly in code using structured comment annotations.
4+
5+
## What It Provides
6+
- Non-obvious constraints and reasoning preserved in code
7+
- Context for future AI programming sessions
8+
- Decision boundaries and implementation tradeoffs
9+
- Algorithmic and architectural choices explained inline
10+
11+
## The Approach
12+
Rather than external memory systems, this approach embeds collaborative insights directly where they're most relevant - in the code itself. Using `💡` comment annotations, we capture the reasoning behind implementation choices that aren't obvious from reading the code alone.
13+
14+
This creates a form of contextual memory that travels with the code and provides immediate context when AI encounters it in future sessions.
15+
16+
## Custom Prompt Integration
17+
The [AI Insights prompt](../prompts/project/ai-insights.md) guides Claude to systematically add these annotations during code generation and modification, ensuring that important reasoning doesn't get lost between sessions.
18+
19+
## Status
20+
**Active experiment** - Testing whether inline contextual memory can reduce the need for external memory systems by preserving collaborative insights where they're most useful.

src/introduction.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
# Introduction
22

3-
This repository explores techniques for making use of Claude Code, Q CLI, and other similar AI assistants. The part of this repository that is currently actionable is the collection of [prompts that I have found useful][prompts]. These include [prompts meant to be installed user-wide][user-prompts] and [prompts that can be configured per-project][project-prompts].
4-
5-
[prompts]: https://github.com/nikomatsakis/socratic-shell/tree/main/prompts
3+
This repository explores techniques for making use of Claude Code, Q CLI, and other similar AI assistants. The part of this repository that is currently actionable is the collection of prompts that I have found useful. These include [prompts meant to be installed user-wide][user-prompts] and add-on prompts associated with [memory retention approaches][memory-approaches].
64

75
[user-prompts]: https://github.com/nikomatsakis/socratic-shell/tree/main/prompts/user
86

9-
[project-prompts]: https://github.com/nikomatsakis/socratic-shell/tree/main/prompts/project
7+
[memory-approaches]: ./retaining-context.md
108

119
The second part of this repository is source code towards an experimental memory system for retaining context across sessions more automatically. The memory system is designed as an MCP tool that integrates with the above prompts, using "hooks" to trigger memory operations.
1210

src/memory-bank/current-state.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
# Current State
22

3+
## Recent Progress
4+
5+
### Documentation Restructuring (July 2025)
6+
- **Memory approaches organization**: Restructured documentation to organize memory approaches with consistent structure (main README + associated prompts)
7+
- **Retaining context improvements**: Enhanced introduction with collaborative partnership framing, added "Different audiences" section highlighting individual vs. shared knowledge needs
8+
- **Navigation cleanup**: Removed redundant "Per-project prompts" section, updated all cross-references to new structure
9+
- **Voice alignment**: Applied "Niko voice" principles throughout - practical over theoretical, direct about challenges, experience-driven
10+
11+
### Key Insights Captured
12+
- **Different audiences need**: Recognition that memory systems must serve both individual collaboration history and shared project knowledge
13+
- **Productive desynchronization**: Individual memory can drift from project memory (e.g., out-of-date rustc knowledge) while still being useful
14+
- **Organizational systems**: Claude won't remember everything, so we need systems to pull context in on demand without overwhelming
15+
316
## Open Questions
417

518
### Technical Implementation

src/official-memory-server/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ External knowledge graph memory using the official MCP memory server from the Mo
1313
- **Language**: TypeScript/Node.js
1414
- **Status**: Active experiment
1515

16+
## Custom Prompt Integration
17+
Rather than using the memory server mechanically, we've fashioned a [custom prompt](../prompts/project/official-memory-server.md) that guides Claude to use it as an extension of presence-based collaboration. The prompt frames memory as "a living dimension of our relationship" that emerges naturally from consolidation moments, insight recognition, and checkpointing work.
18+
19+
This approach treats the external knowledge graph not as a database to fill but as a way to preserve the collaborative understanding that develops between human and AI over time.
20+
1621
## Integration Notes
1722
Testing how external knowledge graphs support:
1823
- Organic memory updates during consolidation moments
File renamed without changes.

src/retaining-context.md

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,44 @@
11
# Retaining Context
22

3-
Collaborative prompting works great until the context starts to run out or you end your session. Then you have to start all over again. I haven't found things like Claude Code's `/compact` command to be very effective, so I've been exploring alternatives.
3+
With collaborative prompting, you can build up good rapport with Claude - shared understanding, working patterns, and preferences for how to approach problems. But when you quit and return later, Claude has forgotten the specifics of what you were doing and details of what you like and don't like.
44

5-
## The Challenge: Multiple Types of Context
5+
## The Goal: Collaborative Partnership, Not Rigid Structure
66

7-
There are many different kinds of context to retain:
8-
- **Interaction preferences** - How you like to work with AI
9-
- **Project information** - Current state, goals, architecture decisions
7+
The aim isn't to create a complex memory system that forces AI into rigid patterns. Instead, we want to preserve the collaborative relationship while leveraging AI's natural strengths - the ability to collect, digest, and synthesize information organically.
8+
9+
Rather than cognitive overhead from complex structures, we want memory that supports the natural flow of collaborative work: consolidation moments, insight recognition, and the gradual deepening of shared understanding.
10+
11+
## Different Types of Context Need Different Approaches
12+
13+
Context retention isn't one problem but several:
14+
- **Interaction preferences** - How you like to work with AI. Sometimes a pattern is so broad that we extend the user prompt, but memory systems can be helpful for finer-grained details.
15+
- **Project information** - Current state, goals, architecture decisions.
1016
- **Shared code knowledge** - How things work that should benefit everyone
1117
- **Personal insights** - Your individual journey and understanding
1218

13-
## Current Approaches
19+
## Different audiences
1420

15-
### Explicit Context Management
16-
Claude and I maintain our context explicitly, either in [files for each ongoing task](./prompts/project/ongoing-work-tracking.md) or, more recently, through [AI-managed tracking issues on GitHub](./prompts/project/github-tracking-issues.md). When we come up with good new ideas or finish some phase of the work, I ask Claude to checkpoint our progress and they create commits and summarize our progress. Then we can always reload and figure out where we were.
21+
One of my key goals is to figure out how to fit Claude into existing project workflows, particularly open source workflows. I want to be able to retain *both* individual memory that is tailored to what *you* have done and to separate out general knowledge that can be useful to everyone. I believe that, just like humans, Claude won't be able to remember everything all of the time, so we need organizational systems that let us pull things in on demand and avoid overwhelming Claude (or the human!).
1722

18-
### Interaction Pattern Memory
19-
Tracking issues work pretty well for *tasks* but don't really capture changes to the *way* we interact. Right now, I've found that my [user prompt](./prompts/user/README.md) is a great start, though it helps to begin each fresh Claude session with "Hi again, Claude!", which triggers Claude to review the patterns with me. That creates a more spacious mood from the outset - not loading information, but setting the quality of attention we bring to the work.
23+
It's also useful sometimes for the memory of an individual to drift from the memory of the project -- for example, much of my memory about rustc is out-of-date when it comes to the particular project structure, but it'd still be useful for Claude to remember what we last saw and be updated with the latest version. Then it can advise me that something has changed since I last looked at it.
2024

21-
### Quote-Based Systems
22-
I admire the systems used by [Yehuda Katz][] and [Kari Wilhelm][], two fellow travelers in this journey, who have asked Claude to record salient quotes and insights during sessions into a file, then reload that file at startup to 'recreate the soul' of previous work. This is very appealing and something I want to try.
25+
## Current Approaches
26+
27+
### [Explicit Context Management](./tracking-task-status/README.md)
28+
To track the state of tasks, explicit context management seems to work pretty well. Claude and I maintain our context explicitly, either through [AI-managed tracking issues on GitHub](./tracking-task-status/README.md) or the older approach of [files for each ongoing task](./tracking-task-status/README.md). When we come up with good new ideas or finish some phase of the work, I ask Claude to checkpoint our progress and they create commits and summarize our progress. Then we can always reload and figure out where we were.
29+
30+
### [AI Insights Comments](./ai-insights-comments/README.md)
31+
[AI insights comments](./ai-insights-comments/README.md) retain knowledge directly in code that will be needed when later editing the code. Using `💡` comment annotations, we capture non-obvious constraints, reasoning, and implementation tradeoffs right where they're most relevant. This is an example of encoding memory for others to find in a natural way - the context travels with the code itself.
2332

2433
### MCP Memory Systems
25-
At the more sophisticated end of the spectrum are various MCP memory systems. I have been exploring this space - see [Memory Experimentation](./memory-experimentation.md) for details on the different approaches I'm testing, including an experimental custom memory bank and the official MCP memory server.
34+
At the more sophisticated end of the spectrum are various MCP memory systems. I have two ongoing experiments:
35+
36+
1. [Adapting the official MCP memory server](./official-memory-server/README.md) for use with collaborative prompting.
37+
2. Experimenting with building a [custom memory bank](./memory-bank/README.md) server.
2638

2739
## Status
2840

29-
This area is very much in flux. With so many existing solutions and the promising simplicity of the quote-based approaches, I may pivot to adapting existing work rather than building from scratch. The key insight is that different types of context may need different retention strategies.
41+
This area is very much in flux. The key insight is that different types of context may need different retention strategies.
3042

3143
[Yehuda Katz]: https://www.linkedin.com/in/yehudakatz/
3244
[Kari Wilhelm]: https://www.linkedin.com/in/kariwilhelm/

src/tracking-task-status/README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Tracking Task Status Explicitly
2+
3+
Using structured files and GitHub issues to maintain context across work sessions.
4+
5+
## What It Provides
6+
- Persistent task state that survives session boundaries
7+
- Clear scope definition for multi-session work
8+
- Progress tracking and session continuity
9+
- Natural integration with existing development workflows
10+
11+
## Two Approaches
12+
13+
### GitHub Issues (Current)
14+
Using GitHub issues as living documents with specific conventions. Each substantial feature gets a tracking issue where the Original Post maintains current status and comments capture session details.
15+
16+
### .ongoing Files (Legacy)
17+
File-based approach where each ongoing task gets a dedicated `.ongoing` file in the project directory to track progress and context.
18+
19+
## Key Benefits
20+
This explicit context management works well because both human and AI can reference and update the same structured information, providing reliable continuity across sessions without requiring specialized infrastructure.
21+
22+
## Custom Prompt Integration
23+
- [GitHub Issues prompt](../prompts/project/github-tracking-issues.md) - Current approach with detailed conventions
24+
- [.ongoing Files prompt](../prompts/project/ongoing-work-tracking.md) - Legacy file-based approach
25+
26+
## Status
27+
**Working approach** - Explicit task tracking has proven effective for maintaining context. The GitHub issues approach is currently preferred over the older file-based system.

0 commit comments

Comments
 (0)