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

Function getRestrictionsFromCache

src/services/policyLimits/index.ts:531–549  ·  view source on GitHub ↗

* Get restrictions synchronously from session cache or file

()

Source from the content-addressed store, hash-verified

529 * Get restrictions synchronously from session cache or file
530 */
531function getRestrictionsFromCache():
532 | PolicyLimitsResponse['restrictions']
533 | null {
534 if (!isPolicyLimitsEligible()) {
535 return null
536 }
537
538 if (sessionCache) {
539 return sessionCache
540 }
541
542 const cachedRestrictions = loadCachedRestrictions()
543 if (cachedRestrictions) {
544 sessionCache = cachedRestrictions
545 return cachedRestrictions
546 }
547
548 return null
549}
550
551/**
552 * Load policy limits during CLI initialization

Callers 1

isPolicyAllowedFunction · 0.85

Calls 2

isPolicyLimitsEligibleFunction · 0.85
loadCachedRestrictionsFunction · 0.85

Tested by

no test coverage detected