p export claude --project <dir> writes the session to ~/.claude/projects/<slug of dir>/<session ID>.jsonl. It does not rewrite cwd. Every entry keeps the session's recorded cwd.
Claude Code expects every entry's cwd to equal the directory the file is filed under (docs/agents/formats/claude-code/writing-compatible-jsonl.md, rule 3). A document recorded at /a, exported with --project /b, yields a file whose location says /b and whose entries say /a. /path:resume runs p export claude --project <absolute cwd>, so every shared session from a different checkout path lands this way.
Proposal:
--project implies --cwd <dir>, with <dir> canonicalized the same way write_into_claude_project canonicalizes it.
--cwd no longer conflicts with --project. When both are given and differ after canonicalization, the export errors.
--project and --cwd help text state the rule.
Scope: run_claude in crates/path-cli/src/cmd_export.rs, ~20 lines. One test: a document recorded at /old, exported with --project <tmp dir>, has every cwd equal to the canonical tmp dir. plugins/claude-code/commands/resume.md needs no change.
p export claude --project <dir>writes the session to~/.claude/projects/<slug of dir>/<session ID>.jsonl. It does not rewritecwd. Every entry keeps the session's recordedcwd.Claude Code expects every entry's
cwdto equal the directory the file is filed under (docs/agents/formats/claude-code/writing-compatible-jsonl.md, rule 3). A document recorded at/a, exported with--project /b, yields a file whose location says/band whose entries say/a./path:resumerunsp export claude --project <absolute cwd>, so every shared session from a different checkout path lands this way.Proposal:
--projectimplies--cwd <dir>, with<dir>canonicalized the same waywrite_into_claude_projectcanonicalizes it.--cwdno longer conflicts with--project. When both are given and differ after canonicalization, the export errors.--projectand--cwdhelp text state the rule.Scope:
run_claudeincrates/path-cli/src/cmd_export.rs, ~20 lines. One test: a document recorded at/old, exported with--project <tmp dir>, has everycwdequal to the canonical tmp dir.plugins/claude-code/commands/resume.mdneeds no change.