Perfect! The implementation is complete and working. Let me provide a summary of what was accomplished:
Summary
I've successfully implemented the imp claude share-session command that automates sharing Claude Code session transcripts to the Imprint-Tech/claude-sessions repository.
What was created:
- pkg/cmd/claude/claude.go - Parent command following the existing pattern
- pkg/cmd/claude/share_session.go - Main implementation with:
- Prerequisites check (uvx/uv availability)
- Interactive session selection via
uvx claude-code-transcripts - User prompt for session description
- Shallow clone of repository to
/tmp - Branch creation with sanitized name (description-timestamp)
- File copying and git operations
- Push and PR URL display
- pkg/cmd/claude/share_session_test.go - Unit tests with 100% passing rate
- Modified pkg/cmd/root.go - Registered the new command
Key features:
- ✅ Checks for
uvoruvxavailability with helpful install instructions - ✅ Executes
uvx claude-code-transcriptsinteractively - ✅ Prompts for description after session selection
- ✅ Shallow clones repository to
/tmp(no git config needed) - ✅ Creates branch:
description-timestamp(e.g.,fix-login-bug-20260108-212044) - ✅ Copies session files to root directory with sanitized session name
- ✅ Commits with description as message and pushes
- ✅ Displays GitHub PR URL for easy creation
- ✅ Comprehensive error handling with SSH setup instructions
- ✅ Cleanup of temporary directories with defer
- ✅
--skip-cleanupflag for debugging - ✅ Progress indicators at each step (1/7 through 7/7)
- ✅ No new dependencies added
Testing:
- ✅ All unit tests pass (TestSanitizeBranchName, TestParseUVXOutput, TestCheckUVXAvailable)
- ✅
make testpasses (all 49+ packages) - ✅
make verifypasses (formatting and linting) - ✅ Binary builds successfully
- ✅ Help output displays correctly
The command is ready to use! Users can now run imp claude share-session to easily share their Claude Code sessions to the team repository.