Agent repeatedly polls background tasks despite explicit user instructions to stop
Description
When a background task is running, Claude Code repeatedly reads the task output file to check for progress, even after the user has:
- Explicitly asked it to stop polling multiple times
- Claude acknowledged the feedback and even updated a memory file about it
- The user escalated ("you did it again. What's the deal")
The polling continues as an apparent compulsive loop where Claude reads the same output file over and over (observed 15+ times in a single conversation), always getting the same result, despite having no new information to act on.
Expected behavior
When a command is run with run_in_background: true, Claude should wait for the completion notification and not poll the output file unless the user asks for a status update.
Actual behavior
Claude keeps issuing cat commands to read the background task output file in a tight loop, even after being told to stop. The behavior persists across multiple user corrections within the same conversation.
Environment
- Model: claude-opus-4-6 (1M context)
- Platform: Linux (WSL2)
- The background task was a long-running Python script (~30+ minutes)
Reproduction
- Start a long-running command with
run_in_background: true - Tell Claude to wait and not poll
- Observe that Claude continues to poll the output file
🤖 Generated with Claude Code
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗