Plugin /path:resume + /path:link-pr; fixes that make projected Claude sessions resumable - #150
Open
benbaarber wants to merge 2 commits into
Open
Plugin /path:resume + /path:link-pr; fixes that make projected Claude sessions resumable#150benbaarber wants to merge 2 commits into
benbaarber wants to merge 2 commits into
Conversation
|
🔍 Preview deployed: https://3dcdad7b.toolpath.pages.dev |
ben-emp
force-pushed
the
ben/plugin-resume-link-pr
branch
from
July 30, 2026 20:33
a324f72 to
2d4b1d2
Compare
…th resume short-circuits p export claude --project refuses to overwrite an existing session file (the error names the id and suggests claude -r); a new --force flag restores the old clobbering behavior. Found the hard way: same-machine round-trips — share your own session, then resume it — silently replaced the richer local original with the lossy projection. path resume short-circuits instead: project_claude returns AlreadyLocal and the resume execs the local copy, which may be newer than the shared document. Tests cover the diverged-local untouched case and the refuse/--force pair. (The signature-serialization and trailing-newline fixes discovered in the same investigation landed on main separately via #151.)
/path:resume <input> fetches a shared session (Pathbase URL, owner/repo/slug, file, or cache id) and projects it into the current project via p import pathbase + p export claude, then hands the user the exact resume step — /resume <id> in the running UI, or claude -r <id> from a terminal. Claude Code has no mechanism for a plugin to switch the running TUI's session (verified against current docs; deep links only open new windows), so the handoff is the floor. The already-local case leans on the CLI guard: the export's refusal carries the session id, and the command turns it into a direct /resume handoff instead of an overwrite — verified headless, where the model previously ignored a prose-only guard and re-exported anyway. /path:link-pr [pr] shares the current conversation (same selection and auth rules as /path:share) and appends the Pathbase link to a PR description — the PR from the arguments, else the current branch's, else the one under discussion; description phrased so "share this conversation to the PR" invokes it. Idempotent per URL; distinct sessions stack as separate lines. Verified headless against a real PR (append + second-session line), body restored after; implicit invocation later verified live from the phrase "share this session with my pr". Both live end-to-end tests passed: a projected thinking-bearing session now resumes cleanly (summarized its own history) and link-pr produced working PR + Pathbase links.
benbaarber
force-pushed
the
ben/plugin-resume-link-pr
branch
from
July 30, 2026 20:35
2d4b1d2 to
da32767
Compare
This was referenced Aug 4, 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.
Stacked on #148.
Summary
Two new plugin commands (plugin
path0.2.0), plus the CLI guard that keeps same-machine round-trips from destroying local history. (The two resume-blocking projector fixes discovered in the same investigation — signature serialization and the trailing newline — merged to main separately via #151; this PR was rebased over them.)CLI
p export claude --projectrefuses to overwrite an existing session file (new--forcerestores the old behavior), andpath resumeshort-circuits the already-local case to resuming the local copy. Without this, same-machine round-trips — share your own session, then resume it — silently replaced the richer local original with the lossy projection.Commands
/path:resume <input>(Pathbase URL,owner/repo/slug, file, or cache id): fetches and projects the session into the current project, then hands the user the exact resume step —/resume <id>in the running UI, orclaude -r <id>. A plugin cannot switch the running TUI's session (verified against current docs; deep links only open new windows), so the one-keystroke handoff is the floor. The already-local case rides the CLI guard: the export's refusal carries the session id and becomes a direct/resumehandoff — made structural after watching a headless run ignore a prose-only guard and re-export anyway./path:link-pr [pr]: shares the current conversation (same selection/auth rules as/path:share) and appendsAgent session: [description](url)to the PR description — the PR from the arguments, else the current branch's, else the one under discussion. Description is phrased so "share this conversation to the PR" invokes it. Idempotent per URL; distinct sessions stack as separate lines.Testing
project_claudenever overwrites (diverged local file untouched,AlreadyLocalreturned);p export clauderefuses without--forceand obeys it./path:resumeverified on both the fresh-projection and already-local paths; headless/path:link-pragainst a real PR (append + second-session stacking), body restored after. Implicit invocation subsequently verified live: "share this session with my pr" routed through/path:link-prand linked this session into this PR's description.scripts/quality_gates.sh: 8/8 under the pinned toolchain; plugin suite 11 checks.