[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.
This issue has 9 comments on GitHub. Read the full discussion on GitHub ↗