From b00cc9cfacf92b53fbde7000f3c89fee327a5eb1 Mon Sep 17 00:00:00 2001 From: Saoud Rizwan <7799382+saoudrizwan@users.noreply.github.com> Date: Wed, 18 Sep 2024 14:36:55 -0400 Subject: [PATCH] Dont list_files on desktop when task starts --- src/ClaudeDev.ts | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/ClaudeDev.ts b/src/ClaudeDev.ts index 06e4bf4..60a3770 100644 --- a/src/ClaudeDev.ts +++ b/src/ClaudeDev.ts @@ -1937,14 +1937,16 @@ ${this.customInstructions.trim()} } if (includeFileDetails) { + details += `\n\n# Current Working Directory (${cwd}) Files\n` const isDesktop = cwd === path.join(os.homedir(), "Desktop") - const [files, didHitLimit] = await listFiles(cwd, !isDesktop, 200) - const result = this.formatFilesList(cwd, files, didHitLimit) - details += `\n\n# Current Working Directory (${cwd}) Files\n${result}${ - isDesktop - ? "\n(Note: Only top-level contents shown for Desktop by default. Use list_files to explore further if necessary.)" - : "" - }` + if (isDesktop) { + // don't want to immediately access desktop since it would show permission popup + details += "(Desktop files not shown automatically. Use list_files to explore if needed.)" + } else { + const [files, didHitLimit] = await listFiles(cwd, true, 200) + const result = this.formatFilesList(cwd, files, didHitLimit) + details += result + } } return `\n${details.trim()}\n`