Skip to content

feat(mcp-configs): add longhand for lossless Claude Code session history#1503

Closed
Wynelson94 wants to merge 2 commits into
affaan-m:mainfrom
Wynelson94:feat/add-longhand-mcp
Closed

feat(mcp-configs): add longhand for lossless Claude Code session history#1503
Wynelson94 wants to merge 2 commits into
affaan-m:mainfrom
Wynelson94:feat/add-longhand-mcp

Conversation

@Wynelson94

@Wynelson94 Wynelson94 commented Apr 20, 2026

Copy link
Copy Markdown

What this does

Adds longhand as a third memory option in mcp-configs/mcp-servers.json, alongside the existing memory (@modelcontextprotocol/server-memory) and omega-memory entries.

Why

The two existing memory servers store synthesized memory — an assistant chooses what to record, structures it into a knowledge graph, and the record is a summarization of past interactions.

Longhand solves a different problem: lossless capture of what Claude Code already writes to disk. Claude Code writes every session to ~/.claude/projects/*.jsonl (tool calls, file edits, thinking blocks, all verbatim). Claude Code rotates these files after a few weeks; Longhand indexes them into local SQLite + ChromaDB before they're gone and exposes 17 tools for fuzzy recall across the full session history.

Use cases memory and omega-memory don't cover:

  • "Show me the exact edit I made to auth.ts three weeks ago"
  • "Find the webhook fix from that session with the stripe bug"
  • "Replay the file state when I committed abc123"
  • "What did we decide about X, three projects back"

Raw session records, not synthesized memory. Complement, not replacement.

Differentiation

Server Stores Best for
memory Knowledge graph Cross-session structured facts the assistant curates
omega-memory Semantic + multi-agent Richer knowledge graph with search
longhand Raw Claude Code session logs Forensic recall — "what did I actually do" over months of history

Unvetted-package check

Per CONTRIBUTING.md's skill adaptation policy ("do not ship a skill whose main value is telling users to install an unvetted package"):

  • MIT licensed
  • Published on PyPI as longhand (currently v0.5.11)
  • Official MCP Registry listing (io.github.Wynelson94/longhand)
  • PulseMCP-listed, feat(skills): add openclaw-user-profiler skill #852 weekly rank in the MCP ecosystem
  • Glama A/A/A tier (security / license / quality)
  • 171 passing unit tests, security-audited with zero critical findings
  • 354 unique cloners in the first 14 days since first public release

Write-up: https://dev.to/wynelson94/why-i-built-a-lossless-alternative-to-ai-memory-summarization-40cl

Context-window footprint

The _comments.context_warning notes: "Keep under 10 MCPs enabled to preserve context window." Longhand is designed with token budget in mind — a full recall call across 100+ sessions returns ~4K tokens (smaller than reading a single raw JSONL would cost). Token budget is an explicit README section.

How to enable

"longhand": {
  "command": "longhand",
  "args": ["mcp-server"],
  "description": "..."
}

Setup: pip install longhand && longhand setup — ingests existing ~/.claude/projects/ history and installs the auto-ingest hook so new sessions are captured on close.

Happy to adjust the description or placement. Thanks for maintaining this.


Summary by cubic

Add longhand as a third memory option in mcp-configs/mcp-servers.json for lossless Claude Code session history. It indexes raw ~/.claude/projects/*.jsonl into local SQLite + ChromaDB, complements @modelcontextprotocol/server-memory and omega-memory, and the config description is now one line for consistency.

  • New Features

    • Added longhand entry with command: "longhand" and args: ["mcp-server"].
    • Enables exact recall of tool calls, file edits, and thinking blocks without external APIs.
  • Migration

    • Install and ingest history: pip install longhand && longhand setup.

Written for commit 29b5ca0. Summary will update on new commits.

Summary by CodeRabbit

  • New Features

    • Added a "longhand" MCP server option that locally indexes session artifacts and provides verbatim recall alongside existing synthesized memory, backed by local databases for quicker, persistent access.
  • Chores

    • Added new MCP server configuration entry, expanding available server options.

Adds longhand as a third memory option alongside the existing memory
(@modelcontextprotocol/server-memory) and omega-memory entries.

The existing two store synthesized memory — an assistant chooses what
to record and structures it into graphs. Longhand solves a different
problem: lossless capture of what Claude Code already writes to
~/.claude/projects/*.jsonl (tool calls, file edits, thinking blocks).
Claude Code rotates those files after a few weeks; Longhand indexes
them into local SQLite + ChromaDB before they're gone.

Use cases the synthesized-memory servers don't cover:
- "Show me the exact edit I made to auth.ts three weeks ago"
- "Find the webhook fix from that session with the stripe bug"
- "Replay the file state when I committed abc123"

Complement, not replacement.

Per CONTRIBUTING.md's unvetted-package guidance:
- MIT licensed, published on PyPI as `longhand`
- Official MCP Registry listing (io.github.Wynelson94/longhand)
- PulseMCP-listed, Glama A/A/A tier (security, license, quality)
- 171 passing unit tests, security-audited with zero critical findings

Context-window footprint: a full `recall` returns ~4K tokens
(smaller than reading a single raw JSONL), consistent with the
context_warning note in _comments.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Apr 20, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

A new MCP server configuration entry longhand was added to mcp-configs/mcp-servers.json, specifying the command, arguments, and a description for indexing raw Claude Code session artifacts into local SQLite and ChromaDB stores.

Changes

Cohort / File(s) Summary
MCP Server Configuration
mcp-configs/mcp-servers.json
Added new longhand entry to mcpServers with command: "longhand", args: ["mcp-server"], and a description outlining indexing of ~/.claude/projects/*.jsonl into local SQLite + ChromaDB as verbatim recall alongside synthesized memory.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 I hopped to the config, ears held high,
A new friend named Longhand now rides by,
It catalogs sessions with a quiet cheer,
SQLite and Chroma keep memories near,
A tiny thump for changes made clear. 🥕

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: adding a new MCP server configuration entry called 'longhand' for capturing Claude Code session history losslessly.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@greptile-apps

greptile-apps Bot commented Apr 20, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds longhand as a third memory-type MCP server entry in mcp-configs/mcp-servers.json, complementing the existing memory and omega-memory entries with verbatim, lossless recall of Claude Code session logs stored in ~/.claude/projects/*.jsonl. The two main concerns — using "command": "longhand" (rather than uvx) and the extra-long description with embedded install instructions — were raised in prior review threads and are the only open items.

Confidence Score: 5/5

Safe to merge once the two previously-flagged style items (command invocation pattern and description length) are resolved by the author.

No new P0 or P1 issues were found. The uvx invocation pattern and description verbosity were already surfaced in prior review threads. The entry itself is structurally valid JSON, does not introduce credentials or env-var placeholders that would break other tooling, and the described package is local-only with no outbound network calls. All remaining concerns are P2 style/convention items.

mcp-configs/mcp-servers.json — specifically the command field and description length of the longhand entry.

Important Files Changed

Filename Overview
mcp-configs/mcp-servers.json Adds longhand MCP entry for lossless session history indexing; uses bare command: "longhand" instead of uvx (unlike omega-memory), and carries the longest description in the file including install instructions — both already flagged in previous review threads.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["Claude Code session ends"] -->|"writes verbatim log"| B["~/.claude/projects/*.jsonl"]
    B -->|"auto-ingest hook"| C["longhand MCP server"]
    C -->|"indexes into"| D["Local SQLite"]
    C -->|"indexes into"| E["Local ChromaDB"]
    D & E -->|"17 MCP tools exposed"| F["Claude Code (recall, replay, search)"]
    B -->|"rotated after weeks"| G["Lost without longhand"]
    style G fill:#f88,stroke:#c00
Loading

Reviews (2): Last reviewed commit: "docs(mcp-configs): tighten longhand desc..." | Re-trigger Greptile

Comment thread mcp-configs/mcp-servers.json
Comment thread mcp-configs/mcp-servers.json Outdated

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 1 file

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="mcp-configs/mcp-servers.json">

<violation number="1" location="mcp-configs/mcp-servers.json:45">
P1: Use `uvx` instead of bare `longhand` command to match the convention for Python-based MCP servers in this file. `"command": "longhand"` will silently fail for any user who hasn't already run `pip install longhand` globally — `uvx` resolves and runs the PyPI package on demand without that prerequisite, consistent with how `omega-memory` is configured.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Comment on lines +45 to +46
"command": "longhand",
"args": ["mcp-server"],

@cubic-dev-ai cubic-dev-ai Bot Apr 20, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1: Use uvx instead of bare longhand command to match the convention for Python-based MCP servers in this file. "command": "longhand" will silently fail for any user who hasn't already run pip install longhand globally — uvx resolves and runs the PyPI package on demand without that prerequisite, consistent with how omega-memory is configured.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At mcp-configs/mcp-servers.json, line 45:

<comment>Use `uvx` instead of bare `longhand` command to match the convention for Python-based MCP servers in this file. `"command": "longhand"` will silently fail for any user who hasn't already run `pip install longhand` globally — `uvx` resolves and runs the PyPI package on demand without that prerequisite, consistent with how `omega-memory` is configured.</comment>

<file context>
@@ -41,6 +41,11 @@
       "description": "Persistent agent memory with semantic search, multi-agent coordination, and knowledge graphs — run via uvx (richer than the basic memory store)"
     },
+    "longhand": {
+      "command": "longhand",
+      "args": ["mcp-server"],
+      "description": "Lossless Claude Code session history — indexes every tool call, file edit, and thinking block from ~/.claude/projects into local SQLite + ChromaDB. Complementary to memory/omega-memory (which store synthesized memory); Longhand indexes raw session truth before Claude Code rotates the JSONL. 17 tools incl. recall, search_in_context, replay_file, recall_project_status. Install: pip install longhand && longhand setup. ~126ms queries, zero API calls."
</file context>
Suggested change
"command": "longhand",
"args": ["mcp-server"],
"command": "uvx",
"args": ["longhand", "mcp-server"],
Fix with Cubic

Trim the longhand entry's description to align with the one-line
convention used by comparable entries in this file.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@Wynelson94

Copy link
Copy Markdown
Author

Thanks for the reviews.

Keeping command: "longhand" intentional. Longhand requires longhand setup to work — it ingests existing ~/.claude/projects/ history into SQLite + ChromaDB and installs the auto-ingest hook in ~/.claude/hooks. uvx longhand mcp-server would start the server against empty state with no hook, so new sessions wouldn't be captured. The bare command mirrors the pattern evalview uses in this same file (python3 -m evalview mcp serve) — both are tools that require pip install + one-time setup before they're functional, distinct from pure-uvx entries like omega-memory.

Trimmed the description in 29b5ca0 to match the convention used by comparable entries.

@affaan-m

Copy link
Copy Markdown
Owner

Thanks for the PR. This has been idle for several weeks and is not merge-ready against the moving main branch, so I am closing it to keep the queue tractable. Reopen is welcome with a current rebase and focused scope; maintainers may also port the useful parts into a fresh PR where appropriate.

@affaan-m affaan-m closed this May 11, 2026
affaan-m added a commit that referenced this pull request May 12, 2026
- add plan-orchestrate skill from closed PR #1603

- add Longhand MCP config from closed PR #1503

- sync catalog counts to 54 agents, 207 skills, 70 commands
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants