📚 docs: add background task management guidelines#732
Open
Conversation
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
Contributor
There was a problem hiding this comment.
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
| tail -f /tmp/output.log | ||
|
|
||
| # ✅ CORRECT - use TaskOutput with block=true | ||
| cargo nextest run --workspace # This runs in background automatically |
There was a problem hiding this comment.
There are two spaces between --workspace and the comment. This should be a single space for consistent formatting.
Suggested change
| cargo nextest run --workspace # This runs in background automatically | |
| cargo nextest run --workspace # This runs in background automatically |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds critical guidelines about background task management to CLAUDE.md, specifically warning against using
tail -fto monitor background tasks.Problem
tail -fwas 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:
tail -fto monitor background taskstail -fis accidentally startedChanges
Related Issues
Fixes #731
🤖 Generated with Claude Code