Google AI Studio | Clear Chat Button

Automates clicking chat turn options and delete buttons in Gemini.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

ستحتاج إلى تثبيت إضافة مثل Stylus لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتتمكن من تثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

(لدي بالفعل مثبت أنماط للمستخدم، دعني أقم بتثبيته!)

المؤلف
piknockyou
التثبيت اليومي
1
إجمالي التثبيت
195
التقييمات
3 0 0
الإصدار
1.8
تم إنشاؤه
03-09-2025
تم تحديثه
01-01-2026
الحجم
12.1 KB
الترخيص
AGPL-3.0
ينطبق على

See screenshot at the bottom

Google AI Studio | Clear Chat Button

Restores the missing clear chat button that Google removed in their August 2025 AI Studio interface revamp.

Why You Need This

Google's August 2025 AI Studio update removed the native clear chat button, making it tedious to clear conversation history:

  • Manual deletion: Must click the options menu (⋯) on each chat turn individually.
  • Multiple steps: Select delete from dropdown, then confirm for every single turn.
  • No bulk action: No way to clear all turns at once.

This script automates the entire process with a single toolbar button click.

Key Features

  • One-Click Clearing: Instantly clear all chat turns in your current prompt session.
  • Native Integration: Adds a refresh icon (🔄) to the toolbar that matches Google's Material Design.
  • SPA-Aware: Automatically re-applies the button when navigating between chats.
  • Error Handling: Robust error handling with console logging for debugging.

How to Use

Action Result
Click refresh button (🔄) Automatically clicks all option menus and delete buttons to clear the entire chat

The button appears in the top toolbar next to the "More options" (⋮) button.

Performance Notes

  • MutationObserver: Watches for toolbar changes to ensure button persists during SPA navigation.
  • Efficient targeting: Uses specific CSS selectors to only click chat turn options and delete buttons.

Installation

  1. Install Violentmonkey (recommended), Tampermonkey, or Greasemonkey.
  2. Install this script.
  3. Visit aistudio.google.com.

Works immediately. The refresh button appears in the toolbar on all prompt pages.

Technical Details

  • Automation: Sequentially clicks ms-chat-turn-options buttons, then clicks delete buttons in the menu.
  • Selectors: Configurable CSS selectors in case Google changes their DOM structure: javascript const CHAT_TURN_OPTIONS_SELECTOR = 'ms-chat-turn-options span[...]'; const DELETE_BUTTON_MENU_SELECTOR = 'div.mat-mdc-menu-content > button:first-of-type';
  • CSP Compliant: Uses DOM manipulation instead of innerHTML to avoid Content Security Policy restrictions.