Automates clicking chat turn options and delete buttons in Gemini.
After their August 2025 interface revamp, Google removed the native clear button, making it difficult to quickly clear conversation history. This userscript restores the missing clear chat button in Google AI Studio.
https://aistudio.google.com/*The script automates the manual process of:
This process is now reduced to a single button click in the toolbar.
The script includes configurable selectors in case Google changes their DOM structure:
const CHAT_TURN_OPTIONS_SELECTOR = 'ms-chat-turn-options span[class="material-symbols-outlined notranslate ms-button-icon-symbol ng-star-inserted"]';
const DELETE_BUTTON_MENU_SELECTOR = 'div.mat-mdc-menu-content > button:first-of-type';
const DELETE_BUTTON_TEXT = "delete Delete";
https://aistudio.google.com/prompts/*)[Gemini Chat Cleaner]The script provides detailed logging:
[Gemini Chat Cleaner] Script loaded and starting...[Gemini Chat Cleaner] Current URL: [URL][Gemini Chat Cleaner] Toolbar found, creating button...[Gemini Chat Cleaner] Button successfully added to toolbar@match updated
@match updated.
Switched to a MutationObserver to reliably re-add the clear button when navigating between chats. This improves performance and ensures the button is always present in the single-page app. Also fixed console errors by preventing execution in iframes.
This userscript is provided as-is for personal use. Feel free to modify and distribute according to your needs.
If you encounter issues:
Created with assistance from AI tools for enhanced productivity in Google AI Studio workflows.