Google AI Studio | Clear Chat Button
A userscript that restores the missing clear chat functionality in Google AI Studio after their August 2025 interface revamp removed the native clear button.
Background: At the end of August 2025, Google revamped Google AI Studio and removed the clear chat button, making it difficult to quickly clear conversation history. This userscript restores that functionality with a convenient toolbar button.
Features
- Restores Missing Functionality: Brings back the clear chat button that Google removed in their August 2025 AI Studio revamp
- One-Click Clearing: Instantly clear all chat turns in your current prompt session
- Integrated UI: Seamlessly integrates into the existing toolbar with native Material Design styling
- Visual Feedback: Uses a refresh icon (🔄) with clear tooltip for easy identification
- Error Handling: Robust error handling with console logging for debugging
- Non-Intrusive: Doesn't modify existing functionality, only adds the clear feature
Installation
Requirements
- A userscript manager browser extension:
Steps
- Install one of the userscript managers listed above
- Click the install link for this script
- The script will automatically activate on
https://aistudio.google.com/prompts/*
Usage
- Navigate to any prompt page in Google AI Studio (e.g.,
https://aistudio.google.com/prompts/1JmV2yaaf2-oSeErPNjd0UPV4v9V4JLLA)
- Look for the new refresh button (🔄) in the top toolbar
- Click the button to clear all chat turns in the current session
- The script will automatically click the option buttons and delete buttons for you
How It Works
The script automates the manual process of:
- Clicking the options menu (⋯) on each chat turn
- Selecting the delete option from the dropdown menu
- Confirming the deletion
This process is now reduced to a single button click in the toolbar.
Compatibility
- Browser: Chrome, Firefox, Safari, Edge
- Userscript Manager: Violentmonkey, Tampermonkey, Greasemonkey
- Platform: Google AI Studio (aistudio.google.com)
Technical Details
- Language: JavaScript (ES6+)
- Framework: None (vanilla JavaScript)
- Dependencies: None
- CSP Compliant: Uses DOM manipulation instead of innerHTML to avoid Content Security Policy restrictions
Configuration
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";
Troubleshooting
Button Not Appearing
Script Not Working
- Open browser console (F12)
- Look for error messages starting with
[Gemini Chat Cleaner]
- Verify the page structure hasn't changed (Google may update their interface)
Console Logs
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
Changelog
v1.0
- Initial release to restore clear chat functionality after Google's August 2025 AI Studio revamp
- Toolbar integration with refresh icon
- Error handling and logging
- CSP-compliant DOM manipulation
- Addresses the removal of native clear chat button
License
This userscript is provided as-is for personal use. Feel free to modify and distribute according to your needs.
Support
If you encounter issues:
- Check the troubleshooting section above
- Verify you're using a compatible userscript manager
- Ensure you're on the correct Google AI Studio URL
- Check browser console for error messages
Author
Created with assistance from AI tools for enhanced productivity in Google AI Studio workflows.