From 14ac46018fe047ed173dff1c914cbec8f46f14e3 Mon Sep 17 00:00:00 2001 From: andrepimenta Date: Tue, 2 Dec 2025 18:12:46 +0000 Subject: [PATCH] Run /compact command in chat instead of spawning terminal MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The /compact command now executes through the chat interface using the existing Claude process, providing a seamless user experience instead of opening a separate terminal window. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- src/extension.ts | 6 ++++++ src/script.ts | 16 ++++++++++------ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/src/extension.ts b/src/extension.ts index aaf2731..517ce1e 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -2637,6 +2637,12 @@ class ClaudeChatProvider { } private _executeSlashCommand(command: string): void { + // Handle /compact in chat instead of spawning a terminal + if (command === 'compact') { + this._sendMessageToClaude(`/${command}`); + return; + } + const config = vscode.workspace.getConfiguration('claudeCodeChat'); const wslEnabled = config.get('wsl.enabled', false); const wslDistro = config.get('wsl.distro', 'Ubuntu'); diff --git a/src/script.ts b/src/script.ts index 2d34c42..ba846da 100644 --- a/src/script.ts +++ b/src/script.ts @@ -1679,18 +1679,22 @@ const getScript = (isTelemetryEnabled: boolean) => `