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:

  1. Suspends Claude Code (like Ctrl+Z)
  2. Opens the file in a terminal-based editor
  3. 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 $VISUAL then $EDITOR environment variables
  • For GUI editors, existing Bash tool with code file.txt works 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.

View original on GitHub ↗

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