[Feature] Support semantic prompt zones (OSC 133) for terminal prompt navigation
Preflight Checklist
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
Problem Statement
In long Claude Code sessions, there's no way to quickly jump between user prompts using terminal-native navigation. Every modern terminal emulator (Ghostty, iTerm2, Kitty, WezTerm, VS Code Terminal, Windows Terminal) supports "jump to prompt" via OSC 133 semantic prompt markers — but Claude Code doesn't emit them.
This means:
- Ghostty's
jump_to_promptaction jumps to the shell prompt beforeclaudewas launched — skipping every prompt inside the session - iTerm2's "Select Command Output" doesn't work
- VS Code Terminal's prompt navigation is broken
- Terminal scrollbar gutter marks (showing where prompts are) don't appear
Multiple open issues describe this same pain from different angles:
- #16784 — "Keyboard shortcut to navigate between user prompts"
- #19550 — "Add scroll to previous prompts navigation" (explicitly notes that terminal jump-to-prompt doesn't work)
Previously requested in #1465 (May 2025) and #22528 (Feb 2026) — both autoclosed by the inactivity/duplicate bot without any team response. Filing fresh because the feature gap persists and the prior issues are locked.
Proposed Solution
Emit OSC 133 sequences (A/B/C/D) around Claude Code's REPL cycle. Claude Code already emits OSC 8 (hyperlinks) and OSC 9;4 (progress bars), so the infrastructure for writing escape sequences to stdout exists.
The minimal implementation:
const OSC = '\x1b]';
const ST = '\x07'; // BEL terminator (most compatible)
// Before rendering the prompt:
process.stdout.write(`${OSC}133;A${ST}`);
// After prompt text, before user input area:
process.stdout.write(`${OSC}133;B${ST}`);
// After user submits, before agent output:
process.stdout.write(`${OSC}133;C${ST}`);
// After agent output completes:
process.stdout.write(`${OSC}133;D;0${ST}`);
The full lifecycle maps cleanly to Claude Code's existing REPL:
| Phase | OSC 133 | Claude Code equivalent |
|-------|---------|----------------------|
| Prompt start | 133;A | Before rendering the input prompt / footer |
| Input start | 133;B | After prompt, cursor in text input area |
| Execution start | 133;C | User presses Enter, agent starts working |
| Execution end | 133;D;0 | Agent finishes, ready for next prompt |
Terminals that don't understand OSC 133 silently ignore these sequences (confirmed by fish shell's unconditional emission — PR #10352), so there's zero risk to unsupported terminals.
For additional VS Code Terminal integration, optionally emit the OSC 633 superset when $TERM_PROGRAM === "vscode".
Alternative Solutions
An in-app prompt navigator (as requested in #19550) would also work, but OSC 133 is complementary — it integrates with every terminal's existing navigation without any additional UI, and the implementation is ~4 lines of code.
Priority
High - Significant impact on productivity
Feature Category
Interactive mode (TUI)
Use Case Example
I'm 30 prompts into a debugging session in Ghostty (nightly). I want to revisit an earlier prompt where I asked Claude to analyze a specific file. In any shell, I'd use my terminal's "jump to prompt" shortcut to hop between prompts — but in Claude Code, this jumps all the way back to the shell prompt where I typed claude, skipping every interaction inside the session. The only option is manual scrolling through hundreds of lines of output.
Additional Context
Terminal support for OSC 133 (de facto standard):
Ghostty, iTerm2, Kitty, WezTerm, VS Code Terminal, Windows Terminal, tmux, foot — full spec
Claude Code already emits other OSC sequences:
- OSC 8 for clickable hyperlinks (shipped)
- OSC 9;4 for progress bars (shipped)
Reference implementations:
- Ghostty's zsh integration — full state machine
- Fish shell OSC 133 — unconditional emission, zero terminal detection needed
- Semantic Prompts spec — canonical reference
This would also resolve or partially address #16784 and #19550 for users in terminals that support OSC 133.
9 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
Not a duplicate — here's why each referenced issue doesn't cover this:
Neither #1465 nor #22528 was ever triaged or responded to by the team — they simply expired via the inactivity bot. Both are now locked, making it impossible to comment on or revive them. This is a fresh filing for an unaddressed feature gap.
+1 — Also filed #32635 for this before finding this issue (now closed as duplicate).
Specifically interested in the Ghostty 1.3
cl=lineextension (PR #10455) which enables click-to-move cursor within the prompt input area. Addingcl=lineto the133;Asequence is trivial:This tells the terminal to translate mouse clicks into left/right arrow sequences for cursor repositioning — no shell-side mouse handling needed. Fish 4+ and Nushell 0.111+ already emit this.
Given that Claude Code already emits OSC 8 (hyperlinks) and OSC 9;4 (progress bars), this should be a minimal change with high impact.
+1 on this. I tried to work around this using a
Stophook to set iTerm2 marks via the proprietary escape sequence (\e]1337;SetMark\a), but the TUI swallows the escape sequence entirely — even when writing directly to/dev/tty.I was able to successfully set marks using AppleScript to trigger the menu item:
This did set marks, but they were overwritten by the TUI's screen redraws, making them useless for navigation.
OSC 133 support as proposed here would solve this properly. See also #33686 for the full writeup.
As a Ghostty 1.3 + Linux user, this is my big pain point with Claude Code, especially with dictating text. Every time I instinctively click in Claude Code's input and nothing happens, it's a jarring reminder that the one place I actually interact with this tool has worse UX than a shell prompt.
This has been requested since May 2025. Could we at least get a signal from the team — planned, not planned, needs discussion?
I maintain a fork of Tilix (a VTE-based terminal emulator) and can confirm VTE 0.76+ handles OSC 133 marks internally — Ctrl+Shift+Left/Right scrolls between prompts with zero application code needed. The terminal does all the work, the tool just needs to emit the markers.
I tested this today on Ubuntu 24.04 (VTE 0.76, bash 5.2). Shell prompts are navigable via Ctrl+Shift+Left/Right, but once inside a Claude Code session, the entire session is one opaque block — no marks to jump to. With 30+ conversation turns, the only option is manual scrolling. The contrast between "outside Claude Code" (instant navigation) and "inside Claude Code" (scroll through everything) is stark.
Closing for now — inactive for too long. Please open a new issue if this is still relevant.
Odd that another issue was closed as duplicate in lieu of this and this one was never responded to by Anthropic.
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.