feat(cli): p export claude takes --session-id and --cwd - #233
Closed
ecalifornica wants to merge 2 commits into
Closed
feat(cli): p export claude takes --session-id and --cwd#233ecalifornica wants to merge 2 commits into
ecalifornica wants to merge 2 commits into
Conversation
|
🔍 Preview deployed: https://69e4a578.toolpath.pages.dev |
ecalifornica
force-pushed
the
ecalifornica/export-claude-cwd-session-id
branch
2 times, most recently
from
August 25, 2026 19:41
39f2bd3 to
928da47
Compare
`--session-id <uuid>` renames the session: the ID becomes the conversation's session ID, every entry's `sessionId`, and every `sessionId` key in every preamble line, nested keys included (Claude Code copies the ID into `worktreeSession.sessionId` on `worktree-state` lines). Any UUID form is accepted; the output uses the hyphenated lowercase form. With `--project` it names the session file. `--cwd <dir>` roots the session: the directory becomes the `cwd` of every entry that carries one. It must be an absolute POSIX path in normalized form (no `.`, `..`, or empty component; one trailing `/` is dropped) and does not have to exist on this machine. It conflicts with `--project`. Message content and tool results are not touched. Each rewrite runs only when its flag is given. path-cli 0.19.0; toolpath-cli 0.19.0 (lockstep bump of the shim).
…-session-id Step 5 is one `p export claude --input <doc> --cwd <remote-dir> --session-id <minted-ID>` call. The script dies when the output carries no `cwd` equal to the remote project directory or no `sessionId` equal to the minted ID, and ships it as is. The summary prints both counts.
ecalifornica
force-pushed
the
ecalifornica/export-claude-cwd-session-id
branch
from
August 25, 2026 20:02
928da47 to
f678e77
Compare
ecalifornica
marked this pull request as ready for review
August 25, 2026 20:07
ecalifornica
marked this pull request as draft
August 27, 2026 16:31
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.
Claude Code resumes a session from
~/.claude/projects/<slug of directory>/<session ID>.jsonland expects thecwdandsessionIdkeys inside the file to match that directory and ID.--session-idtakes a UUID and sets every entry'ssessionIdand everysessionIdkey in every preamble line, nested keys included. With--projectit also names the session file.--cwdtakes a directory and sets thecwdof every entry, so the file matches the directory where the session is resumed. The directory does not have to exist on this machine.--cwdconflicts with--project, which already fixes the directory.--projectdoes not rewritecwd. The file keeps the session's recordedcwd. Follow-up: #239.--projectwrites into this machine's~/.claude/projects/and requires the directory to exist here. The new flags change only the values in the output and work with--outputand stdout, so the file can target a directory that exists only on another host.scripts/resume-remote.shuses both flags to ship a local session to an ssh host under the remote project directory and a fresh ID, and checks that the output carries both values.Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.