Remove auto-cd functionality from wtp add command#18
Conversation
Remove the automatic directory change behavior after creating a new worktree. This simplifies the codebase and makes behavior more predictable. Users now need to explicitly use: wtp add feature/xyz && wtp cd feature/xyz Instead of the automatic cd that happened before. BREAKING CHANGE: wtp add no longer automatically changes directory to the new worktree 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
WalkthroughRemoved the post-add auto-cd behavior from shell completion/integration for Bash, Zsh, and Fish in cmd/wtp/completion.go. The add path now simply invokes wtp "$@" without parsing arguments or attempting to cd. Other completion helpers and cd integration remain unchanged. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant U as User
participant S as Shell (completion)
participant W as wtp
rect rgb(240,240,240)
note over U,S: Previous flow (with auto-cd)
U->>S: wtp add <args>
S->>W: invoke wtp add <args>
W-->>S: exit code
S->>S: parse args, resolve worktree dir
alt dir found
S->>S: cd to new worktree
else
S-->>U: return without cd
end
end
rect rgb(235,250,235)
note over U,S: New flow (no auto-cd)
U->>S: wtp add <args>
S->>W: invoke wtp add <args>
W-->>S: exit code
S-->>U: return (no cd)
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~7 minutes Possibly related PRs
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
💤 Files with no reviewable changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
Summary
wtp addcommandBreaking Change
Before:
wtp add feature/xyzwould automatically cd to the new worktreeAfter: Users need to explicitly run
wtp add feature/xyz && wtp cd feature/xyzChanges
Migration Guide
Users who relied on the auto-cd behavior will need to update their workflow:
Test Plan
go tool task dev- all tests passwtp addcommand - creates worktree without changing directoryThis is the first step in the migration plan outlined in the Untitled.md document, preparing for the future
wtp init-shellcommand architecture.🤖 Generated with Claude Code
Summary by CodeRabbit