[BUG] Session hangs at 0 tokens after background task completes with --dangerously-skip-permissions

Resolved 💬 3 comments Opened Jan 22, 2026 by PxPerfectMike Closed Jan 26, 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?

When using --dangerously-skip-permissions mode and running a background task (like starting a dev server), the session hangs after the task completes.
The thinking indicator shows "0 tokens" indefinitely and never returns to the prompt.

The API connection works fine - simple prompts via echo "hello" | claude --print succeed. The issue is specific to sessions with background tasks in
--dangerously-skip-permissions mode.

What Should Happen?

After the background task completes, Claude should finish its response and return to the input prompt, ready for the next command.

Error Messages/Logs

No error message - just hangs indefinitely at the thinking indicator (e.g., "Concocting...", "Transfiguring...") showing "0 tokens" with no response.

Steps to Reproduce

  1. Navigate to a project with a dev server (e.g., a Tauri/Vite project)
  2. Run claude --dangerously-skip-permissions
  3. Ask Claude to "start the dev server" (or any command that triggers a background bash task)
  4. Wait for the background task to complete successfully
  5. Observe the thinking indicator shows "0 tokens" and never completes

Note: Running echo "hello" | claude --print works fine, confirming API connectivity is not the issue. The bug only occurs after background task completion in --dangerously-skip-permissions mode.

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

Last NPM version that was available.

Claude Code Version

2.1.15 (Claude Code)

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

Windows Terminal

Additional Information

  • Running without --dangerously-skip-permissions does not exhibit this issue
  • /tasks shows no background tasks when the hang occurs
  • Fresh sessions work until a background task completes
  • Killing the hung session and starting fresh temporarily resolves it

View original on GitHub ↗

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