{
  "id": 17050949,
  "title": "Bracketed Paste Tells Your Agent You Pasted. A Stray ESC[201~ Ends It Early",
  "url": "https://urgent.news/2026/10/29/bracketed-paste-tells-your-agent-you-pasted-a-stray-esc-201-ends-it",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-10-29T11:10:35.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/gabrielanhaia/bracketed-paste-tells-your-agent-you-pasted-a-stray-esc201-ends-it-early-2hdp"
  },
  "original_language": "en",
  "account": "Bracketed paste mode, indicated by the control sequences ESC[200~ and ESC[201~, is used by terminal emulators to distinguish between user typing and pasted text. When a program like Claude Code is switched into mode 2004, it sends these markers before and after the pasted content. However, if the clipboard already contains the end marker ESC[201~, a terminal that passes it through will signal that the paste is over early. This can cause the following data to be treated as if it was typed directly.\n\nThe mode was introduced in xterm patch #167 in 2002 and later became the default in Bash 5.1 and Readline 8.1 in December 2020. Claude Code switches this mode on for its prompt, causing pastes to be flagged when they arrive. However, older versions of some programs failed to recognize the end marker, leaving subsequent pastes wrapped in escape sequences.\n\nTo test whether a terminal supports bracketed paste, users can paste a test string containing the ESC[201~ marker followed by more text. If the marker is passed through, the text will show up with the ESC sequences intact. Many modern terminals, including st, still fail this test due to incorrect handling of the end marker.\n\nDespite this, it's important for developers of coding agents and other software that rely on pasted input to be aware of the potential issues when bracketed paste fails. The mode is intended to protect against unintended actions from pasted commands, but if the paste is interpreted as user typing, it could lead to issues in automated workflows.",
  "summary": "Book: AI Agents Pocket Guide The series: Pocket Guides for Developers — 8 short books on agents, RAG, prompts, observability, events, databases and system design — the whole series My project: Hermes IDE | GitHub — an IDE for developers who ship with Claude Code and other AI coding tools Me: xgabriel.com | GitHub You copy a 60-line config block from a docs page and paste it into Claude Code 's…",
  "key_points": [],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}