MCPcopy Index your code
hub / github.com/codeaashu/claude-code / getSleepGuidance

Function getSleepGuidance

src/tools/PowerShellTool/prompt.ts:33–44  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

31}
32
33function getSleepGuidance(): string | null {
34 if (isEnvTruthy(process.env.CLAUDE_CODE_DISABLE_BACKGROUND_TASKS)) {
35 return null
36 }
37 return ` - Avoid unnecessary \`Start-Sleep\` commands:
38 - Do not sleep between commands that can run immediately — just run them.
39 - If your command is long running and you would like to be notified when it finishes — simply run your command using \`run_in_background\`. There is no need to sleep in this case.
40 - Do not retry failing commands in a sleep loop — diagnose the root cause or consider an alternative approach.
41 - If waiting for a background task you started with \`run_in_background\`, you will be notified when it completes — do not poll.
42 - If you must poll an external process, use a check command rather than sleeping first.
43 - If you must sleep, keep the duration short (1-5 seconds) to avoid blocking the user.`
44}
45
46/**
47 * Version-specific syntax guidance. The model's training data covers both

Callers 1

getPromptFunction · 0.85

Calls 1

isEnvTruthyFunction · 0.85

Tested by

no test coverage detected