MCPcopy Create free account
hub / github.com/codeaashu/claude-code / validateInput

Function validateInput

src/tools/BashTool/BashTool.tsx:524–538  ·  view source on GitHub ↗
(input: BashToolInput)

Source from the content-addressed store, hash-verified

522 return `Running ${desc}`;
523 },
524 async validateInput(input: BashToolInput): Promise<ValidationResult> {
525 if (feature('MONITOR_TOOL') && !isBackgroundTasksDisabled && !input.run_in_background) {
526 const sleepPattern = detectBlockedSleepPattern(input.command);
527 if (sleepPattern !== null) {
528 return {
529 result: false,
530 message: `Blocked: ${sleepPattern}. Run blocking commands in the background with run_in_background: true — you'll get a completion notification when done. For streaming events (watching logs, polling APIs), use the Monitor tool. If you genuinely need a delay (rate limiting, deliberate pacing), keep it under 2 seconds.`,
531 errorCode: 10
532 };
533 }
534 }
535 return {
536 result: true
537 };
538 },
539 async checkPermissions(input, context): Promise<PermissionResult> {
540 return bashToolHasPermission(input, context);
541 },

Callers

nothing calls this directly

Calls 2

featureFunction · 0.85

Tested by

no test coverage detected