Skip to content

Wynelson94/longhand

v0.6.0 Breaking

This release includes breaking changes for platform teams planning a safe upgrade.

Published 1mo MCP Data & Storage
✓ No known CVEs patched
Read the diff → Tool health → What is this tool? →

✓ No known CVEs patched in this version

Topics

ai-memory anthropic chromadb claude-code forensic local-first
+6 more
lossless mcp mcp-server python recall sqlite

Affected surfaces

auth breaking_upgrade

Summary

AI summary

Fixed missing session records and incorrect project inference causing recall_project_status to return empty results.

Full changelog

Critical fix: if your DB has NULL project_ids or missing sessions, recall has been lying to you.

Two related failure modes could cause recall_project_status("project-name") to return "No session history found" even when transcripts existed on disk:

  1. Project inference used first-event cwd only. When Claude Code launches from your home directory and you cd into a project mid-session, the first event's cwd is $HOME — not the project. Longhand attributed those sessions to $HOME (project_id → NULL), so recall_project_status missed them entirely.
  2. No reconciliation between disk and DB. SessionEnd hook failures (silent exits, stale hook commands, Claude Code exit paths that skip hooks) left transcripts in ~/.claude/projects/ that never got ingested. There was no retry, no detection, no backstop.

Recently dogfooded: a 2,526-line bsoi-mesh-kit work session was on disk, four transcripts referenced the project, and recall_project_status returned empty narrative. The fix replays disk → DB with improved attribution.

Upgrade

pip install --upgrade longhand==0.6.0
longhand reconcile --fix   # replay historical sessions with new inference

reconcile is idempotent. Without --fix it prints a summary of drift; with --fix it re-ingests the NULL-project and missing-session buckets. Typical throughput: ~1–2 sessions/sec.

What changed

New: longhand reconcile [--fix]

Walks ~/.claude/projects/*.jsonl, diffs against the sessions table, buckets results into:

  • fully indexed — session row exists with a project_id
  • ingested but project_id IS NULL — project inference missed (pre-0.6.0 behaviour)
  • missing from sessions — hook didn't fire or failed silently

--fix re-ingests the last two buckets using the improved inference.

Project inference: mode-of-cwd instead of first-event-cwd

build_session now tallies every event's cwd, filters out $HOME and paths that don't resolve to a project marker (.git, pyproject.toml, package.json, etc.), and picks the mode. Multi-project sessions attribute to where the work actually happened. Single-project and home-only sessions are unchanged.

Staleness surface on recall_project_status

New fields on the MCP response:

  • session_count_indexed — rows in sessions for this project_id
  • session_count_on_disk — plus any on-disk JSONLs referencing it that aren't ingested yet
  • last_ingested_at, last_transcript_mtime
  • stale: bool + stale_reason: str — true only when there are transcripts truly missing from the DB (actionable via reconcile --fix). Sessions attributed to sibling projects (expected for multi-project sessions) do NOT trigger drift.

When stale=True, the narrative gets a prefix pointing at longhand reconcile --fix.

Bonus: discover_sessions filter fix

discover_sessions() was rglobing all JSONLs under ~/.claude/projects, including /subagents/*.jsonl (subagent transcripts referenced from parent sessions) and pytest temp dirs. These were being treated as top-level sessions. On my machine this was inflating the "missing" count from 28 → 650. Now filtered out.

Recall skill rewritten

~/.claude/skills/recall/SKILL.md previously mandated search_in_context first — but that tool requires a session_id the caller usually doesn't have. The skill now branches: use search_in_context when the query includes a session ID, otherwise start with match_projectrecall_project_status and surface any drift loudly instead of silently falling back to file reads.

Tests

182 passing (was 174). +8 new:

  • Three parser tests for mode-cwd inference (home-filter, marker-walk fallback, multi-project tiebreak)
  • Three CLI tests for reconcile (missing detection, --fix re-ingestion, NULL-project detection)
  • Two MCP tests for staleness surface (drift detected, no false-positive when in sync)

Commits

  • c83879f v0.6.0: recall sees sessions it previously missed
  • 32f7602 fix: sync .claude-plugin/plugin.json to 0.6.0

Full Changelog: https://github.com/Wynelson94/longhand/compare/v0.5.13...v0.6.0

Weekly OSS security release digest.

The CVE patches and breaking changes that affected production tools this week. One email, every Sunday.

No spam, unsubscribe anytime.

Share this release

Track Wynelson94/longhand

Get notified when new releases ship.

Sign up free

About Wynelson94/longhand

Persistent local memory for Claude Code. Indexes every session JSONL verbatim into SQLite + ChromaDB for semantic recall (~126ms)

All releases →

Beta — feedback welcome: [email protected]