[BUG] Stuck/zombie session consumes API quota while unresponsive

Resolved 💬 3 comments Opened Apr 2, 2026 by robfrosty Closed Apr 6, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

Claude Code session became unresponsive (locked up during a grep/search operation) but continued consuming API session quota in the background. Process showed 78% CPU, 3.6GB RAM, and 165+ minutes of CPU time while completely stuck. Closing the terminal did NOT terminate the process. Had to manually find and kill -9 it. By the time I discovered this, 97% of my daily session limit had been consumed by the zombie process doing nothing useful.

This feels like theft of quota - I should not be charged for a stuck process.

What Should Happen?

Sessions that become unresponsive should timeout or stop consuming quota

  1. Closing a terminal should cleanly terminate the Claude Code process
  2. Stuck sessions should timeout and stop consuming quota
  3. Users should be able to recover quota consumed by unresponsive processes

Error Messages/Logs

No error - process just hung. Had to find and kill manually:                                                                                                   
                                                                                                                                                                 
  $ ps aux | grep claude                                                                                                                                         
  ******   2649606 78.4 12.0 88282356 3600128 ?  Rl  10:48 165:02 claude                                                                                         
                                                                                                                                                                 
  $ kill 2649606      # ignored                                                                                                                                  
  $ kill -9 2649606   # required to terminate

Steps to Reproduce

Steps to Reproduce:

  1. Start Claude Code session
  2. Perform search/exploration on a codebase
  3. Session becomes unresponsive (frozen, no output)
  4. Close terminal window
  5. Process continues running in background (visible via ps aux | grep claude)
  6. Check API quota - being consumed by zombie process

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.7

Platform

Anthropic API

Operating System

Other Linux

Terminal/Shell

Xterm

Additional Information

Request: Please credit back the quota consumed by this stuck process.
Approximately 97% of my session limit was consumed while the process
was unresponsive and I was unable to use it.

I'm on the Max plan. Having 97% of my higher-tier quota
consumed by a stuck process represents significant wasted value.

Max users are paying for premium capacity - Anthropic should absolutely make this right.

The process detached from the terminal (note the "?" in TTY column of ps output)
which suggests it's not properly handling terminal close/SIGHUP signals.

Kernel: 5.14.0-570.60.1.el9_6.x86_64

View original on GitHub ↗

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