Title: Stray "x" appears at the end of every prompt (leftover Claude Code 0.2.70 workaround) · Issue #223 · coder/agentapi · GitHub
Open Graph Title: Stray "x" appears at the end of every prompt (leftover Claude Code 0.2.70 workaround) · Issue #223 · coder/agentapi
X Title: Stray "x" appears at the end of every prompt (leftover Claude Code 0.2.70 workaround) · Issue #223 · coder/agentapi
Description: Summary Every message sent through agentapi to Claude Code produces a visible stray x character in the prompt area. The x comes from a workaround introduced in b732081 almost a year ago, which the commit itself promised to remove "a coup...
Open Graph Description: Summary Every message sent through agentapi to Claude Code produces a visible stray x character in the prompt area. The x comes from a workaround introduced in b732081 almost a year ago, which the ...
X Description: Summary Every message sent through agentapi to Claude Code produces a visible stray x character in the prompt area. The x comes from a workaround introduced in b732081 almost a year ago, which the ...
Opengraph URL: https://github.com/coder/agentapi/issues/223
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Stray \"x\" appears at the end of every prompt (leftover Claude Code 0.2.70 workaround)","articleBody":"## Summary\n\nEvery message sent through agentapi to Claude Code produces a visible stray `x` character in the prompt area. The `x` comes from a workaround introduced in [b732081](https://github.com/coder/agentapi/commit/b732081cbbe11a97fcbe1ac772b3a0fd80f36547) almost a year ago, which the commit itself promised to remove \"a couple of days after the new version is released.\"\n\n## Source of the bug\n\n`lib/httpapi/claude.go`, in `formatClaudeCodeMessage`:\n\n```go\n// janky hack: send a random character and then a backspace because otherwise\n// Claude Code echoes the startSeq back to the terminal.\n// This basically simulates a user typing and then removing the character.\nparts = append(parts, st.MessagePartText{Content: \\\"x\\b\\\", Hidden: true})\n```\n\nThe hack was a workaround for a bug in Claude Code 0.2.70 (anthropics/claude-code#803). With current Claude Code versions, the bracketed-paste start sequence is no longer echoed, so the masking `x` is rendered straight into the prompt area and the `\\b` has nothing to erase — net result is a visible `x` on every message.\n\n## Environment\n\n- agentapi **v0.12.1** (latest release as of writing)\n- claude-code **2.1.143**\n\n## Notes\n\n- PR #208 (merged 2026-04-10) touched this same file but only added a doc comment to `formatPaste`; the `x\\b` line was left in place.\n- Possibly related to #207 (\\\"Claude Code 2.1.83 breaks terminal capture\\\") — both look like consequences of Claude Code's rendering pipeline no longer behaving the way the 0.2.70-era workarounds assumed.\n\n## Proposed fix\n\nRemove the `parts = append(parts, st.MessagePartText{Content: \\\"x\\b\\\", Hidden: true})` line. The original Claude Code bug it worked around is long fixed.","author":{"url":"https://github.com/mzihlmann","@type":"Person","name":"mzihlmann"},"datePublished":"2026-05-18T09:00:30.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/223/agentapi/issues/223"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:59421a49-2786-a831-7afc-d29b1b32d66e |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E98E:9E060:E58FE3:14A3AB2:6A4E4FE0 |
| html-safe-nonce | 7eaac1558aa9e40a3de05c3571027621c54a63896e4e4b5563e8a4d30e40f6c9 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFOThFOjlFMDYwOkU1OEZFMzoxNEEzQUIyOjZBNEU0RkUwIiwidmlzaXRvcl9pZCI6IjcyMDQyMjk2ODg1NDkzMzA5MTIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | b964cafbc43dd76046b0cb9c0d8fb854e32af8330b88398e608f35efea70cb57 |
| hovercard-subject-tag | issue:4467723832 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/coder/agentapi/223/issue_layout |
| twitter:image | https://opengraph.githubassets.com/12361ce75dbdec69705b9a28014b70746ef6a51d50036ddccba67e1bf21b3f86/coder/agentapi/issues/223 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/12361ce75dbdec69705b9a28014b70746ef6a51d50036ddccba67e1bf21b3f86/coder/agentapi/issues/223 |
| og:image:alt | Summary Every message sent through agentapi to Claude Code produces a visible stray x character in the prompt area. The x comes from a workaround introduced in b732081 almost a year ago, which the ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | mzihlmann |
| hostname | github.com |
| expected-hostname | github.com |
| None | 030096ee0db095447bfe77409d33bfac127ca7128299c58deef27c52eaa1b1f0 |
| turbo-cache-control | no-preview |
| go-import | github.com/coder/agentapi git https://github.com/coder/agentapi.git |
| octolytics-dimension-user_id | 95932066 |
| octolytics-dimension-user_login | coder |
| octolytics-dimension-repository_id | 961832048 |
| octolytics-dimension-repository_nwo | coder/agentapi |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 961832048 |
| octolytics-dimension-repository_network_root_nwo | coder/agentapi |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | f344f1eab54fc7dfc02d0d018cda7e158c3db65c |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width