[FEATURE ENHANCEMENT] Add undo functionality (Ctrl+Z)

Resolved 💬 3 comments Opened Aug 22, 2025 by valdezm Closed Aug 22, 2025

Feature Request

Add the ability to undo actions in the command line interface using Ctrl+Z (Windows) or equivalent shortcuts on other platforms.

Description

Similar to issue #864 which requests vim mode undo functionality, this feature would provide a general undo capability for Claude Code operations in the command line interface. This would allow users to quickly revert recent actions without needing to manually restore previous states.

Use Case

When working in the command line interface, users sometimes need to quickly undo recent operations. Having a standard undo shortcut (Ctrl+Z on Windows, Cmd+Z on Mac) would greatly improve the user experience and workflow efficiency.

Current Limitation

The Escape key is not sufficient for this use case because it kills the entire command line input, clearing all data. We need a more granular undo that only removes the last typed/pasted data while preserving the rest of the input string.

For example, if a user has typed a command and then pastes additional text, they should be able to undo just the paste operation without losing the entire command they had already typed.

Implementation Notes

  • Should work across different operating systems with their respective standard undo shortcuts
  • Could potentially undo file edits, command executions, or other reversible operations
  • Should provide granular undo that doesn't clear the entire input
  • Should provide clear feedback about what action was undone

Related Issues

Similar to #864 but focused on general command line undo rather than vim-specific functionality.

View original on GitHub ↗

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