Ctrl+G vim editor: content lost when file is saved and closed — empty message sent
Bug
When using Ctrl+G to open the vim editor for writing a long inline message:
- Write substantial content (30+ minutes of detailed review)
- Save with
:wq - The vim editor closes
- An empty screen appears — the content is gone
- The message sent to Claude is empty or just the complaint about losing it
This happened twice in the same session. The content was NOT captured in:
- The session jsonl (only a 63-char complaint message appeared, not the 30-min document)
- The temp file (deleted after vim closes:
/private/var/folders/fm/.../T/claude-prompt-*.md) - The viminfo registers only captured the last yank/delete (a few lines), not the full document
Expected behavior
When the user writes content in the Ctrl+G vim editor and saves with :wq, that content should be sent as the user's message to Claude. It should appear in the conversation and be persisted in the session jsonl.
Actual behavior
The content vanishes. The temp file is deleted. The message sent is empty. 30 minutes of detailed technical review is lost with no recovery path.
Environment
- macOS Darwin 25.3.0
- Vim 9.1
- Claude Code (latest)
Workaround
Before :wq, manually save a copy: :w /tmp/backup.md
Impact
This is a data loss bug. Users writing long-form feedback, reviews, or detailed technical content via Ctrl+G lose their work with no warning and no recovery. The viminfo file only preserves the last few register operations, not the full document content.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗