Skip to content

Repository files navigation

Trim Text

GitHub stars GitHub last commit License: MIT TypeScript

A web tool that cleans up text copied from terminals. Paste on the left — get cleaned output on the right, instantly.

Text from Claude Code terminal often contains trailing spaces, whitespace-only lines, and extra leading indentation. These waste tokens and pollute prompts. Trim Text fixes that in one paste.

Features

  • Trailing whitespace removal — strips spaces/tabs from end of every line
  • Empty line collapse — 3+ consecutive blank lines become 2
  • Claude Code mode — dedents common leading whitespace (persisted in localStorage)
  • Trailing space highlighting — red overlay shows exactly what gets trimmed
  • Token counter — shows token count (GPT o200k_base) and how many tokens you save
  • Token visualization — color-coded token boundaries for both input and output
  • Copy button — one-click copy of cleaned text
  • Dark theme — designed for developers

Tech Stack

  • React 19 + TypeScript
  • Vite 7
  • TanStack Router
  • Tailwind CSS v4 + shadcn/ui (base-nova)
  • JetBrains Mono
  • gpt-tokenizer (local, no API calls)

Development

bun install
bun run dev

Build

bun run build
bun run preview

License

MIT

About

A web tool that cleans up text copied from terminals. Strips trailing whitespace, dedents, counts tokens.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages