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!)

Advertisement:

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.

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

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

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

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

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

Advertisement:

Author
piknockyou
Daily installs
0
Total installs
372
Ratings
4 0 0
Version
2.0
Created
2025-09-03
Updated
2026-02-24
Size
12.3 KB
License
AGPL-3.0
Applies to

☕ If you find this tool helpful & would like to support its maintenance, please consider leaving a tip on:

https://ko-fi.com/piknockyou

Thank you! :-)


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.