MCPcopy
hub / github.com/anthropics/claude-code / _skip

Function _skip

plugins/security-guidance/hooks/security_reminder_hook.py:1750–1761  ·  view source on GitHub ↗
(reason, restore=False, **extra)

Source from the content-addressed store, hash-verified

1748 v2_metrics = {}
1749
1750 def _skip(reason, restore=False, **extra):
1751 if restore:
1752 restore_unreviewed_stop_state(session_id, touched_paths, snap_baseline)
1753 # CC truncates metrics to 10 keys by
1754 # insertion order. v2_metrics (3) must precede sweep (3) so the v2
1755 # diagnostics survive when extra adds touched_paths_count + ip_* keys.
1756 emit_metrics({
1757 "skipped": True, "skip_reason": reason, "fire_index": fire_count + 1,
1758 "diff_strategy_v2": True,
1759 **v2_metrics, **extra, **sweep,
1760 })
1761 sys.exit(0)
1762
1763 # Limit stop hook firings per asyncRewake loop to prevent infinite loops.
1764 # fire_count auto-expires after STOP_LOOP_STATE_TTL_SEC so a stale count

Callers 1

handle_stop_hookFunction · 0.85

Calls 2

emit_metricsFunction · 0.85

Tested by

no test coverage detected