Add /edit command to open files in external editor from CLI

Resolved 💬 3 comments Opened Apr 15, 2026 by shlomi-dr Closed May 25, 2026

Feature Request

Add a /edit <file> command to the Claude Code CLI that opens files in the user's preferred external editor.

Use Case

When working in the Claude Code CLI, users often need to make manual edits to files (config files, scripts, etc.). Currently, there's no built-in way to open a file in an editor from within the conversation. Users must either:

  • Switch to another terminal window
  • Ask Claude to make the edits (which can be cumbersome for complex multi-line changes)

Proposed Behavior

/edit ~/.claude/statusline-command.sh

This would:

  1. Open the file in the user's configured editor (respecting $EDITOR or a Claude Code setting)
  2. Wait for the user to save and close the editor
  3. Return control to the Claude Code conversation
  4. Optionally show a diff of what changed

Current Workarounds

  • ! open -e <file> (macOS TextEdit, doesn't wait)
  • ! code <file> (VS Code, if installed)
  • Switching to external terminal
  • Asking Claude to make edits via Edit tool

Related Issues

  • #41753 - Plan editor $EDITOR support (closed/not planned, but related concept)
  • #42222 - Desktop app editor dropdown (different platform)

Platform

macOS (but would benefit all platforms)

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗