8000 feat: Add Claude session data copying for worktrees by JL02102 · Pull Request #39 · kbwo/ccmanager · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat: Add Claude session data copying for worktrees #39

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

JL02102
Copy link
@JL02102 JL02102 commented Jun 25, 2025

It would be nice if Claude session data is copied over to a newly created worktree to allow for a conversation to be forked in addition to the worktree. This will add an option to do that when creating a new worktree.

The appeal of this is that if we want to try two different approaches or have an agent try something multiple times, we can simply create a new worktree/branch with session copied and then have that session try different approaches.

  • Add copySessionData configuration option
  • Implement session data copying in worktree creation
  • Update UI to support toggling session data copy
  • Add documentation for the new feature

Cross-Platform Compatibility Analysis

The session data copying feature should work across platforms:

✅ Linux/macOS

  • Claude stores data in ~/.claude/projects/
  • Tested and working afaict

⚠️ Windows

  • Claude likely stores data in %USERPROFILE%.claude\projects\ or %APPDATA%\claude\projects\
  • Paths use backslashes ()
  • The regex /[/\.]/g should handle both forward slashes and backslashes

🔧 Key Cross-Platform Considerations

  1. Path separators: Fixed to handle both / and \
  2. Home directory: Using os.homedir() which works on all platforms
  3. Path joining: Using path.join() for proper platform-specific paths
  4. Directory operations: fs methods (mkdirSync, cpSync) work cross-platform

The feature should now work on Windows, but the exact Claude project directory location on Windows needs verification. Claude Code might use:

  • %USERPROFILE%.claude\ (same as Linux/macOS pattern)
  • %APPDATA%\claude\ (Windows-specific location)
  • %LOCALAPPDATA%\claude\ (less likely)

- Add copySessionData configuration option
- Implement session data copying in worktree creation
- Update UI to support toggling session data copy
- Add documentation for the new feature
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant
0