MCP server that provides journaling capabilities for Claude Code
Project description
Claude Journal
An MCP (Model Context Protocol) server that provides journaling capabilities for Claude Code, allowing Claude to persist technical insights, failed approaches, architectural decisions, user preferences, and deferred work across conversations.
Overview
Claude Journal helps Claude remember important information across conversations by maintaining structured journal files.
Journals are stored in ~/.claude/journal/ as a git repository, providing backup, restore, and sync capabilities.
Features
- Per-project journals: Each project gets its own journal with a unique ID
- Global journal: For cross-project insights and user preferences
- Git integration: Automatic commits and optional remote sync
- Structured entries: Five entry types (insight, failure, decision, preference, todo)
- Powerful search: Search journals by content and type
Requirements
- Python 3.12 or later
- SQLite 3.9.0 or later (for FTS5 full-text search, bundled with Python 3.6+)
- Git (for journal version control and sync)
- uv (for installation)
Installation
uv tool install claude-journal
Add to Claude Code:
claude mcp add --scope user journal claude-journal
Setup
Initialize the journal repository:
claude-journal init
This creates ~/.claude/journal/ as a git repository with a global/journal.md file.
For remote backup (optional):
claude-journal init --remote git@github.com:username/claude-journals.git
Configuring Claude Code
To make Claude use the journal effectively, add instructions to your ~/.claude/CLAUDE.md:
## Learning and Memory Management
- YOU MUST use the journal tool frequently to capture technical insights, failed approaches, and user preferences
- Before starting complex tasks, search the journal for relevant past experiences and lessons learned
- Document architectural decisions and their outcomes for future reference
- Track patterns in user feedback to improve collaboration over time
- When you notice something that should be fixed but is unrelated to your current task, document it in your journal
rather than fixing it immediately
- You MAY include secrets in your journal entries, but you MUST redact actual secret values. Replace secret value with
[REDACTED] or a similar placeholder.
You can also add project-specific journal instructions in <project>/.claude/CLAUDE.md if needed.
How It Works
Project Identification
On first journal write in a project, Claude Journal:
- Generates a unique 8-character hex ID
- Creates
.claude/journal.jsonin your project with this ID - Creates
~/.claude/journal/<id>/journal.md
Subsequent writes in that project use the same ID, even if you rename the directory.
Entry Types
insight- Technical insights about code/architecturefailure- Failed approaches to avoid retryingdecision- Architectural decisions and reasoningpreference- User preferences and working styletodo- Deferred work items
Entry Format
Entries are stored in markdown format:
## [2025-10-06T14:23:45Z] insight
Content goes here.
Multiple lines supported.
---
Each journal directory includes a journal.db SQLite database with an FTS5 (Full-Text Search) index for fast searching. The index is automatically created and updated as entries are written, and automatically rebuilt if the markdown file is modified outside the tool.
Usage
Claude uses the journal tools automatically when configured. You don't need to invoke them manually.
Writing Entries
When Claude learns something important, it writes to the journal:
[Claude internally uses JournalWrite tool]
type: "decision"
scope: "project"
content: "Chose PostgreSQL over SQLite for multi-user support..."
Searching
When Claude needs to recall information:
[Claude internally uses JournalSearch tool]
query: "authentication"
scope: "project"
Git Integration
All journal operations include git commits:
- Before read operations: Pulls from remote (if configured)
- After write operations: Commits locally, pushes to remote (if configured)
- Commit messages:
[scope] type: brief summary
If git operations fail (network issues, conflicts), the journal operation still succeeds locally and returns a warning.
MCP Tools
Claude Journal provides two MCP tools:
JournalWrite
Parameters:
content(string, required) - The journal entry contenttype(enum, required) - One of: insight, failure, decision, preference, todoscope(enum, optional, default: project) - One of: global, project
JournalSearch
Parameters:
query(string, required) - FTS5 full-text search query (supports phrases in quotes, AND/OR/NOT operators, prefix matching with *)scope(enum, optional, default: both) - One of: global, project, bothtype(enum, optional) - Filter by entry type if specified
Directory Structure
~/.claude/journal/ # Git repository
├── .git/
├── global/
│ ├── journal.md # Global journal
│ └── journal.db # SQLite FTS5 search index
└── <project-id>/
├── journal.md # Per-project journal
└── journal.db # SQLite FTS5 search index
<your-project>/.claude/
└── journal.json # {"id": "a3f8b2c9"}
Troubleshooting
Journal directory missing after project ID exists
If .claude/journal.json exists but the journal directory is missing from ~/.claude/journal/<id>/:
- Check if journals repo needs restore:
cd ~/.claude/journal && git status - Pull from remote:
git pull - If journal was lost, the ID will be regenerated on next write
Git conflicts
If you sync journals across machines and encounter conflicts:
cd ~/.claude/journal
git status
# Resolve conflicts manually
git add .
git commit
Remote push failures
Push failures don't prevent journal writes. The entry is saved locally and will be pushed on the next successful operation.
Development
Running tests
make test
Linting, formatting, type checking
make lint
License
This is free and unencumbered software released into the public domain. See the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file claude_journal-0.0.4.tar.gz.
File metadata
- Download URL: claude_journal-0.0.4.tar.gz
- Upload date:
- Size: 11.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bb55db8c89a6cddfe26299fd322c072cb32d69ba4ecf272eac0fbd03b91f7453
|
|
| MD5 |
4831140785438ab32940a109109bdad9
|
|
| BLAKE2b-256 |
c9075e9be98aa5a8858377fe0f62010790f47eb7cd59d4f3a5c2ee5d5470c9ce
|
Provenance
The following attestation bundles were made for claude_journal-0.0.4.tar.gz:
Publisher:
build.yml on Ch00k/claude-journal
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
claude_journal-0.0.4.tar.gz -
Subject digest:
bb55db8c89a6cddfe26299fd322c072cb32d69ba4ecf272eac0fbd03b91f7453 - Sigstore transparency entry: 597015146
- Sigstore integration time:
-
Permalink:
Ch00k/claude-journal@7b0166656e11c34718cff851dffe08fa39be6f44 -
Branch / Tag:
refs/tags/0.0.4 - Owner: https://github.com/Ch00k
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build.yml@7b0166656e11c34718cff851dffe08fa39be6f44 -
Trigger Event:
push
-
Statement type:
File details
Details for the file claude_journal-0.0.4-py3-none-any.whl.
File metadata
- Download URL: claude_journal-0.0.4-py3-none-any.whl
- Upload date:
- Size: 13.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0578816d71242221db100d3596a25885959a4df5fa7d5130b1a842ae8a8a705d
|
|
| MD5 |
46f6d85343cda15583e4c68513e0ee9c
|
|
| BLAKE2b-256 |
6df5cd2b3377aad5d61f45dd786f9e7789ac9bc815187ba05f1c9e86d0f75be8
|
Provenance
The following attestation bundles were made for claude_journal-0.0.4-py3-none-any.whl:
Publisher:
build.yml on Ch00k/claude-journal
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
claude_journal-0.0.4-py3-none-any.whl -
Subject digest:
0578816d71242221db100d3596a25885959a4df5fa7d5130b1a842ae8a8a705d - Sigstore transparency entry: 597015153
- Sigstore integration time:
-
Permalink:
Ch00k/claude-journal@7b0166656e11c34718cff851dffe08fa39be6f44 -
Branch / Tag:
refs/tags/0.0.4 - Owner: https://github.com/Ch00k
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build.yml@7b0166656e11c34718cff851dffe08fa39be6f44 -
Trigger Event:
push
-
Statement type: