Export Claude Code transcripts before worktree removal #80
Labels
No labels
agent-ready
bug
contract
documentation
duplicate
enhancement
good first issue
help wanted
invalid
needs-human
needs-input
question
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
iterative-works/iw-cli#80
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
When removing a worktree with
iw rm, export Claude Code session transcripts to a persistent location before the worktree (and its associated sessions) become inaccessible.Motivation
Claude Code stores session transcripts in
~/.claude/projects/{encoded-path}/where the path is tied to the worktree directory. When we remove a worktree:Transcripts are useful for:
Proposed Solution
Storage Structure
Implementation in
iw rmBefore removing the worktree:
/home/user/project-IW-79→-home-user-project-IW-79~/.claude/projects/{encoded-path}/~/transcripts/{project}/{issue-id}/Path Encoding
Claude encodes paths by replacing
/with-and prepending-:Configuration
Consider adding to
.iw/config.conf:Acceptance Criteria
iw rmexports transcripts before worktree removalNotes
claude-conversation-extractorexists for JSONL→MD conversion, but we may want a simpler built-in solutioniw transcripts listandiw transcripts searchcommands laterI would export a manifest alongside the copied JSONL files.
Useful fields: original worktree path, encoded Claude project dir, session id, transcript filename, sha256, issue/worktree id, branch/head commit if known, exported_at, and destination path. Then
iw rmcan be retried safely and later tools can prove which raw transcript produced a markdown view.The raw copy should happen before any conversion, so converter bugs do not lose the only source artifact.
Generated with ax.
Intake: agent-ready
Workflow: waterfall
Reason: all gates passed
Analysis: project-management/issues/IW-80/analysis.md on branch IW-80
Implement: needs-human
Reason: batch-implement exit 1 — the kanon plugin does not compile against the iw-cli core of this branch, so no phase started
batch-implement.logwas not written: the command failed at its scala-cli compile, before it started. The compiler output:The branch is current with
main.fetchPullRequestForBranchonCommandEnvreturnsTrackerErrorsince #778 and #780, and the installed kanon plugin still expectsString. This failure is not specific to this issue: everybatch-implementrun on currentmainstops here until the plugin is updated to the new error type. When the plugin compiles, release this issue toagent-readyagain.Release: the implement loop failed this issue for a reason outside it. The kanon plugin did not compile against iw-cli main, because the tracker port now returns TrackerError (iw-cli #778). The plugin fix is dev-docs #484, and iw-cli 0.22.1 carries the core change. The issue goes back to the implement loop.