Skip to content

📚 docs: add background task management guidelines#732

Open
codekiln wants to merge 2 commits intomainfrom
i731-add-background-task-guidelines
Open

📚 docs: add background task management guidelines#732
codekiln wants to merge 2 commits intomainfrom
i731-add-background-task-guidelines

Conversation

@codekiln
Copy link
Owner

@codekiln codekiln commented Jan 23, 2026

Summary

Adds critical guidelines about background task management to CLAUDE.md, specifically warning against using tail -f to monitor background tasks.

Problem

tail -f was used twice to monitor background task output, leaving processes running indefinitely that required manual cleanup with KillShell.

Solution

Added new section to CLAUDE.md with:

  • Clear warning: NEVER use tail -f to monitor background tasks
  • Correct approach: Use TaskOutput tool with block=true
  • Rules for cleanup if tail -f is accidentally started

Changes

  • Added "Background Task Management" section after "Output Token Budget"
  • Documented correct vs incorrect patterns with examples
  • Added rules for handling background tasks properly

Related Issues

Fixes #731


🤖 Generated with Claude Code


Note

Low Risk
Low risk documentation-only change that doesn’t affect runtime behavior. Main risk is minor: guidance could be misapplied if the described tooling behavior differs from reality.

Overview
Adds a new Background Task Management section to CLAUDE.md that explicitly forbids using tail -f to monitor background jobs.

Documents the preferred pattern for waiting on background work via TaskOutput with block=true, and adds cleanup rules (use KillShell if tail -f is started) to avoid leaving long-running processes behind.

Written by Cursor Bugbot for commit f213634. This will update automatically on new commits. Configure here.

Add critical warning about never using tail -f to monitor background tasks,
which leaves processes running indefinitely. Document correct approach using
TaskOutput tool.

Fixes #731
Copilot AI review requested due to automatic review settings January 23, 2026 19:37
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds critical guidelines to CLAUDE.md about background task management, specifically addressing the problem of using tail -f to monitor background tasks, which leaves processes running indefinitely.

Changes:

  • Added new "Background Task Management" section with clear warnings and best practices
  • Documented correct approach using TaskOutput tool with block=true
  • Provided concrete examples of wrong vs. correct patterns

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings March 18, 2026 07:39
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.


You can also share your feedback on Copilot code review. Take the survey.

Comment on lines +65 to +66
cargo nextest run --workspace # This runs in background automatically
# Then use TaskOutput tool with block=true to wait for completion
Comment on lines +69 to +73
**Rules:**
- Use `TaskOutput` tool with `block=true` to wait for background command completion
- NEVER use `tail -f` - it runs until manually killed
- If you accidentally start `tail -f`, immediately use `KillShell` to stop it
- Background tasks from Bash tool are automatically monitored - don't add extra monitoring
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add background task management guidelines to CLAUDE.md

2 participants