Laptop sync + handoff: agent hooks, agent session sync, agent session handoff (stacked on #21)#22
Merged
Merged
Conversation
- agent hooks install|uninstall|status: idempotently manage the Stop + SessionEnd command hooks (async, never block a turn) in ~/.claude/settings.json, preserving user-authored hooks - agent hooks enroll|unenroll: per-repo opt-in consent gate, stored in the CLI config (cwd -> origin remote -> owner/name) - agent session sync: hook-driven (stdin JSON) or manual (flags); checks enrollment (silent no-op otherwise), redacts client-side, gzips + base64, POSTs /v1/sessions/sync; network failures spool to ~/.config/ellipsis/spool (latest snapshot per CC session wins) and flush on the next healthy sync; every hook-mode failure path is a quiet exit 0 so a sync problem can never disturb a Claude Code session
git stash create snapshots the dirty tree without disturbing it (clean tree hands off HEAD), pushed to refs/ellipsis/handoff/<sha12>; then POST /v1/sessions with handoff params + the instructions as the prompt. Requires --parent (the synced laptop session to chain from).
agent hooks + agent session sync (stacked on #21)agent hooks, agent session sync, agent session handoff (stacked on #21)
hbrooks
pushed a commit
that referenced
this pull request
Jul 5, 2026
…ssion handoff` (stacked on #21) (#22) * Laptop transcript sync: agent hooks install/enroll + agent session sync - agent hooks install|uninstall|status: idempotently manage the Stop + SessionEnd command hooks (async, never block a turn) in ~/.claude/settings.json, preserving user-authored hooks - agent hooks enroll|unenroll: per-repo opt-in consent gate, stored in the CLI config (cwd -> origin remote -> owner/name) - agent session sync: hook-driven (stdin JSON) or manual (flags); checks enrollment (silent no-op otherwise), redacts client-side, gzips + base64, POSTs /v1/sessions/sync; network failures spool to ~/.config/ellipsis/spool (latest snapshot per CC session wins) and flush on the next healthy sync; every hook-mode failure path is a quiet exit 0 so a sync problem can never disturb a Claude Code session * agent session handoff: push WIP snapshot + start a cloud handoff session git stash create snapshots the dirty tree without disturbing it (clean tree hands off HEAD), pushed to refs/ellipsis/handoff/<sha12>; then POST /v1/sessions with handoff params + the instructions as the prompt. Requires --parent (the synced laptop session to chain from). --------- Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
hbrooks
added a commit
that referenced
this pull request
Jul 5, 2026
…ssion handoff` (stacked on #21) (#22) (#24) * Laptop transcript sync: agent hooks install/enroll + agent session sync - agent hooks install|uninstall|status: idempotently manage the Stop + SessionEnd command hooks (async, never block a turn) in ~/.claude/settings.json, preserving user-authored hooks - agent hooks enroll|unenroll: per-repo opt-in consent gate, stored in the CLI config (cwd -> origin remote -> owner/name) - agent session sync: hook-driven (stdin JSON) or manual (flags); checks enrollment (silent no-op otherwise), redacts client-side, gzips + base64, POSTs /v1/sessions/sync; network failures spool to ~/.config/ellipsis/spool (latest snapshot per CC session wins) and flush on the next healthy sync; every hook-mode failure path is a quiet exit 0 so a sync problem can never disturb a Claude Code session * agent session handoff: push WIP snapshot + start a cloud handoff session git stash create snapshots the dirty tree without disturbing it (clean tree hands off HEAD), pushed to refs/ellipsis/handoff/<sha12>; then POST /v1/sessions with handoff params + the instructions as the prompt. Requires --parent (the synced laptop session to chain from). --------- Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
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.
The CLI half of laptop ingestion + handoff (
documents/eng/LOCAL_CLAUDE_CODE.md§7.1–7.2 in the monorepo). Server half: ellipsis-dev/ellipsis#5575 (POST /v1/sessions/sync+handoffparams onPOST /v1/sessions).session-rename). Per the cutover gotchas: retarget this PR tomainBEFORE squash-merging #21 with--delete-branch, or this PR gets auto-closed unrecoverably.What this adds
agent hooks install | uninstall | statusStop+SessionEndcommand hooks (agent session sync,async: trueso a slow upload never blocks a turn and exit codes are ignored) into~/.claude/settings.json, preserving any user-authored hooks in the same events.CLAUDE_SETTINGS_PATHoverrides for testing.agent hooks enroll | unenroll [repo]originremote →owner/name, stored in~/.config/ellipsis/config.jsonasenrolledRepos. Installing hooks alone syncs nothing.agent session syncsession_id,transcript_path,cwd,hook_event_name) or manual (--transcript/--session-id/--reason/--cwd, for testing).POST /v1/sessions/syncwithreason: stop|session_end.~/.config/ellipsis/spool/<cc-session>.json(latest snapshot per session wins — snapshots only grow) and the next healthy sync flushes the spool. 4xx is permanent and never spooled.agent session handoff <instructions> --parent <sessionId>(§7.2)git stash createsnapshots the dirty working tree without disturbing it (a clean tree hands off HEAD), pushes it torefs/ellipsis/handoff/<sha12>(a hidden ref, never a branch; needs push permission), thenPOST /v1/sessionswithhandoff: {parent_session_id, repo, sha, ref}+ the instructions as the prompt. The cloud session runs the built-in handoff config with the repo checked out at the WIP SHA.--parentis the synced laptop session to chain from (agent session list --source laptop). Auto-resolving it from the live CC session id is a follow-up.Verified
tsc --noEmitclean; helper smoke tests (remote-URL parsing ssh/https, redaction).