Claude Corner
Long Prompt Cramped in Claude Code's Input Box? Press Ctrl+G and Write It in Your Editor.
By Steven Sorensen · 27 Oct 2026

At a glance
Ctrl+Gmoves the prompt you are typing into your own text editor, and saving sends the text back to Claude Code.- One
/configswitch puts Claude's last reply at the top of that file as comments, so you can answer it point by point. - The same key works on custom answers to Claude's questions and in agent view, and you can rebind it.
You need to give Claude a real brief: the bug, the three files involved, what you already tried and what done looks like. The input box is fine for one line. For twenty, you are hunting for the newline key, scrolling a cramped box and hoping Enter does not send half a thought. Your editor already handles this well, and Claude Code will hand the prompt to it.
Why it matters
The prompt is the cheapest place to save Claude a wrong turn. A brief with clear steps, pasted error lines and a definition of done costs you two minutes to write and can save a round of fixes. In the input box, long prompts get shortened because editing them is awkward. In your editor you get your own keys, search, undo and spell check, and nothing sends until you save and press Enter. If you reply to a long answer, you can also see that answer while you write.
How to write prompts in your editor
We built these steps from Anthropic's docs and have not run them in a live session.
- Tell your shell which editor to use. The docs call it your default text editor, and the agent view docs name
$VISUALor$EDITOR. Set one in your shell profile, then restart Claude Code. - Start typing your prompt, then press
Ctrl+G.Ctrl+X Ctrl+E, the readline-style binding, does the same thing. Whatever you already typed comes along, and editors that take a line number open on the line your cursor was on. - Write the full brief, save and close the editor. The text returns to the input box. Read it once and press
Enter. - Reply to Claude with its answer in view. Run
/configand turn on Show last response in external editor. The file then opens with up to the last 50 lines of Claude's reply as#comment lines above a marker, and only what you write below the marker is sent. - Use it beyond the main prompt. The docs say the key also edits a custom response, such as your own answer when Claude asks a question, and it opens the dispatch prompt in agent view.
- Rebind it if
Ctrl+Gis taken. Run/keybindingsto open~/.claude/keybindings.json, and map a key tochat:externalEditorin theChatcontext.
export VISUAL=vim # shell profile: pick your editor
Ctrl+G # prompt opens in that editor
Ctrl+X Ctrl+E # same, readline style
/config # Show last response in external editor
{ "externalEditorContext": true } # same switch, in ~/.claude.json
/keybindings # rebind chat:externalEditor
Gotchas
- The setting lives in the global file.
externalEditorContextbelongs in~/.claude.json. Claude Code ignores it insettings.json, so a copy there does nothing. - Agent view only takes the single key. In agent view the
Ctrl+X Ctrl+Echord does not open the editor. UseCtrl+G, or a single key you bound tochat:externalEditor. - Short edits do not need it. For a few extra lines,
Ctrl+Jor a backslash thenEnteradds a newline in any terminal, andShift+Enterworks in most. Run/terminal-setuponce in VS Code, Cursor or Zed.
Sources:
- Interactive mode, General controls and Multiline input, Claude Code docs
- Settings reference, externalEditorContext, Claude Code docs
- Keybindings, chat:externalEditor, Claude Code docs
- Agent view, keyboard shortcuts, Claude Code docs
- Terminal configuration, Enter multiline prompts, Claude Code docs
- Claude Code changelog, v2.1.286 cursor-line note
Recommended AI prompt
Copy this paragraph into ChatGPT, Claude, Gemini, Grok, or whatever AI you use.
I use Claude Code in a terminal and my long prompts end up short and messy because the input box is hard to edit. Ask me which text editor I use, which shell and terminal I run, and whether I use agent view. Then tell me exactly what to add to my shell profile so Ctrl+G opens that editor, how to turn on Show last response in external editor, and a short template for a task brief I can fill in each time. Use only behavior described in the official Claude Code docs and link me to the interactive mode page.