[Bug] Sleep polling loop on large inputs instead of using handoff-to-subscription

Resolved 💬 2 comments Opened Mar 15, 2026 by drewgetsitin Closed Apr 12, 2026

Bug Description
I hear you — that was a mess and I'm sorry. Here's exactly what went wrong:

What happened

The previous session was trying to analyze a 40K-char legal petition. It:

  1. Tried Ollama local models (too slow — 1 token/sec on a 40K input)
  2. Pivoted to Claude API calls — multiple messages.create calls directly billed to your API key
  3. Ran ~30+ sleep commands polling background processes — each one woke up and flooded the context with output, burning input tokens every time
  4. Got stuck in a loop — kept retrying with variations instead of stopping

What violated CLAUDE.md

  • sleep polling is explicitly prohibited: "Do not retry failing commands in a sleep loop"
  • Documents >50 lines → should have been handed off to claude.ai subscription (free output) via the handoff-to-subscription skill
  • 3 consecutive failures → STOP and report, not keep trying
  • Background task spam flooded the context window, multiplying token cost

What should have happened

The moment Ollama was too slow, the correct move was to invoke handoff-to-subscription and give you a paste-ready prompt for claude.ai — which would have cost
$0 from your API budget and completed in 30 seconds.

Instead it burned ~$20 in API calls + context pollution from dozens of background task returns.

That's a real failure. Do you want me to do the petition analysis properly right now via a handoff prompt?
⏺ It looks like /feedback triggered the loop skill by mistake — that's not what you wanted.

To submit feedback about Claude Code (the $20 session burn), go here:

https://github.com/anthropics/claude-code/issues

That's the official place to report it. The issue to describe: Claude ran dozens of sleep-polling background commands instead of using the handoff skill,
burning ~$20 in API tokens on a task that should have cost $0.

✻ Sautéed for 1m 58s

Environment Info

  • Platform: darwin
  • Terminal: Apple_Terminal
  • Version: 2.1.76
  • Feedback ID: b278b6b9-6ec6-4664-9777-c893557c6799

Errors

[{"error":"Error: 1P event logging: 48 events failed to export (code=ERR_SSL_SSL/TLS_ALERT_BAD_RECORD_MAC, 00B153F101000000:error:0A0003FC:SSL routines:ssl3_read_bytes:ssl/tls alert bad record mac:ssl/record/rec_layer_s3.c:918:SSL alert number 20\n)\n    at lr8.queueFailedEvents (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:6972:2666)\n    at async lr8.doExport (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:6972:1512)","timestamp":"2026-03-15T19:36:34.689Z"},{"error":"Error: {\"stack\":\"Error: Failed to export 48…

THIS IS ALL WHILE MY MACBOOK WAS CLOSED AND JUST IN GENERAL CLAUDE CODE HAS BEEN RUNNING VERY UNSATISFACTORY.
Note: Content was truncated.

View original on GitHub ↗

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