claude-diary  by rlancemartin

AI code assistant memory and learning system

Created 2 months ago
288 stars

Top 91.4% on SourcePulse

GitHubView on GitHub
Project Summary

Summary Claude Diary automates the creation and reflection of session diary entries for Claude Code, enhancing its long-term memory (CLAUDE.md). It continuously refines Claude's understanding of user preferences and workflows by learning from activity over time. This plugin targets Claude Code users seeking to improve their AI assistant's contextual awareness and learning capabilities.

How It Works This system automates Claude Code's long-term memory updates using a three-component approach: Observations, Reflection, and Retrieval. A /diary command or pre-compact.sh hook captures session context (conversation, tools, files) to generate markdown diary entries. These entries are then analyzed by a /reflect command, which identifies recurring patterns (2+ occurrences) and synthesizes insights across categories like PR feedback, preferences, and anti-patterns. The reflection process automatically updates CLAUDE.md with concise, imperative rules, creating a dynamic, learning memory.

Quick Start & Requirements Clone the repository (git clone https://github.com/rlancemartin/claude-diary). Install commands by copying commands/*.md to ~/.claude/commands/. Set up the pre-compact.sh hook by copying it to ~/.claude/hooks/, making it executable, and configuring it in ~/.claude/settings.json or via the /hooks command. Requires Claude Code and a bash environment.

Highlighted Details

  • Automated diary generation via pre-compact.sh hook or manual /diary command.
  • Reflection identifies patterns (2+ occurrences) and synthesizes insights across PR feedback, preferences, design decisions, anti-patterns, efficiency, and project-specific patterns.
  • CLAUDE.md is automatically updated with one-line, imperative rules.
  • Flexible /reflect command options support date ranges, projects, topics, and recent entries.

Maintenance & Community The README outlines future work but provides no specific details on active maintenance, notable contributors, sponsorships, or community channels (e.g., Discord/Slack).

Licensing & Compatibility Released under the MIT License, permitting free use, modification, and sharing, ensuring compatibility with commercial and closed-source applications.

Limitations & Caveats Current implementation relies on parsing JSONL transcripts, with a future session metadata API anticipated. Planned enhancements include project-level memory, adaptive reflection triggers, and proactive memory retrieval for contextual relevance.

Health Check
Last Commit

1 month ago

Responsiveness

Inactive

Pull Requests (30d)
1
Issues (30d)
1
Star History
61 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.