Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/anthropics/claude-code
/ functions
Functions
349 in github.com/anthropics/claude-code
⨍
Functions
349
◇
Types & classes
10
↓ 1 callers
Function
_model_supports_adaptive_thinking
True for models that reject the budget_tokens thinking form (4.6+).
plugins/security-guidance/hooks/llm.py:226
↓ 1 callers
Function
_once
()
plugins/security-guidance/hooks/llm.py:347
↓ 1 callers
Function
_plugin_version_int
()
plugins/security-guidance/hooks/ensure_agent_sdk.py:45
↓ 1 callers
Function
_probe_anthropic
(timeout: float = 5.0)
plugins/security-guidance/hooks/llm.py:102
↓ 1 callers
Function
_read_config
Read a YAML or JSON config file. Returns None on missing/malformed.
plugins/security-guidance/hooks/extensibility.py:171
↓ 1 callers
Function
_read_plugin_version_int
Encode plugin.json version "M.m.p" as M*10000 + m*100 + p so it fits the bool|number metrics constraint. Returns 0 if unreadable.
plugins/security-guidance/hooks/_base.py:70
↓ 1 callers
Method
_regex_match
Check if pattern matches text using regex. Args: pattern: Regex pattern text: Text to match against Returns:
plugins/hookify/core/rule_engine.py:256
↓ 1 callers
Function
_render
(items)
plugins/security-guidance/hooks/llm.py:661
↓ 1 callers
Function
_resolve_amend_pre_sha
For a `git commit --amend` we just ran, return the pre-amend SHA via reflog, or None if it can't be safely determined. expected_post_sha: the
plugins/security-guidance/hooks/security_reminder_hook.py:517
↓ 1 callers
Method
_rule_matches
Check if rule matches input data. Args: rule: Rule to evaluate input_data: Hook input data Returns:
plugins/hookify/core/rule_engine.py:96
↓ 1 callers
Function
_run
(system: str, prompt: str, *, schema: Dict[str, Any] )
plugins/security-guidance/hooks/llm.py:1291
↓ 1 callers
Function
_run
(env)
plugins/security-guidance/hooks/gitutil.py:309
↓ 1 callers
Function
_scrub
(s: object)
plugins/security-guidance/hooks/llm.py:1339
↓ 1 callers
Function
_sdk_on_syspath
()
plugins/security-guidance/hooks/ensure_agent_sdk.py:35
↓ 1 callers
Function
_skip
(reason, restore=False, **extra)
plugins/security-guidance/hooks/security_reminder_hook.py:1750
↓ 1 callers
Function
_strip_anthropic_from_no_proxy
()
plugins/security-guidance/hooks/llm.py:113
↓ 1 callers
Function
_unchanged_since_baseline
(p)
plugins/security-guidance/hooks/diffstate.py:390
↓ 1 callers
Function
_usage_metrics
Snapshot the accumulator as metric keys. Returns {} when no API calls were made so skip-path emits don't burn key budget. cost_usd rounded to
plugins/security-guidance/hooks/_base.py:142
↓ 1 callers
Function
_validate_command
(command: str)
examples/hooks/bash_command_validator_example.py:48
↓ 1 callers
Function
_validate_pattern
Validate one user pattern entry. Returns a rule dict in the same shape as the built-in SECURITY_PATTERNS, or None if invalid (logged).
plugins/security-guidance/hooks/extensibility.py:199
↓ 1 callers
Function
_wrap_guidance
(guidance: str)
plugins/security-guidance/hooks/extensibility.py:128
↓ 1 callers
Function
actionsOf
(engine: Host)
mods/diff/hooks/register.ts:325
↓ 1 callers
Function
arm
(engine: Host, path: string)
mods/diff/hooks/register.ts:386
↓ 1 callers
Function
at
(i: number, j: number)
mods/diff/hooks/word-diff/diff-parts/diff-parts.ts:25
↓ 1 callers
Function
atomic_check_and_mark_warning
Atomically check if a warning has been shown and mark it as shown if not. Returns True if this is the first time seeing this warning (should
plugins/security-guidance/hooks/security_reminder_hook.py:237
↓ 1 callers
Function
autoCloseDuplicates
()
scripts/auto-close-duplicates.ts:99
↓ 1 callers
Function
backendHostOf
(engine: Host)
mods/diff/hooks/register.ts:56
↓ 1 callers
Function
backfillDuplicateComments
()
scripts/backfill-duplicate-comments.ts:72
↓ 1 callers
Function
bind
(engine: Host)
mods/diff/hooks/register.ts:402
↓ 1 callers
Function
branchSourceOf
( base: Types.ResolvedBranchBase, )
mods/diff/hooks/git/tiers/branch-source-of/branch-source-of.ts:10
↓ 1 callers
Function
cap_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 callers
Function
capture_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 callers
Function
cellWidth
(text: string)
mods/diff/hooks/views/layout/cell-width/cell-width.ts:15
↓ 1 callers
Function
checkedValue
( key: string, value: unknown, )
mods/telemetry/hooks/entries/checked-value/checked-value.ts:17
↓ 1 callers
Function
cleanup_old_state_files
Remove state files and lock files older than 30 days.
plugins/security-guidance/hooks/session_state.py:49
↓ 1 callers
Function
closeExpired
(owner: string, repo: string)
scripts/sweep.ts:92
↓ 1 callers
Function
closeIssueAsDuplicate
( owner: string, repo: string, issueNumber: number, duplicateOfNumber: number, token: string )
scripts/auto-close-duplicates.ts:66
↓ 1 callers
Function
closePane
(engine: Host)
mods/diff/hooks/register.ts:278
↓ 1 callers
Function
compile_regex
Compile regex pattern with caching. Args: pattern: Regex pattern string Returns: Compiled regex pattern
plugins/hookify/core/rule_engine.py:15
↓ 1 callers
Function
compute_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 callers
Function
consume_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 callers
Function
currentBranchOf
(run: Types.GitRun)
mods/diff/hooks/git/probes/current-branch-of/current-branch-of.ts:10
↓ 1 callers
Function
currentOf
(engine: Host)
mods/diff/hooks/register.ts:54
↓ 1 callers
Function
currentPane
( kit: Kit, model: PaneState.PaneModel, )
mods/diff/hooks/views/current-pane/current-pane.tsx:28
↓ 1 callers
Function
cutHunks
( hunks: readonly Types.Hunk[], )
mods/diff/hooks/git/cut-hunks/cut-hunks.ts:14
↓ 1 callers
Function
datingOf
(stamp: Types.Stamp)
mods/diff/hooks/git/probes/datings-of/datings-of.ts:26
↓ 1 callers
Function
defaultBranchOf
(run: Types.GitRun)
mods/diff/hooks/git/probes/default-branch-of/default-branch-of.ts:14
↓ 1 callers
Function
depsOf
()
mods/diff/hooks/git/git-backend-of.ts:48
↓ 1 callers
Function
diffParts
( before: readonly string[], after: readonly string[], )
mods/diff/hooks/word-diff/diff-parts/diff-parts.ts:14
↓ 1 callers
Function
emit
(text: string, kind: WordPart['kind'])
mods/diff/hooks/word-diff/diff-parts/diff-parts.ts:38
↓ 1 callers
Function
extractDuplicateIssueNumber
(commentBody: string)
scripts/auto-close-duplicates.ts:49
↓ 1 callers
Function
extract_content_from_input
Extract content to check from tool input based on tool type.
plugins/security-guidance/hooks/security_reminder_hook.py:429
↓ 1 callers
Function
fetchDiff
( deps: Types.GitDeps, mode: Types.BaseMode, )
mods/diff/hooks/git/fetch-diff.ts:16
↓ 1 callers
Function
fetchFileHunks
( run: Types.GitRun, data: Types.DiffData, file: Types.FileStat, )
mods/diff/hooks/git/fetch-file-hunks.ts:19
↓ 1 callers
Function
fetched
()
mods/diff/hooks/register.ts:203
↓ 1 callers
Function
fieldsOf
(event: string, props: Fields['props'])
mods/telemetry/hooks/entries/fields-of/fields-of.ts:11
↓ 1 callers
Function
fileEditOf
(result: unknown)
mods/diff/hooks/turns/turn-of/file-edit-of/file-edit-of.ts:16
↓ 1 callers
Function
fileRowOf
( file: Git.FileStat, selectedPath: string | null, )
mods/diff/hooks/views/current-pane/file-row-of/file-row-of.ts:12
↓ 1 callers
Function
filter_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 callers
Function
get_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 callers
Function
get_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 callers
Function
get_lock_file
Get session-specific lock file path.
plugins/security-guidance/hooks/session_state.py:43
↓ 1 callers
Function
gutterCellsOf
(lines: readonly Types.DiffLine[])
mods/diff/hooks/views/detail/gutter-cells-of/gutter-cells-of.ts:10
↓ 1 callers
Function
gutterChildren
()
mods/diff/hooks/views/detail/hunk-body/hunk-body.tsx:37
↓ 1 callers
Function
handle_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 callers
Function
handle_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 callers
Function
handle_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 callers
Function
handle_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 callers
Function
hasRemoteRef
(branch: string)
mods/diff/hooks/git/probes/default-branch-of/default-branch-of.ts:15
↓ 1 callers
Function
hunkBody
( ui: Kit.Ui, rows: readonly Types.Row[], cells: BodyCells, )
mods/diff/hooks/views/detail/hunk-body/hunk-body.tsx:29
↓ 1 callers
Function
hunkOf
( starts: Record<string, string> | undefined, lines: readonly string[], )
mods/diff/hooks/git/hunk-of/hunk-of.ts:10
↓ 1 callers
Function
hunksOf
(patch: unknown)
mods/diff/hooks/turns/turn-of/file-edit-of/hunks-of/hunks-of.ts:12
↓ 1 callers
Function
isAnalyticsOff
(environment: Environment)
mods/telemetry/hooks/is-analytics-off/is-analytics-off.ts:16
↓ 1 callers
Function
isEnvSet
(value: string | undefined)
mods/telemetry/hooks/is-analytics-off/is-env-set/is-env-set.ts:8
↓ 1 callers
Function
isEnvTruthy
(value: string | undefined)
mods/telemetry/hooks/is-analytics-off/is-env-truthy/is-env-truthy.ts:8
↓ 1 callers
Function
isGeneratedFile
(path: string)
mods/diff/hooks/classify/is-generated-file/is-generated-file.ts:15
↓ 1 callers
Function
isMarkKind
(value: unknown)
mods/telemetry/hooks/entries/is-mark-kind/is-mark-kind.ts:10
↓ 1 callers
Function
isOnPaneSurface
( e: E, )
mods/diff/hooks/is-on-pane-surface/is-on-pane-surface.ts:10
↓ 1 callers
Function
isOrgTool
(policy: Settings, tool: string)
mods/sec-default/hooks/policy/managed-tools-restored/is-org-tool/is-org-tool.ts:13
↓ 1 callers
Function
isPastDetails
(result: Types.NumstatResult)
mods/diff/hooks/git/tiers/is-past-details/is-past-details.ts:11
↓ 1 callers
Function
isSafeRefName
(ref: string)
mods/diff/hooks/git/probes/is-safe-ref-name/is-safe-ref-name.ts:12
↓ 1 callers
Function
isTaken
()
mods/diff/hooks/register.ts:293
↓ 1 callers
Function
isTestFile
(path: string)
mods/diff/hooks/classify/is-test-file/is-test-file.ts:13
↓ 1 callers
Function
isUnderUtf8Ceiling
(text: string, ceiling: number)
mods/diff/hooks/git/parse/is-whole-listing/is-under-utf8-ceiling/is-under-utf8-ceiling.ts:11
↓ 1 callers
Function
isWholeListing
(stdout: string, terminator = '\0')
mods/diff/hooks/git/parse/is-whole-listing/is-whole-listing.ts:17
↓ 1 callers
Function
is_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 callers
Function
is_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 callers
Function
kindWalkOf
( entryKindsOf: Types.GitDeps['entryKindsOf'], root: string, budget: number, )
mods/diff/hooks/git/probes/kind-walk-of/kind-walk-of.ts:16
↓ 1 callers
Function
linesOf
(hunks: readonly Git.Hunk[])
mods/diff/hooks/views/detail/lines-of/lines-of.ts:15
↓ 1 callers
Function
listBodyOf
( _kit: Kit, place: ListPlace, )
mods/diff/hooks/views/current-pane/list-body-of/list-body-of.ts:15
↓ 1 callers
Function
listingOf
(directory: string)
mods/diff/hooks/git/probes/kind-walk-of/kind-walk-of.ts:26
↓ 1 callers
Function
load_baseline_sha
Load the git baseline SHA from state.
plugins/security-guidance/hooks/diffstate.py:50
↓ 1 callers
Function
load_rule_file
Load a single rule file. Returns: Rule object or None if file is invalid.
plugins/hookify/core/config_loader.py:244
↓ 1 callers
Function
load_state
Load the full state dict from file.
plugins/security-guidance/hooks/session_state.py:88
↓ 1 callers
Function
main
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 callers
Function
main
Main hook function.
plugins/security-guidance/hooks/security_reminder_hook.py:2019
↓ 1 callers
Function
main
Main entry point for PostToolUse hook.
plugins/hookify/hooks/posttooluse.py:30
↓ 1 callers
Function
main
Main entry point for PreToolUse hook.
plugins/hookify/hooks/pretooluse.py:35
↓ 1 callers
Function
main
Main entry point for UserPromptSubmit hook.
plugins/hookify/hooks/userpromptsubmit.py:30
↓ 1 callers
Function
main
Main entry point for Stop hook.
plugins/hookify/hooks/stop.py:30
← previous
next →
101–200 of 349, ranked by callers