Package runtime scripts in the skill and add digest caching#28
Merged
hacktivist123 merged 5 commits intoJun 19, 2026
Merged
Conversation
Moves (git mv, so installed skills ship the helpers): - scripts/session-events.py -> skills/agent-session-resume/scripts/session-events.py - scripts/session-candidates.py -> skills/agent-session-resume/scripts/session-candidates.py - scripts/session-digest.py -> skills/agent-session-resume/scripts/session-digest.py - scripts/skill-provenance.py -> skills/agent-session-resume/scripts/skill-provenance.py CI-only validate-*.py stay at repo-root scripts/. session-digest.py: - writes a <transcript>.digest.json cache sidecar next to the source by default, keyed on file size + sha256 + last processed byte offset - unchanged files reuse the sidecar wholesale; append-only growth processes only the tail and merges (incremental is the default for JSONL transcripts); prefix changes recompute fully - new flags: --sidecar-dir, --no-sidecar, --no-incremental; unwritable transcript directories skip the sidecar with a stderr notice session-candidates.py: - new flags: --since / --until (ISO date/datetime or relative like 7d, 12h) and --cwd now filters to exact or parent/child workspace matches in addition to ranking Validation: - new scripts/validate-session-digest.py covers cache-hit, append-only tail, prefix-change invalidation, --no-sidecar, --sidecar-dir, and read-only dirs - new scripts/validate-session-candidates.py covers the time-window and cwd filters for both platforms - validate-skill-package.py now checks the packaged scripts; validate.yml runs the new validators and compiles the moved scripts Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This was referenced Jun 9, 2026
…dexed sessions Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
LakunleD
reviewed
Jun 15, 2026
…ion, drop review comment The suggestion was committed in the wrong place (inside digest_file_cached if-block), creating a duplicate sha256_prefix and breaking syntax. This: - Removes the duplicate sha256_prefix - Moves last_complete_newline_offset to after sha256_prefix - Removes the LakunleD review comment from the function - Updates write_cache to use last_complete_newline_offset + aligned sha256
hacktivist123
added a commit
that referenced
this pull request
Jun 19, 2026
hacktivist123
added a commit
that referenced
this pull request
Jun 19, 2026
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.
Moves the four runtime helpers (session-events.py, session-candidates.py, session-digest.py, skill-provenance.py) from repo-root scripts/ into skills/agent-session-resume/scripts/ so installed skills actually ship them — previously every resume re-derived multi-line jq pipelines by hand because the scripts were not present in ~/.claude/skills or ~/.codex/skills installs.
Also:
<transcript>.digest.jsonsidecar cache (size+sha256+offset keyed), incremental append-only tail processing by default,--sidecar-dir/--no-sidecar/--no-incrementalflags. Cached vs fresh output verified byte-identical.--since/--until(ISO or relative like 7d) and--cwd(exact or parent/child) filters, so 'my Codex threads from the past week' needs one command instead of hand-rolled date enumeration.CI validate-*.py stay at repo root. All scripts remain python3 stdlib-only and cwd-independent.
🤖 Generated with Claude Code