Add /edit <file> command to open files in terminal editors
Status Closed — not planned
Maintainer reply None cached
Activity 3 comments · opened Aug 23, 2025 · closed Jan 4, 2026
Currently, Claude Code can't open files in external editors without breaking the session flow. When trying to run vim file.txt via Bash tool, it spawns in a separate process that can't be accessed.
Request: Add a /edit <file> command that:
- Suspends Claude Code (like Ctrl+Z)
- Opens the file in a terminal-based editor
- Resumes Claude Code when editor exits
Implementation notes:
- Should only support terminal editors (vim, nano, emacs, etc.)
- GUI editors like VSCode would break terminal flow
- Check
$VISUALthen$EDITORenvironment variables - For GUI editors, existing Bash tool with
code file.txtworks fine
Use case: Seamlessly edit files during a Claude Code session without having to exit or use separate terminals.
Example:
> /edit ~/.claude/settings.local.json
[Opens in vim/nano/emacs based on $VISUAL or $EDITOR]
[Returns to Claude Code after :wq]
Similar to how git commit opens an editor and returns to the shell.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗