Laptop transcript sync: agent hooks install + agent session sync#23
Draft
ellipsis-dev[bot] wants to merge 2 commits into
Draft
Laptop transcript sync: agent hooks install + agent session sync#23ellipsis-dev[bot] wants to merge 2 commits into
ellipsis-dev[bot] wants to merge 2 commits into
Conversation
Client half of laptop ingestion (ellipsis-dev/ellipsis documents/eng/LOCAL_CLAUDE_CODE.md section 7.1): - agent hooks install|uninstall|status|enroll|unenroll: writes Stop + SessionEnd hooks into ~/.claude/settings.json (Stop async so uploads never block the session; SessionEnd synchronous with a timeout) and manages the per-repo enrollment set in the CLI config (consent is per-repo opt-in, never account-wide). - agent session sync [--hook]: resolves the cwd's repo from its git remote, silently no-ops unless enrolled, reads the on-disk JSONL transcript, redacts client-side (GitHub/AWS/sk-/Slack/GitLab/npm tokens, JWTs, PEM blocks, Authorization headers), gzips+base64s, POSTs to /v1/sessions/sync. Hook mode always exits 0 so a sync problem can never disturb the session. - Spool-and-retry: network-class failures write the snapshot to ~/.config/ellipsis/spool (one file per CC session, capped at 50) and are drained after the next successful sync; 4xx rejections are never spooled.
Laptop -> cloud handoff (LOCAL_CLAUDE_CODE.md section 7.2): git stash create captures the dirty tree as a commit without disturbing it (clean tree hands off HEAD), pushed to refs/ellipsis/handoff/<cc-session-short> so the sandbox can fetch it; then a final transcript sync (handoff is itself the consent action, so no enrollment gate) and POST /v1/sessions/handoff with the instructions as the session prompt. Prints the dashboard session link.
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.
Client half of laptop ingestion + handoff (
documents/eng/LOCAL_CLAUDE_CODE.md§7.1–7.2 inellipsis-dev/ellipsis). Server half: ellipsis-dev/ellipsis#5578.agent hooks install|uninstall|status|enroll|unenroll— writesStop+SessionEndhooks into~/.claude/settings.json(idempotent, preserves other hooks;Stopisasync: trueso uploads never block the developer's session,SessionEndis synchronous with a 60s timeout since the CC process is exiting) and manages the per-repo enrollment set in the CLI config — consent is per-repo opt-in, never account-wide.installenrolls the current repo by default (--no-enrollto skip).agent session sync [--hook]— resolves the cwd's repo from its gitoriginremote → silent no-op unless enrolled → reads the on-disk JSONL transcript → redacts client-side (GitHub/AWS/sk-/Slack/GitLab/npm token shapes, JWTs, PEM private-key blocks, Authorization headers) → gzip+base64 →POST /v1/sessions/sync. Hook mode always exits 0 (problems go to stderr → CC debug log) so a sync failure can never disturb the session.agent session handoff "<instructions>"—git stash createcaptures the dirty tree as a commit without disturbing it (clean tree hands off HEAD), pushes it torefs/ellipsis/handoff/<cc-session-short>, runs a final transcript sync (handoff is itself the consent action — no enrollment gate), thenPOST /v1/sessions/handoffwith the instructions as the session prompt. Prints the dashboard session link.~/.config/ellipsis/spool/and drain after the next successful sync. 4xx rejections are never spooled.tsc --noEmit+ full vitest suite green.Notes:
src/commands/run.tsx/urls.ts— the run→session rename (cutover tail) is in flight separately; this adds the newsession/hookscommand groups only, so the two changes should merge cleanly.git stash createdoesn't capture untracked files; follow-up if it bites.