[BUG] Tool Execution Interruption Causes Loss of Context and File Modification Tracking
Resolved 💬 3 comments Opened May 19, 2025 by n0isy Closed Jan 3, 2026
Description
When using Claude Code with tools that involve code modifications, there's a critical issue where user interruption leads to complete loss of context about what was attempted and which files were being modified.
Steps to Reproduce
- Call a tool (e.g.,
Task) that includes code modification processes - When prompted by the system, user responds with "NO" or interrupts the operation
- The tool execution is interrupted
- No results are returned from the tool
- Claude loses all context about which files were being analyzed or modified
Expected Behavior
- Even when a tool execution is interrupted, Claude should receive some information about what was attempted
- At minimum, a list of files that were going to be modified should be returned
- The interruption status should be clearly communicated back to Claude
Actual Behavior
- Tool returns no output at all when interrupted
- Claude has no awareness of what files were being processed
- Context is completely lost, requiring the conversation to restart from scratch
Impact
- Poor user experience as Claude cannot continue the conversation meaningfully
- Need to repeat discovery/analysis steps after interruption
- Risk of confusion about project state after interrupted operations
Suggested Solutions
- Return partial results even on interruption, including:
- List of files that were being analyzed
- Files that were going to be modified
- Current step when interruption occurred
- Implement a "dry-run" mode for tools that shows planned changes before execution
- Add explicit interruption handling that returns structured information about the interrupted operation
Environment
- Claude Code CLI v0.2.120
- Occurs with any tool that performs code modifications
- Reproducible across different project types
Additional Context
This issue significantly impacts the ability to have coherent conversations about code modifications when users need to review or decline proposed changes.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗