Perchance Memory Trimmer Tool

Memory trimmer for Perchance AI Chat — draggable UI, undo, preview diff, search, token count, settings persistence.

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.

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

Author
Fishleg Studio
Daily installs
1
Total installs
25
Ratings
0 0 0
Version
2.04.3
Created
2025-10-20
Updated
2026-04-08
Size
299 KB
License
MIT
Applies to

About

If your Perchance memory has gone from “helpful notes” to “unsorted landfill,” this tool helps you clean it up without doing surgery on a giant text block by hand. It gives you trimming, review, backups, safer write-back, and a bunch of extra tools for keeping long chats usable.


Perchance Memory Trimmer Tool is a userscript for Perchance chat that helps you clean up your memory without having to wrestle a giant wall of /mem text by hand every time your chat gets too long, too messy, or too full of repeated lore.

If you use long-running roleplays or story-heavy chats, memory can turn into a junk drawer fast. Old details pile up, duplicates creep in, important facts get buried, and before long you’re staring at a block of text that feels more like archaeology than editing. This tool is meant to make that process easier.

Instead of manually cutting and pasting everything yourself, PMT gives you a floating workspace where you can fetch or paste your memory, trim it down, review what changed, compare versions, save backups, and write the cleaned result back with a lot less stress. It supports the main Perchance chat pages and is designed for real long-chat cleanup, not just tiny one-off edits.

It can do the basics, like keeping the newest entries or trimming oversized ones, but it also includes more advanced tools for people who want more control. You can work toward a token budget, remove duplicates, save snapshots before making risky changes, inspect what got removed, compare memory against lore or summaries, and use extra review tools to spot repetition, conflicts, and clutter.

Most of the tool works locally in your userscript, which means the core cleanup workflow stays on your side. Manual copy/paste still works, but supported Perchance pages can also let the tool fetch and apply memory more directly. The one exception is the optional Q&A feature, which the project describes as user-initiated and API-based.

What it’s good for

  • Cleaning up bloated chat memory
  • Cutting duplicates and redundant entries
  • Trimming memory to fit a token budget
  • Keeping important details while removing filler
  • Reviewing changes before you commit them
  • Saving restore points so mistakes are less scary
  • Comparing memory against lore, summaries, or other reference text

First-time use

  1. Install the script in Tampermonkey or Violentmonkey.
  2. Open a supported Perchance chat page.
  3. Click the floating Trim Memories button or press Alt+M.
  4. Fetch your memory if available, or paste it in manually.
  5. Choose a preset or your trim settings.
  6. Click Trim.
  7. Review the result, preview, and removed sections.
  8. Copy it back manually, or use Apply if the page supports it.

Supported pages


New features and improvements

This version adds a lot more than just “trim the text and hope for the best.”

Easier cleanup

  • Added Fit token budget mode, so you can trim memory based on token limits instead of only by number of entries
  • Added named presets for common cleanup jobs
  • Improved support for duplicate cleanup and oversized-entry trimming

Safer editing

  • Added Snap and Restore so you can save a backup before making bigger changes
  • Added visible Undo
  • Added stronger apply verification, including Verified, Mismatch, and Unverified states
  • Added better recovery flow when write-back does not go as expected

Better review tools

  • Added Analyse, Curate, and Compare views
  • Added tools for spotting repetition, conflicts, topic groups, and story beats
  • Improved result review so it is easier to see what stayed, what changed, and what got removed

More advanced extras

  • Added Lore export
  • Added Group by similarity
  • Added Map visualization
  • Added optional Q&A for asking natural-language questions about memory

Improvements in the current build

  • More reliable token-count handling with auto, native, and heuristic modes
  • Better compatibility with Perchance page changes through fallback host selectors
  • Better line-ending normalization for pasted memory
  • Expanded diagnostics and smoke tests
  • Added feature flags for things like auto-match host theme and mini toolbar injection
  • Better regression coverage to prevent old bugs from coming back