Listen to today's AI briefing

Daily podcast — 5 min, AI-narrated summary of top stories

Clean Up Messy Claude Code Terminal Pastes in One Click

Clean Up Messy Claude Code Terminal Pastes in One Click

Use the 'Cleanup Claude Code Paste' web tool to instantly clean copied terminal output, removing the prompt character and fixing line-wrapping issues for clean prompts.

GAla Smith & AI Research Desk·3d ago·3 min read·4 views·AI-Generated
Share:
Source: simonwillison.netvia simon_willisonSingle Source

The Problem: Messy Terminal Copies

When you copy a multi-line command or prompt from the Claude Code terminal, you often get extra baggage: the leading prompt character and broken whitespace from line wrapping. This forces you to manually clean the text before you can paste it into a document, another chat, or use it as a new prompt. It's a small but frequent friction point in an otherwise smooth workflow.

The Solution: A Single-Purpose Web Tool

Simon Willison's new Cleanup Claude Code Paste tool solves this. It's a minimalist web page with one job:

  1. Remove the prompt character: Strips the leading from pasted text.
  2. Fix wrapped-line whitespace: Intelligently joins lines that were broken by the terminal's width.
  3. Output clean text: Provides a clean, copyable block of text.

How to use it:

  1. Copy any multi-line output from your Claude Code terminal session.
  2. Navigate to the tool's webpage.
  3. Paste (Cmd+V or Ctrl+V) directly into the page. The cleaning happens automatically.
  4. Click the "Copy to clipboard" button to grab the cleaned version.

No installation, no configuration. It works entirely in your browser.

Why This Matters for Your Workflow

This tool addresses a specific pain point in the Claude Code agentic workflow. When Claude generates a complex shell command or a detailed prompt for a follow-up task, you might want to save it. A clean copy is essential for:

  • Documentation: Adding commands to your project's CLAUDE.md or README.
  • Iteration: Using a cleaned prompt as a starting point for a more refined request.
  • Sharing: Sending a precise instruction to a colleague without terminal artifacts.

Screenshot of a web tool titled

While niche, it eliminates a manual step that interrupts your flow. This follows a trend of developers creating hyper-focused tools to smooth out edges in the AI-assisted development experience, a space where Claude Code has seen significant activity, appearing in 60 articles just this week.

A Native Workaround

For a keyboard-driven solution, you can often achieve a similar result by using your terminal's built-in copy functions. In many terminal emulators, you can:

  1. Select the text you want (excluding the ).
  2. Use a "Copy Selection" shortcut (often Cmd+Shift+C on macOS, Ctrl+Shift+C on Linux/Windows).
    This method bypasses the line-wrapping issue if your selection is precise, but the web tool is more forgiving and handles bulk pastes effortlessly.

Following this story?

Get a weekly digest with AI predictions, trends, and analysis — free.

AI Analysis

**Integrate this into your daily use.** Bookmark the [Cleanup Claude Code Paste](https://tools.simonwillison.net/cleanup-claude-code-paste) page. After a productive Claude Code session where you've iterated on a complex command, copy the entire terminal block, paste it into the tool, and instantly get a clean version to archive in your project notes or `CLAUDE.md` file. **Think of it as a prompt sanitizer.** This is especially useful when building a library of effective prompts. The tool ensures the prompts you save are free of terminal-specific formatting, making them portable and reusable across different interfaces. **This is part of a larger ecosystem trend.** The creation of this single-purpose web tool mirrors the rise of lightweight, composable tools around Claude Code, such as the MCP servers we've covered. It doesn't need to be a complex integration; sometimes a simple web page that does one job perfectly is the best accelerator.
Enjoyed this article?
Share:

Related Articles

More in Products & Launches

View all