Repository navigation
0.21.0: recall meta-skill — cross-session memory via sessions.jsonl index - #2
Open
Nowhitestar wants to merge 1 commit into
Open
Nowhitestar wants to merge 1 commit into
Nowhitestar wants to merge 1 commit into
Conversation
…ndex Telegram bot sessions die on quota / restart / MCP disconnect, and the next session has zero context. recall fixes that: - Begin (Session Start): register session_id in memory/sessions.jsonl - Update (heartbeat): refresh topic+summary for the live session - Backfill (sleep): catch-up pass on any unindexed JSONL + 48h refresh + 90-day aging into memory/sessions.archive.jsonl - Search (user references past chat): grep index → grep inside JSONL → read ±20-line windows around anchors, surface as prose. Default is the relevant slice, not the full transcript. Plumbing: - skills/recall/SKILL.md (new) - commands/recall.md (new — /zero-claw:recall <query>|backfill|list) - template/CLAUDE.md: Session Start step 3 + new "Session Recall" section - template/HEARTBEAT.md: hourly recall Update - template/SLEEP.md: nightly recall Backfill + aging - skills/upgrade-meta-skill/SKILL.md: add recall to meta-skill list Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Author
|
Heads-up: I've merged this branch into my fork's If you'd like to take it, the diff is unchanged and ready to merge as-is. If you'd prefer changes (naming, scope, or splitting it up), happy to revise. If it's not the direction you want for |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Telegram bot sessions die on quota cuts / daily restart / MCP disconnect, and the next session has zero memory of what was discussed. The transcript is on disk at
~/.claude/projects/<encoded-cwd>/<session-id>.jsonl— we just need an index and a retrieval protocol to make it usable as memory.What
New meta-skill
recallwith four operations, wired into the existing heartbeat/sleep/Session-Start mechanism. Pure markdown, no new code.CLAUDE.mdSession Start step 3session_idinmemory/sessions.jsonl(idempotent, fast, silent)HEARTBEAT.mdhourlytopic+summaryfor the live sessionSLEEP.mdnightlyended>90 days move tomemory/sessions.archive.jsonl/zero-claw:recall <query>Index row
{"session_id":"abc-123","started":"2026-05-06T14:30Z","ended":"2026-05-06T15:45Z","topic":"session 恢复设计","summary":"用户提出 session 中断失忆问题;定了用 recall meta-skill 索引 sessions.jsonl。"}topic/summaryare free-form, user's language, no length policing.Search example
User: "我们之前聊过 telegram session 中断的问题"
sessions.jsonl→ 1 hit (sessionabc-123).~/.claude/projects/.../abc-123.jsonlfor keywords → anchor lines[12, 47, 93].±20window around each, dedupe overlaps → ~100 lines pulled (vs full transcript at 5k+).Multiple candidates → ask which one. No specific keyword → fall back to last 100 lines + first 30. Full transcript only on explicit "把整段拉出来".
Files changed
New
skills/recall/SKILL.md— full Begin/Update/Backfill/Search protocol + JSONL atomic-write pattern + failure modescommands/recall.md—/zero-claw:recall <query>|backfill|listModified
template/CLAUDE.md— Session Start step 3 (Begin) + new "Session Recall" sectiontemplate/HEARTBEAT.md— hourlyrecallUpdatetemplate/SLEEP.md— nightlyrecallBackfill + agingskills/upgrade-meta-skill/SKILL.md—recalladded to meta-skill list (so existing bots get it via/zero-claw:upgrade-meta-skill)package.json/.claude-plugin/plugin.json/.claude-plugin/marketplace.json— 0.20.7 → 0.21.0Test plan
memory/sessions.jsonl; heartbeat fills topic/summary; manual/zero-claw:recall listshows it/zero-claw:upgrade(template files) +/zero-claw:upgrade-meta-skill(recall skill) → first sleep runs Backfill catch-up across historical JSONL filesended>90 days → next sleep moves it tomemory/sessions.archive.jsonl; archive falls through on Search miss🤖 Generated with Claude Code