pub struct WorktreeConfig {
pub enabled: bool,
pub base_ref: WorktreeBaseRef,
pub default_branch: String,
pub root: String,
pub branch_prefix: String,
pub prune_branch_on_remove: bool,
pub cleanup_on_completion: bool,
pub bg_isolation: BgIsolation,
pub git_timeout_secs: u64,
}Expand description
Configuration for the per-subagent git worktree isolation feature.
When enabled = true, each subagent that opts in via
SubAgentPermissions::worktree receives a dedicated git worktree on a
fresh branch, ensuring that file edits from concurrent agents do not
interfere with each other or with the main working tree.
§Examples
use zeph_config::WorktreeConfig;
let cfg = WorktreeConfig::default();
assert!(!cfg.enabled);
assert_eq!(cfg.root, ".claude/worktrees");
assert_eq!(cfg.branch_prefix, "agent/");
assert_eq!(cfg.git_timeout_secs, 30);Fields§
§enabled: boolEnable per-subagent git worktrees. When false, no worktrees are created
regardless of other settings.
base_ref: WorktreeBaseRefBase commit strategy for new worktree branches.
default_branch: StringDefault remote branch used when base_ref = "fresh".
Empty string triggers auto-detection of origin/HEAD.
root: StringRoot directory for worktrees, relative to the repository root.
Each worktree is placed in a subdirectory named after the subagent ID.
branch_prefix: StringBranch name prefix. The full branch name is "{prefix}{subagent_id}".
prune_branch_on_remove: boolDelete the worktree branch after the worktree is removed.
When false (default), the branch persists so the agent’s work can be
reviewed, merged, or discarded manually.
cleanup_on_completion: boolRemove the worktree when the agent completes or is cancelled.
When false, worktrees persist until an explicit worktree clean command.
bg_isolation: BgIsolationBackground subagent isolation mode.
Controls whether background subagents receive a dedicated worktree or edit the working copy directly.
git_timeout_secs: u64Per-command timeout for git invocations, in seconds.
Applied to every git call issued by the worktree subsystem (e.g.
git worktree add, git fetch, git rev-parse). Increase this value
on repositories that are slow to clone or when running over high-latency
network links. A value of 0 is treated as 1 at the call site.
Trait Implementations§
Source§impl Clone for WorktreeConfig
impl Clone for WorktreeConfig
Source§fn clone(&self) -> WorktreeConfig
fn clone(&self) -> WorktreeConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more