Skip to content
This repository was archived by the owner on Jun 28, 2026. It is now read-only.

Repository files navigation

ChatGPT Message Cleaner

🌐 Languages: English | 繁體中文

Warning

This project is discontinued and is no longer recommended for use.

ChatGPT now includes native conversation virtualization. It keeps lightweight placeholders for the full conversation, renders only a small window of messages near the viewport, and loads older message content again as the user scrolls. Live testing confirmed that this built-in behavior now covers the core performance problem this extension was created to address.

Because this extension directly hides or removes message elements, it can now compete with ChatGPT's own rendering system during scrolling. This may cause repeated work, higher main-thread load, unstable scrolling, or failed content rendering. Store listings are being withdrawn, and this repository is retained only as an archived technical reference.

icon

Former ChatGPT conversation cleaner, retained as an archived technical reference.

status last_release Manifest v3 TypeScript License


Project Status

New installations are no longer recommended. The Chrome Web Store and Microsoft Edge Add-ons listings are being withdrawn as part of the project shutdown.

Everything below is retained as historical documentation for the last public release.

Historical Features

  • Cleaning Modes:
    • Hide: Remove older messages from view but keep in DOM, restorable anytime
    • Delete: Completely remove from DOM (Element.remove()), especially helpful for extremely long conversations
  • Load Protection: Detects high task density and average processing time, automatically pauses when busy
  • Idle Processing: Uses idle time for processing with dynamic batch size adjustment
  • Auto Speed Control: Adaptive delays based on average processing time
  • Show Previous: Quickly restore older content when needed
  • Multi-language: en / zh-TW / zh-CN

Screenshot

ChatGPT Message Cleaner Demo


Scope & Design Considerations

This tool focuses on "frontend view layer throttling and organization" by reducing visible elements and DOM pressure to improve perceived smoothness, while respecting the site's own mechanisms. The following scenarios are not directly covered, and improvement may vary depending on site design:

  • Model/network inherent latency
  • Global state, virtual lists, tracking scripts, and other non-DOM costs within the site
  • Server-side conversation length, sync/cache, or non-DOM memory usage

Design Highlights:

  • Hide: Nodes remain in DOM but visual and interaction are removed (aria-hidden, inert), can be quickly restored
  • Delete: Nodes are removed from DOM (Element.remove()), can free DOM memory; actual effect still depends on overall site behavior
  • Load Protection: Detects busy periods and pauses, resumes and retries after recovery

In short: This tool is a "frontend view layer organizer" that tries not to conflict with complex internal site mechanisms and doesn't touch your account/cloud data. If the conversation itself is extremely large or the site is under heavy load, you may still experience lag.


Historical Development Setup (Do Not Install for Normal Use)

  1. Get the code and install dependencies (Yarn 4 via Corepack + PnP)

    git clone https://github.com/MeowXiaoXiang/ChatGPT-Cleaner.git
    cd ChatGPT-Cleaner
    
    # Enable Corepack and activate the Yarn version pinned by this repo
    corepack enable
    corepack prepare yarn@4.12.0 --activate
    yarn install
  2. Build (outputs to dist/)

    yarn build
  3. Load in Chrome (Extensions → Developer mode → Load unpacked)

    • Open chrome://extensions
    • Enable "Developer mode"
    • Click "Load unpacked", select the dist/ folder

This project officially uses Yarn 4 + Corepack and commits yarn.lock. The install flow uses Plug'n'Play (PnP), so node_modules/ is not required.

postinstall will try to generate the Yarn VS Code SDK automatically. If TypeScript in VS Code still shows missing globals or unresolved modules, run TypeScript: Select TypeScript Version and switch to Use Workspace Version.

For development, use yarn dev to enter watch mode (automatically rebuilds and copies static resources to dist).


Historical Usage

  • Toolbar Button: Click to toggle enable/disable (badge shows ON/OFF)
  • Floating Ball (bottom right): Click to open panel settings for Keep up to / Mode (Hide or Delete) / Notifications
  • Hide Mode: "Show previous" button appears at the top of conversations to restore older messages

Project Structure

│  .gitignore              # Git ignore rules
│  .pnp.cjs                # Yarn Plug'n'Play runtime map
│  .pnp.loader.mjs         # Yarn Plug'n'Play ESM loader
│  esbuild.config.mjs      # Esbuild bundling configuration
│  LICENSE                 # License (MIT)
│  package.json            # Package and script definitions
│  README.md               # Project documentation
│  tsconfig.json           # TypeScript compilation settings
│
├─scripts                  # Helper scripts
│      postinstall.js      # Post-install VS Code SDK setup for Yarn/PnP
│      zip.js              # Package dist/ into zip
│
├─src
│  │  manifest.json        # Chrome extension configuration (Manifest v3)
│  │
│  ├─background            # Background service
│  │      background.ts
│  │
│  ├─content               # Frontend injection scripts
│  │      constants.ts     # Centralized tunable parameters
│  │      dom-utils.ts     # DOM utilities (selectors, styling, marking)
│  │      idle-utils.ts    # Idle callback wrapper for smooth processing
│  │      main.ts          # Main entry point & orchestration logic
│  │      monitor.ts       # Lightweight monitor panel with real-time metrics
│  │      observer.ts      # DOM mutation observer & route detection
│  │      trim-engine.ts   # Core message hiding/deleting algorithms
│  │      types.ts         # Shared TypeScript type definitions
│  │      ui.ts            # UI components (floating ball, panel, toast)
│  │
│  ├─icons                 # Extension icons
│  │      chat-icon-*.png / svg
│  │
│  ├─styles                # Injected styles
│  │      content.css
│  │
│  └─_locales              # Multi-language (i18n)
│      ├─en
│      ├─zh_CN
│      └─zh_TW
│
└─tools
        convert-icons.py   # Tool for generating different sized icons

Permissions & Privacy

  • Manifest v3
  • permissions: scripting, tabs
  • host_permissions: https://chat.openai.com/*, https://chatgpt.com/*
  • Only operates on frontend DOM, does not collect or upload conversation content or personal data

Historical Development

# Type checking
yarn typecheck

# Development mode (watch)
yarn dev

# Generate release files (dist/)
yarn build

# Compress and package dist as zip
yarn zip

Privacy Policy

This extension respects your privacy and does not collect any personal data. For detailed information, please see the Privacy Policy.

License

MIT License

About

輕量清理 ChatGPT 對話,保留最新訊息、減少頁面負擔。

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages