Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/anthropics/claude-code
/ functions
Functions
532 in github.com/anthropics/claude-code
⨍
Functions
532
◇
Types & classes
24
↓ 90 callers
Method
get
(name: string)
mods/types/claude-code.d.ts:9363
↓ 32 callers
Method
append
(name: string, value: string)
mods/types/claude-code.d.ts:9361
↓ 27 callers
Function
debug_log
Append debug message to log file with timestamp.
plugins/security-guidance/hooks/_base.py:29
↓ 15 callers
Function
with_locked_state
Execute callback with exclusive access to the state file. The callback receives the state dict and can modify it in place. State is saved
plugins/security-guidance/hooks/session_state.py:118
↓ 12 callers
Function
run
mods/diff/tests/fixtures/scripted/scripted-git-of.ts:19
↓ 9 callers
Method
set
(name: string, value: string)
mods/types/claude-code.d.ts:9366
↓ 6 callers
Method
decode
(input?: ArrayBufferView | ArrayBuffer)
mods/types/claude-code.d.ts:9357
↓ 6 callers
Method
has
(name: string)
mods/types/claude-code.d.ts:9365
↓ 6 callers
Function
redraw
(engine: Host)
mods/diff/hooks/register.ts:173
↓ 5 callers
Function
_format_vulns_guidance
Render a vuln list into the user-facing guidance block. Shared by analyze_code_security, agentic_review, and the late-dedup paths in the Stop
plugins/security-guidance/hooks/llm.py:600
↓ 5 callers
Function
_git_toplevel
Absolute repo root for `cwd`, or None if not in a work tree.
plugins/security-guidance/hooks/gitutil.py:144
↓ 5 callers
Function
countOf
(items: readonly T[], passes: (item: T) => boolean)
mods/diff/hooks/count-of/count-of.ts:9
↓ 5 callers
Function
emit_metrics
Write a SyncHookJSONOutput line to stdout for Claude Code to pick up. For asyncRewake (Stop) hooks, CC scans stdout for the first {-prefixed
plugins/security-guidance/hooks/security_reminder_hook.py:193
↓ 5 callers
Method
evaluate_rules
Evaluate all rules and return combined results. Checks all rules and accumulates matches. Blocking rules take priority over warning r
plugins/hookify/core/rule_engine.py:35
↓ 5 callers
Function
keptOf
(items: readonly (T | null)[])
mods/diff/hooks/kept-of/kept-of.ts:8
↓ 4 callers
Function
_finding_keys
(findings: List[Dict[str, Any]])
plugins/security-guidance/hooks/llm.py:680
↓ 4 callers
Function
analyze_code_security
Use Haiku to perform a security review of code. files: list of (file_path, content_or_diff) tuples is_diff: if True, the content is a uni
plugins/security-guidance/hooks/llm.py:710
↓ 4 callers
Function
answersOf
( numstat: string, bodies: Readonly<Record<string, string>>, dirty: readonly string[] = Object.keys(bodi
mods/diff/tests/fixtures/answers-of.ts:14
↓ 4 callers
Function
diffStat
( kit: Kit, added: number, removed: number, )
mods/diff/hooks/views/sections/diff-stat/diff-stat.tsx:17
↓ 4 callers
Function
isRecord
(value: unknown)
mods/telemetry/hooks/entries/is-record/is-record.ts:7
↓ 4 callers
Function
load_rules
Load all hookify rules from .claude directory. Args: event: Optional event filter ("bash", "file", "stop", etc.) Returns: Li
plugins/hookify/core/config_loader.py:198
↓ 4 callers
Function
refusal
(what: string, method: Method = 'log')
mods/telemetry/hooks/entries/refusal/refusal.ts:14
↓ 3 callers
Function
_cap_files_for_prompt
Cap per-file and total content bytes before they're packed into the review prompt. Returns the capped (path, content) list. Sets module-level
plugins/security-guidance/hooks/llm.py:158
↓ 3 callers
Function
_dedup_against_state
Drop vulns that a CONCURRENT asyncRewake hook wrote to previous_findings while this hook's LLM was running. `prompted` is the (filePath, cate
plugins/security-guidance/hooks/llm.py:685
↓ 3 callers
Function
_format_vulns_summary
One-liner for the user-facing task-notification summary. The full guidance goes to the model via stderr; this is the line the user actually s
plugins/security-guidance/hooks/llm.py:639
↓ 3 callers
Function
_prioritize_diff_files
When `diff_files` exceeds `cap`, return the top-`cap` by security relevance plus the count dropped. Otherwise return (diff_files, 0). Score =
plugins/security-guidance/hooks/gitutil.py:512
↓ 3 callers
Function
dialogEntriesOf
( model: PaneState.PaneModel, )
mods/diff/hooks/views/dialog-pane/dialog-entries-of/dialog-entries-of.ts:12
↓ 3 callers
Function
dialogPane
()
mods/diff/hooks/register.ts:151
↓ 3 callers
Function
dialogWindowOf
( model: Pick<PaneState.PaneModel, 'selectedPath'>, paths: readonly string[], )
mods/diff/hooks/views/dialog-pane/dialog-window-of/dialog-window-of.ts:12
↓ 3 callers
Function
diffDataOf
( context: Types.FetchContext, result: Types.MergedResult, basis: DiffBasis, )
mods/diff/hooks/git/tiers/diff-data-of/diff-data-of.ts:13
↓ 3 callers
Function
entryKindsOf
(engine: Host)
mods/diff/hooks/entry-kinds-of/entry-kinds-of.ts:12
↓ 3 callers
Function
hunkHeaderOf
(hunk: Git.Hunk)
mods/diff/hooks/views/detail/hunk-header-of/hunk-header-of.ts:14
↓ 3 callers
Function
parse_diff_into_files
Parse unified diff output into a list of (file_path, diff_content) tuples. Only includes files with source code extensions.
plugins/security-guidance/hooks/gitutil.py:615
↓ 3 callers
Function
pinBackend
(engine: Host)
mods/diff/hooks/register.ts:97
↓ 3 callers
Function
refresh
(engine: Host)
mods/diff/hooks/register.ts:286
↓ 3 callers
Function
scheduleRefresh
(engine: Host)
mods/diff/hooks/register.ts:361
↓ 3 callers
Function
withUntracked
( context: Types.FetchContext, result: Types.NumstatResult, scope: Types.UntrackedScope, )
mods/diff/hooks/git/tiers/with-untracked/with-untracked.ts:20
↓ 2 callers
Function
_agentic_commit_review_enabled
Agentic commit review gate. Enabled by default. SG_AGENTIC_COMMIT_REVIEW (=1/on or =0/off) remains as an explicit per-user override for opt-o
plugins/security-guidance/hooks/llm.py:982
↓ 2 callers
Function
_agentic_review_with_race
Race the agentic reviewer against a delayed single-shot fallback. Agentic starts at t=0. After SG_AGENTIC_RACE_DELAY_S (default 180s), the si
plugins/security-guidance/hooks/security_reminder_hook.py:832
↓ 2 callers
Function
_anthropic_base_url
Resolve the Anthropic-protocol endpoint base URL. Honors ANTHROPIC_BASE_URL (the convention the Anthropic SDK and CC itself use) so customers
plugins/security-guidance/hooks/llm.py:90
↓ 2 callers
Function
_append_reviewed_shas
Record that `shas` were reviewed. Best-effort; never raises. Uses fcntl.flock for the read-gc-write; appends are O_APPEND-atomic but GC needs
plugins/security-guidance/hooks/diffstate.py:267
↓ 2 callers
Function
_arun
()
plugins/security-guidance/hooks/llm.py:328
↓ 2 callers
Function
_call_claude
Call the configured LLM model with extended thinking and structured outputs. Model defaults to Sonnet 4.6 but can be overridden via SECURITY_
plugins/security-guidance/hooks/llm.py:386
↓ 2 callers
Function
_call_claude_dual_or
Run prompt through the model 2× in parallel and OR-merge the results. The second look samples the model again on the same prompt — independent
plugins/security-guidance/hooks/llm.py:521
↓ 2 callers
Function
_config_paths
Existing config file paths, lowest precedence first (so concat reads in precedence order user → project → project-local). Truncation is done on
plugins/security-guidance/hooks/extensibility.py:92
↓ 2 callers
Function
_git_dir
Absolute shared `.git` directory for repo_root. Uses `rev-parse --git-common-dir` so linked worktrees resolve to the SHARED gitdir, not the p
plugins/security-guidance/hooks/gitutil.py:156
↓ 2 callers
Function
_git_rev_parse_head
Return the current HEAD SHA, or None if not a git repo / no commits.
plugins/security-guidance/hooks/gitutil.py:32
↓ 2 callers
Function
_is_reviewable_source
(file_path)
plugins/security-guidance/hooks/gitutil.py:550
↓ 2 callers
Function
_load_reviewed_shas
Set of full 40-hex shas previously reviewed in this clone.
plugins/security-guidance/hooks/diffstate.py:250
↓ 2 callers
Function
_norm
(s: str)
plugins/security-guidance/hooks/llm.py:1396
↓ 2 callers
Function
_norm
(s: str)
plugins/security-guidance/hooks/review_api.py:317
↓ 2 callers
Function
_push_section
Return the slice of `bash_output` that contains the push's range lines. `_PUSH_RANGE_RE` is not push-specific — `git fetch` and `git pull` print
plugins/security-guidance/hooks/security_reminder_hook.py:739
↓ 2 callers
Function
_record_usage
Accumulate one API response's token usage. `usage` is the Anthropic `usage` dict (HTTP) or the SDK ResultMessage.usage dict — both use the sam
plugins/security-guidance/hooks/_base.py:109
↓ 2 callers
Function
_reviewed_shas_path
(repo_root)
plugins/security-guidance/hooks/diffstate.py:245
↓ 2 callers
Function
_state_key
(session_id)
plugins/security-guidance/hooks/session_state.py:25
↓ 2 callers
Function
_temp_index
Yield an env dict pointing GIT_INDEX_FILE at a throwaway copy of the repo's index with `git add --intent-to-add` applied, so untracked files s
plugins/security-guidance/hooks/gitutil.py:92
↓ 2 callers
Function
agentic_review
Two-stage Agent-SDK review: investigate (Read/Grep/Glob over the repo) then a self-refute filter pass. Returns (guidance_or_None, vulns, metri
plugins/security-guidance/hooks/llm.py:1059
↓ 2 callers
Function
arrayOf
(value: unknown)
mods/diff/hooks/array-of/array-of.ts:8
↓ 2 callers
Function
atomic_check_rate_limit
Rolling-window rate limit: allow at most `max_per_window` calls per `window_s` seconds, per (session_id, key). Returns (allowed: bool, count_
plugins/security-guidance/hooks/security_reminder_hook.py:271
↓ 2 callers
Function
baseNameOf
(path: string)
mods/diff/hooks/classify/base-name-of/base-name-of.ts:7
↓ 2 callers
Function
bodyStampOf
(data: Git.DiffData)
mods/diff/hooks/register.ts:219
↓ 2 callers
Function
cellWidth
(text: string)
mods/diff/hooks/views/layout/cell-width/cell-width.ts:15
↓ 2 callers
Function
chargedWidth
(text: string)
mods/diff/hooks/views/layout/charged-width/charged-width.ts:14
↓ 2 callers
Function
check_patterns
Check if file path or content matches any security patterns. Returns ALL matches.
plugins/security-guidance/hooks/security_reminder_hook.py:386
↓ 2 callers
Function
checkedProps
( props: unknown, method: Method, )
mods/telemetry/hooks/entries/checked-props/checked-props.ts:16
↓ 2 callers
Function
dataOf
( files: readonly Git.FileStat[], overrides: Partial<Git.DiffData> = {}, )
mods/diff/tests/views/pane-view.test.ts:13
↓ 2 callers
Function
datingsOf
( context: Types.DatingContext, paths: readonly string[], )
mods/diff/hooks/git/probes/datings-of/datings-of.ts:17
↓ 2 callers
Method
delete
(name: string)
mods/types/claude-code.d.ts:9362
↓ 2 callers
Function
disarm
(engine: Host)
mods/diff/hooks/register.ts:450
↓ 2 callers
Method
encode
(input?: string)
mods/types/claude-code.d.ts:9352
↓ 2 callers
Function
ensure_anthropic_reachable
Run once. Under a remote/proxied environment, probe api.anthropic.com; if blackholed, scrub NO_PROXY and re-probe. Returns True if reachable (
plugins/security-guidance/hooks/llm.py:122
↓ 2 callers
Function
extract_frontmatter
Extract YAML frontmatter and message body from markdown. Returns (frontmatter_dict, message_body). Supports multi-line dictionary items in l
plugins/hookify/core/config_loader.py:87
↓ 2 callers
Function
fitDialog
(engine: Host)
mods/diff/hooks/register.ts:161
↓ 2 callers
Method
from_dict
Create Rule from frontmatter dict and message body.
plugins/hookify/core/config_loader.py:45
↓ 2 callers
Function
get_state_file
Get session-specific state file path.
plugins/security-guidance/hooks/session_state.py:37
↓ 2 callers
Function
githubRequest
( endpoint: string, method = "GET", body?: unknown )
scripts/sweep.ts:15
↓ 2 callers
Function
githubRequest
(endpoint: string, token: string, method: string = 'GET', body?: any)
scripts/backfill-duplicate-comments.ts:26
↓ 2 callers
Function
githubRequest
(endpoint: string, token: string, method: string = 'GET', body?: any)
scripts/auto-close-duplicates.ts:28
↓ 2 callers
Function
isOnPaneSurface
( e: E, )
mods/diff/hooks/is-on-pane-surface/is-on-pane-surface.ts:10
↓ 2 callers
Function
isRecord
(value: unknown)
mods/diff/hooks/is-record/is-record.ts:7
↓ 2 callers
Function
leadingHunkOf
(hunk: Git.Hunk, maxChars: number)
mods/diff/hooks/views/detail/leading-hunk-of/leading-hunk-of.ts:12
↓ 2 callers
Function
listRow
( kit: Kit, row: KeyedPressable, tail: RenderElement, )
mods/diff/hooks/views/sections/list-row/list-row.tsx:18
↓ 2 callers
Function
listingOf
(entries: Listing)
mods/diff/tests/git/fetch-diff.test.ts:18
↓ 2 callers
Function
loadBodies
(engine: Host)
mods/diff/hooks/register.ts:189
↓ 2 callers
Function
mergedResultOf
( result: Types.NumstatResult, mark: Pick<Types.MergedResult, 'isUntrackedWithheld'>, )
mods/diff/hooks/git/tiers/with-untracked/merged-result-of/merged-result-of.ts:10
↓ 2 callers
Function
messageOf
(error: unknown)
mods/diff/hooks/message-of/message-of.ts:8
↓ 2 callers
Function
modelOf
( overrides: Partial<PaneState.PaneModel>, )
mods/diff/tests/views/pane-view.test.ts:29
↓ 2 callers
Function
openPane
( engine: Host, trigger: (typeof Record.SHOWN_TRIGGERS)[number], )
mods/diff/hooks/register.ts:373
↓ 2 callers
Function
preludeOf
( kit: Kit, model: Pick< PaneState.PaneModel, 'isOutsideRepository' | 'data' | 'hasSettled' | 'sou
mods/diff/hooks/views/prelude-of/prelude-of.tsx:22
↓ 2 callers
Function
restore_unreviewed_stop_state
Put consumed touched_paths back so the next Stop reviews them. consume_stop_state cleared touched_paths on disk; if Stop then exits early for
plugins/security-guidance/hooks/diffstate.py:116
↓ 2 callers
Function
rootedPathOf
(path: string)
mods/diff/hooks/classify/rooted-path-of/rooted-path-of.ts:8
↓ 2 callers
Function
rule_names_to_mask
Pack a set of rule names into a bitmask. Bit N set means RuleId(N) matched. User-defined patterns (rule_name starting with "user:") have no static
plugins/security-guidance/hooks/patterns.py:337
↓ 2 callers
Function
stampIfFile
( probe: Types.StampProbe, path: string, )
mods/diff/hooks/git/probes/stamp-if-file/stamp-if-file.ts:14
↓ 2 callers
Method
toString
()
mods/types/claude-code.d.ts:9387
↓ 2 callers
Function
unbornScriptOf
()
mods/diff/tests/git/fetch-diff.test.ts:39
↓ 2 callers
Function
unbornTier
( context: Types.FetchContext, )
mods/diff/hooks/git/tiers/unborn-tier/unborn-tier.ts:18
↓ 2 callers
Function
untrackedOf
(path: string)
mods/diff/tests/views/pane-view.test.ts:325
↓ 2 callers
Function
wasDirtyAtStart
( context: Types.DatingContext, path: string, )
mods/diff/hooks/git/probes/was-dirty-at-start/was-dirty-at-start.ts:15
↓ 1 callers
Function
CLOSE_MESSAGE
(reason: string)
scripts/sweep.ts:10
↓ 1 callers
Function
_agentic_spawn_env
opts.env for the SDK-spawned inner `claude` CLI. Always neutralizes the fd-passing vars (a stale/closed fd makes the inner CLI runaway-alloca
plugins/security-guidance/hooks/llm.py:1012
next →
1–100 of 532, ranked by callers