Fixing Read of Workspace root by index.ts (#5482)

* Fixing Read of Workspace root by index.ts

* Fixing Read of Workspace root by index.ts
This commit is contained in:
Ara authored and GitHub committed 2025-08-09 20:50:50 -07:00
1 parent 314c416788
commit 489dfbc932
2 files changed
+13

No files matched your search

+5
View File
@@ -0,0 +1,5 @@
---
"claude-dev": patch
---
Adding safety guard for workspace root
+8
View File
@@ -89,6 +89,14 @@ export async function parseMentions(
const uniqueMentions = Array.from(new Set(mentions))
for (const mention of uniqueMentions) {
// Safety guard: skip a bare "/" mention. This can surface from parsed strings or tool output and would resolve to the
// workspace root. Expanding it would scan the entire project, inflate context, and can trigger recursive loops.
// If root-level expansion is ever desired, gate it behind an explicit syntax (e.g. "@root" or "@folder:/")
// and enforce strict size/.clineignore limits instead.
if (mention === "/") {
continue
}
if (mention.startsWith("http")) {
let result: string
if (launchBrowserError) {