source dump of claude code
at main 26 lines 720 B view raw
1/** 2 * Tracks commands recently denied by the auto mode classifier. 3 * Populated from useCanUseTool.ts, read from RecentDenialsTab.tsx in /permissions. 4 */ 5 6import { feature } from 'bun:bundle' 7 8export type AutoModeDenial = { 9 toolName: string 10 /** Human-readable description of the denied command (e.g. bash command string) */ 11 display: string 12 reason: string 13 timestamp: number 14} 15 16let DENIALS: readonly AutoModeDenial[] = [] 17const MAX_DENIALS = 20 18 19export function recordAutoModeDenial(denial: AutoModeDenial): void { 20 if (!feature('TRANSCRIPT_CLASSIFIER')) return 21 DENIALS = [denial, ...DENIALS.slice(0, MAX_DENIALS - 1)] 22} 23 24export function getAutoModeDenials(): readonly AutoModeDenial[] { 25 return DENIALS 26}