This release includes breaking changes for platform teams planning a safe upgrade.
✓ No known CVEs patched in this version
Topics
+6 more
Affected surfaces
Summary
AI summaryFixed 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:
- Project inference used first-event cwd only. When Claude Code launches from your home directory and you
cdinto a project mid-session, the first event'scwdis$HOME— not the project. Longhand attributed those sessions to$HOME(project_id → NULL), sorecall_project_statusmissed them entirely. - No reconciliation between disk and DB.
SessionEndhook 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 insessionsfor this project_idsession_count_on_disk— plus any on-disk JSONLs referencing it that aren't ingested yetlast_ingested_at,last_transcript_mtimestale: bool+stale_reason: str— true only when there are transcripts truly missing from the DB (actionable viareconcile --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_project → recall_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,--fixre-ingestion, NULL-project detection) - Two MCP tests for staleness surface (drift detected, no false-positive when in sync)
Commits
c83879fv0.6.0: recall sees sessions it previously missed32f7602fix: 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
About Wynelson94/longhand
Persistent local memory for Claude Code. Indexes every session JSONL verbatim into SQLite + ChromaDB for semantic recall (~126ms)
Related context
Beta — feedback welcome: [email protected]