-
Notifications
You must be signed in to change notification settings - Fork 69
Description
Feature Summary
Add an option to create and run tasks directly on the current branch without creating a separate worktree. Users should be able to choose between worktree-isolated work (current behavior) and direct branch work.
Problem or Use Case
Currently, Emdash automatically creates a worktree for every workspace/agent, which is great for isolation but adds overhead that isn't always necessary. Some use cases where users might want to skip worktrees:
- Making quick fixes or small changes on the current branch
- Working on feature branches where isolation isn't needed
- Avoiding the filesystem overhead of creating/managing additional worktrees
- Directly committing to main for projects with simpler workflows
- Working in environments where worktrees might cause issues (disk space, permissions, etc.)
Proposed Solution
Add a toggle or option when creating a new workspace/task:
- Option 1: "Run in worktree" (default, current behavior)
- Option 2: "Run on current branch" (new feature)
When "Run on current branch" is selected:
- The agent runs in the current repository directory
- Changes are made directly to the current checked-out branch
- No worktree is created in the ../worktrees/ directory
- The user is warned that changes will affect their current working directory
UX considerations:
- Make worktree mode the default to maintain safety/isolation
- Show a clear indicator in the UI when working directly on a branch
- Possibly add a confirmation dialog warning users about the implications
Alternatives Considered
Users currently work around this by:
- Manually merging worktree changes back to their main branch
- Using other tools like Claude Code or Conductor directly (though the user mentions these also don't support the non-worktree use case)
- Not using Emdash for simple tasks where worktrees feel like overkill
Additional Context
This would make Emdash more flexible for different workflows and reduce friction for users who want simpler, more direct agent interactions without the worktree abstraction layer.