agentleFS
obraobra/private-journal-mcp/CLAUDE.md

private-journal-mcp

CLAUDE.md452 starsChanged 7 months agoMITView on GitHub

This is an MCP (Model Context Protocol) server that provides Claude with private journaling capabilities. The architecture consists of: Core Components: - src/index.ts - CLI entry point with intelligent path resolution for journal storage - src/server.ts - MCP server using stdio transport with private journaling and search tools - src/journal.ts - File system operations for timestamped markdown entries - src/types.ts - TypeScript interfaces for the domain model Key Architecture Patterns: - Path Resolution Strategy: PRIVATE_JOURNAL_PATH env var overrides all resolution;…

The file

We split this CLAUDE.md into the rules it gives an agent

1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Privacy First: All processing happens locally, no data leaves your machine

    line 73

≈ “Common” is an estimate: at least 1 in 5 of the 27,641 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

Common Development Commands

# Build the project
npm run build

# Run tests
npm test

# Run tests in watch mode
npm run test:watch

# Development mode with TypeScript watcher
npm run dev

# Lint the code
npm run lint

# Format the code
npm run format

# Start the server
npm start

# Run a single test file
npx jest tests/journal.test.ts

Architecture Overview

This is an MCP (Model Context Protocol) server that provides Claude with private journaling capabilities. The architecture consists of:

Core Components:

  • src/index.ts - CLI entry point with intelligent path resolution for journal storage
  • src/server.ts - MCP server using stdio transport with private journaling and search tools
  • src/journal.ts - File system operations for timestamped markdown entries
  • src/types.ts - TypeScript interfaces for the domain model

Key Architecture Patterns:

  • Path Resolution Strategy: PRIVATE_JOURNAL_PATH env var overrides all resolution; otherwise falls back through CWD → HOME → temp directories, avoiding system roots
  • Timestamped Storage: Uses YYYY-MM-DD/HH-MM-SS-μμμμμμ.md structure with microsecond precision
  • YAML Frontmatter: Each entry includes structured metadata (title, ISO date, Unix timestamp)
  • MCP Tool Pattern: Tool registration with schema validation and error handling

File Organization:

  • Project journals: .private-journal/ in project root for project-specific notes
  • Personal journals: ~/.private-journal/ for cross-project personal thoughts
  • Daily structure: YYYY-MM-DD/HH-MM-SS-μμμμμμ.md with microsecond precision
  • Search index: .embedding files alongside each journal entry for semantic search
  • TypeScript compilation to dist/ for production
  • Jest tests in tests/ directory with comprehensive file system mocking

MCP Integration Details

The server provides comprehensive journaling and search capabilities through these tools:

Core Journaling:

  • process_thoughts - Multi-section private journaling with categories for reflections, observations, project notes, user context, technical insights, and world knowledge

Search & Retrieval:

  • search_journal - Natural language semantic search across all journal entries using local AI embeddings
  • read_journal_entry - Read full content of specific entries by file path
  • list_recent_entries - Browse recent entries chronologically with date filtering

Key Features:

  • Dual Storage: Project notes stored locally with codebase, personal thoughts in user's home directory
  • Local AI Search: Uses @xenova/transformers for semantic understanding without external API calls
  • Automatic Indexing: Embeddings generated automatically for all entries on first startup and ongoing writes
  • Privacy First: All processing happens locally, no data leaves your machine

Testing Approach

  • Uses Jest with ts-jest preset and mocked transformers library for embedding tests
  • Tests cover file system operations, timestamp formatting, directory creation, and search functionality
  • Temporary directories created/cleaned for each test to ensure isolation
  • Coverage tracking for core functionality (src/journal.ts, src/types.ts, src/paths.ts, src/embeddings.ts, src/search.ts)
  • Comprehensive embedding and search test suite with proper mocking for CI/CD environments

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.