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:
- Open the file in the user's configured editor (respecting
$EDITORor a Claude Code setting) - Wait for the user to save and close the editor
- Return control to the Claude Code conversation
- 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
$EDITORsupport (closed/not planned, but related concept) - #42222 - Desktop app editor dropdown (different platform)
Platform
macOS (but would benefit all platforms)
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗