Skip to main content

How to Edit Prompts in External Editor in Claude Code

Press Ctrl+G in Claude Code to open your prompt in your system's configured text editor. This feature (introduced in v2.0.10) makes composing long, complex prompts dramatically easier with full editor capabilities.


How It Works

  1. Press Ctrl+G while typing your prompt in Claude Code.
  2. Your default editor opens with current prompt content.
  3. Edit with full editor features (syntax highlighting, multi-cursor, templates).
  4. Save and close the editor.
  5. Prompt automatically returns to Claude Code, ready to send.


When to Use External Editor

  • Long prompts - Multi-paragraph requirements, detailed specifications, complex instructions.
  • Formatted content - Code snippets, markdown formatting, structured documentation.
  • Reusable templates - Maintain prompt templates with syntax highlighting and version control.
  • Code-heavy prompts - Large code examples that benefit from editor validation.
Template Workflow

Create a prompt templates directory with common patterns (feature requests, code reviews, refactoring). Press Ctrl+G, load template, fill in specifics, send to Claude. This combines AI power with editor expertise.


See Also: Claude Code Tips|How to Write Better Prompts|What is Bash Mode