small one but it cost me half a day this week so posting it. if you launch background or parallel sessions from scripts, the prompt usually travels as a file or a heredoc. if that file is missing or empty, the agent does not error. it starts, sees no instructions, does nothing much, and exits clean. your launcher reports success. you find out an hour later when the output you expected doesnt exist. happened to me twice in one day. temp dir got cleaned between writing the prompt file and launching, agent came up with a blank brief, sat there, “completed successfully”. the second time i watched it happen live and the session was just an empty context at 0% with a cheerful exit code. the fix is two lines and feels stupid until it saves you: launcher checks the brief is non empty before launch. literally test -s prompt.txt or it refuses to start first required line of every agent brief: “begin by restating your task in one sentence.” if the restatement doesnt come back, the agent didnt get the brief, kill it. this also catches the sneakier version where the file exists but the wrong file went in bonus rule from the same bad day: never trust an agents own status. done means it can show the artifact, the file path, the url, the diff. an agent saying “completed” with nothing attached is the same as the empty brief, youre just finding out later. i run some of mine through coldtea which keeps the task as a file the agent reads anyway, but the bash version of this is one line and works everywhere. submitted by /u/Specialist_Agent3599
Originally posted by u/Specialist_Agent3599 on r/ClaudeCode
