Skip to main content

codecov   PyPI - Version

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:

  1. Generates a unique 8-character hex ID
  2. Creates .claude/journal.json in your project with this ID
  3. 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/architecture
  • failure - Failed approaches to avoid retrying
  • decision - Architectural decisions and reasoning
  • preference - User preferences and working style
  • todo - 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 content
  • type (enum, required) - One of: insight, failure, decision, preference, todo
  • scope (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, both
  • type (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>/:

  1. Check if journals repo needs restore: cd ~/.claude/journal && git status
  2. Pull from remote: git pull
  3. 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.

Metadata

Release files for claude-journal 0.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for claude-journal 0.0.4
File Size Uploaded Provenance Actions
claude_journal-0.0.4.tar.gz 11.0 kB With provenance Details for claude_journal-0.0.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for claude-journal 0.0.4
File Interpreter ABI Platform Actions
claude_journal-0.0.4-py3-none-any.whl Python 3 none any Details for claude_journal-0.0.4-py3-none-any.whl

Total release size: 24.3 kB

Release files / claude_journal-0.0.4.tar.gz

Download URL claude_journal-0.0.4.tar.gz
Size 11.0 kB
Tags Source
SHA-256 checksum
How to use checksums
bb55db8c89a6cddfe26299fd322c072cb32d69ba4ecf272eac0fbd03b91f7453
BLAKE2b-256 checksum
How to use checksums
c9075e9be98aa5a8858377fe0f62010790f47eb7cd59d4f3a5c2ee5d5470c9ce
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 9, 2025.

Transparency log

Release files / claude_journal-0.0.4-py3-none-any.whl

Download URL claude_journal-0.0.4-py3-none-any.whl
Size 13.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0578816d71242221db100d3596a25885959a4df5fa7d5130b1a842ae8a8a705d
BLAKE2b-256 checksum
How to use checksums
6df5cd2b3377aad5d61f45dd786f9e7789ac9bc815187ba05f1c9e86d0f75be8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 9, 2025.

Transparency log

Security for claude-journal 0.0.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for claude_journal-0.0.4.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 9, 2025.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page