From 23dd7fd187f463dedaeb028403b527c64255579d Mon Sep 17 00:00:00 2001 From: Jeroen Schweitzer Date: Mon, 13 Jul 2026 17:41:24 +0200 Subject: [PATCH] feat(files): treat in-repo .worktrees/ checkouts as ignored (T-511) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit D-106 supports opening a worktree under /.worktrees/ as its own workspace; the dir itself is sibling checkouts, not tree content — so the builtin ignore set hides it and the project-init scaffold gitignores it alongside .clide/. Co-Authored-By: Claude Fable 5 --- lib/src/daemon/project_commands.dart | 2 +- lib/src/files/ignore.dart | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/src/daemon/project_commands.dart b/lib/src/daemon/project_commands.dart index f50cebc3..30a1b117 100644 --- a/lib/src/daemon/project_commands.dart +++ b/lib/src/daemon/project_commands.dart @@ -84,7 +84,7 @@ void _writeScaffold(String dir, String name) { // Claude with an empty CLAUDE.md stub. No language/framework templates. Never // clobbers — safe to run over an existing folder (T-489). final gitignore = File('$dir/.gitignore'); - if (!gitignore.existsSync()) gitignore.writeAsStringSync('# clide\n.clide/\n'); + if (!gitignore.existsSync()) gitignore.writeAsStringSync('# clide\n.clide/\n.worktrees/\n'); final claudeMd = File('$dir/CLAUDE.md'); if (!claudeMd.existsSync()) claudeMd.writeAsStringSync('# $name\n\nGuidance for Claude Code in this project.\n'); } diff --git a/lib/src/files/ignore.dart b/lib/src/files/ignore.dart index 7d2d35e5..8c8c5157 100644 --- a/lib/src/files/ignore.dart +++ b/lib/src/files/ignore.dart @@ -162,5 +162,7 @@ class IgnoreSet { /// ignore files. Matches D-004's "walker magic: none except /// `.git/`" — but the tree-view UI benefits from hiding `.pql/` and /// `.dart_tool/` too since users never edit those by hand. - static IgnoreSet builtin() => IgnoreSet.parse(const ['.git/\n.pql/\n.clide/\n.dart_tool/\nbuild/\nnode_modules/\n']); + /// `.worktrees/` holds in-repo linked worktrees (D-106) — sibling + /// checkouts a user opens as their own workspaces, not tree content. + static IgnoreSet builtin() => IgnoreSet.parse(const ['.git/\n.pql/\n.clide/\n.dart_tool/\n.worktrees/\nbuild/\nnode_modules/\n']); }