Top AI Repos — open-source AI, indexed and scored
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
A simple memory system for claude code
| Date | Stars |
|---|---|
| 2026-07-31 | 378 |
| 2026-08-06 | 379 |
Today
+1 stars today
This week
— stars this week
This month
— stars this month
Momentum
0.0
growth rate 0.00%/day
# Claude Diary
A long-term memory plugin for Claude Code that learns from your activity over time and continuously improves Claude's understanding of your preferences, patterns, and workflows.
- **Diary**: Generate a diary entry for any Claude Code session
- **Reflection**: Performs reflection across multiple diary entries
- **Memory**: Reflection updates your `CLAUDE.md` with observed patterns and preferences
Read more: [Blog post](https://rlancemartin.github.io/2025/12/01/claude_diary/)
<img width="951" height="667" alt="cd" src="https://github.com/user-attachments/assets/d0b1deef-b027-4014-b761-67e36c221edc" />
## Quickstart
1. **Clone this repository**:
```bash
git clone https://github.com/rlancemartin/claude-diary claude-diary
cd claude-diary
```
2. **Install commands**:
```bash
cp commands/*.md ~/.claude/commands/
```
3. **Install PreCompact hook** (for auto-diary generation):
```bash
mkdir -p ~/.claude/hooks
cp hooks/pre-compact.sh ~/.claude/hooks/pre-compact.sh
chmod +x ~/.claude/hooks/pre-compact.sh
```
4. **Configure the hook in settings**:
Add the following to `~/.claude/settings.json` (global) or `.claude/settings.local.json` (project-specific):
```json
{
"hooks": {
"PreCompact": [
{
"matcher": "auto",
"hooks": [
{
"type": "command",
"command": "bash ~/.claude/hooks/pre-compact.sh"
}
]
}
]
}
}
```
Alternatively, use the interactive command:
```bash
/hooks
```
Then select `PreCompact` event, `auto` matcher, and enter `bash ~/.claude/hooks/pre-compact.sh` as the command.
5. **Use the system**:
- Run `/diary` after important sessions (or let the PreCompact hook auto-generate)
- After any collection of diary entries, run `/reflect` to analyze patterns
- `CLAUDE.md` automatically updated with learnings
## Overview
`CLAUDE.md` files serve as [long-term memory](https://code.claude.com/docs/en/memory) for Claude Code. But, they are typically updated manually (e.g., via the `#` shortcut or `/memory` command). This plugin aims to automates the process of updating `CLAUDE.md` with the learnings from your activity over time. It is inspired by [an interview between Dan Shipper and Cat Wu / Boris Cherny from the Claude Code team](https://www.youtube.com/watch?v=IDSAMqip6ms&t=352s), which mentions that some Anthropic employees have started generating diary entries for Claude sessions and performing reflection over them. The approach follows that general flow, and also borrows ideas from the [Generative Agents paper](https://arxiv.org/pdf/2304.03442), which introduces a memory architecture with three key components:
1. **Observations**: Raw experiences recorded in natural language (like our diary entries)
2. **Reflection**: Higher-level insights and patterns (like our `/reflect` command)
3. **Retrieval**: Accessing memories to inform behavior (like reading CLAUDE.md into each session)
<img width="510" height="408" alt="Screenshot 2025-11-22 at 8 54 30 PM" src="https://github.com/user-attachments/assets/36c88072-9958-462e-b020-ad344445912a" />
### Diary Entries
The `/diary` command creates diary entries from the current session. It uses a context-first approach, reflecting on the conversation already in Claude Code's context, but can also parse JSONL transcripts, which are logged for each session to the project directory. See [diary.md](commands/diary.md) for details. The `diary` command can be run in two ways:
1. **Automatic**: PreCompact hook runs before conversation compacts (long sessions, 200+ messages). This could be customized to run at different points using different [Claude Code hooks](https://code.claude.com/docs/en/hooks-guide).
2. **Manual**: Run `/diary` anytime to capture important context in the current session
#### How the Diary Command Works
The command instructs Claude to create diary entries by reflecting on the conversatiExcerpt of 8,717 characters
Read on GitHubWould you bet a product on this? Bounded 0–100 and slow moving.
matched fp:cd38e47d5341fe8d, llm:Repository name and description: 'claude-diary' — 'A simple memory system for claude code' (memory system for Claude, an LLM). No topics provided. Likely a tool for memory management for chat/agents, relevant to RAG/agents or memory/agent systems.
matched fp:cd38e47d5341fe8d, llm:Repository name and description: 'claude-diary' — 'A simple memory system for claude code' (memory system for Claude, an LLM). No topics provided. Likely a tool for memory management for chat/agents, relevant to RAG/agents or memory/agent systems.