MCPcopy Create free account

hub / github.com/anthropics/claude-code / functions

Functions167 in github.com/anthropics/claude-code

↓ 1 callersFunctioncap_diff_for_prompt
Cap per-file and total diff bytes; return (capped_files, bytes_dropped). Truncation markers are written inside the content so the reviewer kn
plugins/security-guidance/hooks/review_api.py:31
↓ 1 callersFunctioncapture_git_baseline
Capture a git ref representing the current working tree state. Uses `git stash create` which creates a commit object for the current state
plugins/security-guidance/hooks/diffstate.py:163
↓ 1 callersFunctioncleanup_old_state_files
Remove state files and lock files older than 30 days.
plugins/security-guidance/hooks/session_state.py:49
↓ 1 callersFunctioncloseExpired
(owner: string, repo: string)
scripts/sweep.ts:92
↓ 1 callersFunctioncloseIssueAsDuplicate
( owner: string, repo: string, issueNumber: number, duplicateOfNumber: number, token: string )
scripts/auto-close-duplicates.ts:66
↓ 1 callersFunctioncompile_regex
Compile regex pattern with caching. Args: pattern: Regex pattern string Returns: Compiled regex pattern
plugins/hookify/core/rule_engine.py:15
↓ 1 callersFunctioncompute_v2_review_set
v2 diff strategy: derive the review set from git state alone. review_set = (files dirty vs current HEAD, plus files committed this turn when
plugins/security-guidance/hooks/diffstate.py:353
↓ 1 callersFunctionconsume_stop_state
Atomically snapshot all state the Stop hook needs and clear touched_paths. The Stop hook is asyncRewake — it runs in the background after Claude'
plugins/security-guidance/hooks/diffstate.py:74
↓ 1 callersFunctionextractDuplicateIssueNumber
(commentBody: string)
scripts/auto-close-duplicates.ts:49
↓ 1 callersFunctionextract_content_from_input
Extract content to check from tool input based on tool type.
plugins/security-guidance/hooks/security_reminder_hook.py:429
↓ 1 callersFunctionfilter_preexisting_from_diff
Filter out pre-existing content from diff files. When a file is fully rewritten (Write tool replaces entire content), git shows all lines
plugins/security-guidance/hooks/gitutil.py:657
↓ 1 callersFunctionget_baseline_file_content
Get the content of a file at the baseline SHA. Returns None if unavailable.
plugins/security-guidance/hooks/diffstate.py:140
↓ 1 callersFunctionget_git_diff
Get the git diff between the baseline SHA and the current working tree, including untracked (new) files. Uses a temporary copy of the gi
plugins/security-guidance/hooks/gitutil.py:391
↓ 1 callersFunctionget_lock_file
Get session-specific lock file path.
plugins/security-guidance/hooks/session_state.py:43
↓ 1 callersFunctionhandle_commit_review_posttooluse
PostToolUse handler for Bash — reviews git commits for security issues. Runs as asyncRewake: detects `git commit` in the Bash command, parses
plugins/security-guidance/hooks/security_reminder_hook.py:901
↓ 1 callersFunctionhandle_push_sweep_posttooluse
Review the just-pushed range as one diff, advancing the base past the contiguous prefix of already-per-commit-reviewed shas. Spec: review `gi
plugins/security-guidance/hooks/security_reminder_hook.py:1378
↓ 1 callersFunctionhandle_stop_hook
Handle the Stop hook — final security check using git diff. Diffs against the baseline SHA captured at UserPromptSubmit to review only co
plugins/security-guidance/hooks/security_reminder_hook.py:1700
↓ 1 callersFunctionhandle_user_prompt_submit
Handle UserPromptSubmit — capture git baseline SHA. Called on every user prompt. Updates the baseline so the stop hook only reviews chang
plugins/security-guidance/hooks/security_reminder_hook.py:446
↓ 1 callersFunctionis_commit_review_enabled
Gate for the commit-review PostToolUse[Bash] hook. Commit review is enabled by default; ENABLE_COMMIT_REVIEW=0 remains the unconditional kill
plugins/security-guidance/hooks/security_reminder_hook.py:815
↓ 1 callersFunctionis_push_sweep_enabled
Gate for the push-sweep PostToolUse[Bash] hook. Enabled by default. ENABLE_COMMIT_REVIEW=0 remains the unconditional kill switch (push-sweep
plugins/security-guidance/hooks/security_reminder_hook.py:698
↓ 1 callersFunctionload_baseline_sha
Load the git baseline SHA from state.
plugins/security-guidance/hooks/diffstate.py:50
↓ 1 callersFunctionload_rule_file
Load a single rule file. Returns: Rule object or None if file is invalid.
plugins/hookify/core/config_loader.py:244
↓ 1 callersFunctionload_state
Load the full state dict from file.
plugins/security-guidance/hooks/session_state.py:88
↓ 1 callersFunctionmain
Run the bootstrap. Returns (outcome, err_phase, err_kind). err_phase / err_kind are non-empty only on BUILD_FAILED — they let telemetry split
plugins/security-guidance/hooks/ensure_agent_sdk.py:57
↓ 1 callersFunctionmain
Main hook function.
plugins/security-guidance/hooks/security_reminder_hook.py:2019
↓ 1 callersFunctionmain
Main entry point for PostToolUse hook.
plugins/hookify/hooks/posttooluse.py:30
↓ 1 callersFunctionmain
Main entry point for PreToolUse hook.
plugins/hookify/hooks/pretooluse.py:35
↓ 1 callersFunctionmain
Main entry point for UserPromptSubmit hook.
plugins/hookify/hooks/userpromptsubmit.py:30
↓ 1 callersFunctionmain
Main entry point for Stop hook.
plugins/hookify/hooks/stop.py:30
↓ 1 callersFunctionmain
()
examples/hooks/bash_command_validator_example.py:56
↓ 1 callersFunctionmarkStale
(owner: string, repo: string)
scripts/sweep.ts:45
↓ 1 callersFunctionrecord_pending_warnings
Mark file:rule pairs as pending for the Stop-hook outcome sweep.
plugins/security-guidance/hooks/security_reminder_hook.py:321
↓ 1 callersFunctionrecord_touched_path
Append a file path to the touched_paths list (deduped, capped at 200). Stop is the consumer and clears under the same lock it reads with; UPS
plugins/security-guidance/hooks/diffstate.py:57
↓ 1 callersFunctionsave_state
Save the full state dict to file.
plugins/security-guidance/hooks/session_state.py:104
↓ 1 callersFunctionsweep_pending_warnings
Stop-hook final sweep. Re-read every file in pending_warnings, re-check patterns, and return (fixed, unresolved, unresolved_mask). Clears sta
plugins/security-guidance/hooks/security_reminder_hook.py:332
↓ 1 callersFunctiontriggerDedupeWorkflow
( owner: string, repo: string, issueNumber: number, token: string, dryRun: boolean = true )
scripts/backfill-duplicate-comments.ts:47
Method__init__
Initialize rule engine.
plugins/hookify/core/rule_engine.py:30
Function_agentic
()
plugins/security-guidance/hooks/security_reminder_hook.py:865
Function_check
(state)
plugins/security-guidance/hooks/security_reminder_hook.py:243
Function_fallback
()
plugins/security-guidance/hooks/security_reminder_hook.py:875
Function_leg
()
plugins/security-guidance/hooks/llm.py:559
Function_load
(state)
plugins/security-guidance/hooks/diffstate.py:52
Function_read_previous
(state)
plugins/security-guidance/hooks/security_reminder_hook.py:1220
Function_record
(state)
plugins/security-guidance/hooks/diffstate.py:65
Function_record
(state)
plugins/security-guidance/hooks/security_reminder_hook.py:323
Function_record_findings
(state)
plugins/security-guidance/hooks/security_reminder_hook.py:1346
Function_record_fire
(state)
plugins/security-guidance/hooks/security_reminder_hook.py:1896
Function_restore
(state)
plugins/security-guidance/hooks/diffstate.py:129
Function_save
(state)
plugins/security-guidance/hooks/diffstate.py:45
Function_save
(state)
plugins/security-guidance/hooks/security_reminder_hook.py:488
Function_score
(item)
plugins/security-guidance/hooks/gitutil.py:527
Function_snap
(state)
plugins/security-guidance/hooks/diffstate.py:89
Function_sweep
(state)
plugins/security-guidance/hooks/security_reminder_hook.py:339
Function_tolerant
(data)
plugins/security-guidance/hooks/llm.py:1194
Functionanalyze_security_concerns
Run a higher-level security concerns analysis on files/diffs. Identifies AREAS OF CONCERN that the main model should investigate. Returns
plugins/security-guidance/hooks/llm.py:1570
Functionatomic_check_counter
Atomically check if a counter has reached its limit and increment if not. Returns True if the counter is below max_count (should proceed),
plugins/security-guidance/hooks/security_reminder_hook.py:253
Functionbuild_investigate_prompt
( touched_paths: list[str], diff_files: list[tuple[str, str]], *, context_note: str = "", )
plugins/security-guidance/hooks/review_api.py:156
Functionbuild_refute_prompt
(candidates: list[dict[str, Any]], diff_text: str)
plugins/security-guidance/hooks/review_api.py:210
Functionextract_file_paths_from_diff
Extract file paths from unified diff output (without content). Only includes files with source code extensions. Returns a list of file pa
plugins/security-guidance/hooks/gitutil.py:587
Functionfilter_by_severity
Medium-included is the validated default; the model's investigate-stage severity is conservative and dropping mediums before self-refute filters
plugins/security-guidance/hooks/review_api.py:350
Functionformat_findings
Render findings as the same text block the CC plugin emits to Claude.
plugins/security-guidance/hooks/review_api.py:368
Methodfrom_dict
Create Condition from dict.
plugins/hookify/core/config_loader.py:23
Functionguidance_block
The wrapped <project-security-guidance> block, or empty string.
plugins/security-guidance/hooks/extensibility.py:79
Functionload_for_session
Load project-specific guidance and patterns once per hook invocation. Called from the hook's main() before dispatching. Failures are non-fatal —
plugins/security-guidance/hooks/extensibility.py:60
Functionsave_baseline_sha
Save the git baseline SHA to state.
plugins/security-guidance/hooks/diffstate.py:43
Functiontag_diff_anchor
SOFT diff-intersect: tag each candidate ``_diff_anchor: "in_diff" | "off_diff"`` and sort in_diff first; do NOT drop. Investigate reads full
plugins/security-guidance/hooks/review_api.py:291
Functionuser_patterns
User-supplied pattern rules in the same shape as SECURITY_PATTERNS.
plugins/security-guidance/hooks/extensibility.py:84
← previous101–167 of 167, ranked by callers