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
↓ 1 callers
Function
_build_auth_headers
(use_token)
plugins/security-guidance/hooks/llm.py:191
↓ 1 callers
Function
_call_claude_via_sdk
Single-turn SDK call as a substitute for the HTTP _call_claude path on 3P providers. Uses the same `output_format` JSON-schema contract so the
plugins/security-guidance/hooks/llm.py:274
↓ 1 callers
Method
_check_condition
Check if a single condition matches. Args: condition: Condition to check tool_name: Tool being used tool_
plugins/hookify/core/rule_engine.py:144
↓ 1 callers
Function
_claim_bash_hook_once
De-dupe across hooks.json `if` matchers firing for the same Bash call. `git commit -m x && git push` matches both `Bash(git commit:*)` and `B
plugins/security-guidance/hooks/security_reminder_hook.py:646
↓ 1 callers
Function
_compute_push_sweep_base
Advance the diff base past the contiguous reviewed prefix. Spec: review `git diff B..HEAD` where `B` is the newest commit such that `prev_ups
plugins/security-guidance/hooks/security_reminder_hook.py:717
↓ 1 callers
Function
_detect_main_branch
(repo_root)
plugins/security-guidance/hooks/gitutil.py:213
↓ 1 callers
Function
_detect_prev_upstream
Where the remote was BEFORE this push. Preference order: 1. Parse `abc..def` from push stdout — authoritative, exact. 2. `<branch>@{u
plugins/security-guidance/hooks/security_reminder_hook.py:776
↓ 1 callers
Function
_diff_pathspec
Convert absolute touched-paths to repo-relative pathspec args for git diff. Paths outside cwd (e.g. ~/.claude/…) are dropped. Returns the list
plugins/security-guidance/hooks/gitutil.py:70
↓ 1 callers
Function
_dual_or_enabled
Gate for the two-call dual_or review path. Default OFF — the second call roughly doubles API spend for the review. For users paying their own
plugins/security-guidance/hooks/llm.py:510
↓ 1 callers
Method
_extract_field
Extract field value from tool input or hook input data. Args: field: Field name like "command", "new_text", "file_path", "reason"
plugins/hookify/core/rule_engine.py:182
↓ 1 callers
Function
_find_git_index
Find the real index file for a git repo. Handles worktrees where .git is a file pointing to the main repo's gitdir. Returns the absolute
plugins/security-guidance/hooks/gitutil.py:48
↓ 1 callers
Function
_git_diff_range
`git diff -p base head` as text on success, None on error. Distinguishing failure from success-with-empty-diff matters: the push-sweep caller
plugins/security-guidance/hooks/gitutil.py:193
↓ 1 callers
Function
_git_name_only
Return the set of repo-root-relative paths that differ from `base`, or None if git failed (unresolvable ref, not a repo, timeout). Callers mus
plugins/security-guidance/hooks/gitutil.py:303
↓ 1 callers
Function
_git_reflog_recent_commits
Return (fresh_commit_shas, stale_count) from the HEAD reflog. Scans the last `max_n` reflog entries and returns the SHAs whose action is `com
plugins/security-guidance/hooks/gitutil.py:227
↓ 1 callers
Function
_git_rev_list_range
Shas in `base..head`, oldest→newest. Empty list on error.
plugins/security-guidance/hooks/gitutil.py:179
↓ 1 callers
Function
_git_status_porcelain
One `git status --porcelain=v1 -z` → (tracked_dirty, untracked) sets of repo-root-relative paths, or (None, None) on error. Replaces the `_tem
plugins/security-guidance/hooks/gitutil.py:330
↓ 1 callers
Function
_glob_match
Match a path against include/exclude globs. ``**`` matches any depth.
plugins/security-guidance/hooks/extensibility.py:247
↓ 1 callers
Function
_has_redos_structure
Heuristic catastrophic-backtracking check. Not a proof. Catches: - nested quantifiers ((a+)*, (a*b)+) - wildcard groups under repetition (
plugins/security-guidance/hooks/extensibility.py:272
↓ 1 callers
Function
_hit
(globs: Tuple[str, ...])
plugins/security-guidance/hooks/extensibility.py:251
↓ 1 callers
Function
_intersects
(cand: dict[str, Any])
plugins/security-guidance/hooks/review_api.py:323
↓ 1 callers
Function
_intersects_diff
(cand: Dict[str, Any])
plugins/security-guidance/hooks/llm.py:1402
↓ 1 callers
Function
_is_3p_provider
True iff a 3P provider env var is set to a truthy value. Mirrors how the CC harness itself decides 1P vs 3P at startup. Cheap to call — no ne
plugins/security-guidance/hooks/llm.py:261
↓ 1 callers
Function
_is_ancestor
True if `maybe_ancestor` is reachable from `descendant` (i.e. HEAD moved forward via commit/merge, not sideways via checkout).
plugins/security-guidance/hooks/gitutil.py:377
↓ 1 callers
Function
_item
(v)
plugins/security-guidance/hooks/llm.py:654
↓ 1 callers
Function
_list_untracked
Repo-root-relative untracked (and not-ignored) path → mtime_ns, or {} on error. Used at UPS to snapshot the pre-turn untracked set so the Stop
plugins/security-guidance/hooks/diffstate.py:319
↓ 1 callers
Function
_load_guidance
(cwd: Optional[str])
plugins/security-guidance/hooks/extensibility.py:105
↓ 1 callers
Function
_load_user_patterns
(cwd: Optional[str])
plugins/security-guidance/hooks/extensibility.py:147
↓ 1 callers
Method
_matches_tool
Check if tool_name matches the matcher pattern. Args: matcher: Pattern like "Bash", "Edit|Write", "*" tool_name: Actu
plugins/hookify/core/rule_engine.py:127
↓ 1 callers
Function
_maybe_bootstrap_agent_sdk_async
Fire-and-forget SDK bootstrap, for remote-pod environments. Under CLAUDE_CODE_SYNC_PLUGIN_INSTALL=true (CCR-style remote pods), plugins are s
plugins/security-guidance/hooks/security_reminder_hook.py:1979
↓ 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:456
↓ 1 callers
Function
arm
(engine: Host, path: string)
mods/diff/hooks/register.ts:535
↓ 1 callers
Function
askKeyOf
(path: string)
mods/diff/hooks/views/sections/ask-key-of/ask-key-of.ts:10
↓ 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
( run: Backend.BackendHost['run'], )
mods/diff/tests/fixtures/backend-of/backend-host-of.ts:10
↓ 1 callers
Function
backendHostOf
(engine: Host)
mods/diff/hooks/register.ts:67
↓ 1 callers
Function
backfillDuplicateComments
()
scripts/backfill-duplicate-comments.ts:72
↓ 1 callers
Function
base64Decoded
(encoded: string)
mods/telemetry/tests/fixtures/base64-decoded.ts:11
↓ 1 callers
Function
batchOf
(post: Args<'http.fetch'>)
mods/telemetry/tests/fixtures/batch-of.ts:11
↓ 1 callers
Function
bind
(engine: Host)
mods/diff/hooks/register.ts:554
↓ 1 callers
Function
bodiesOf
()
mods/diff/hooks/views/body/plan/segments/segments-of.ts:120
↓ 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
checkedValue
( key: string, value: unknown, method: Method = 'log', )
mods/telemetry/hooks/entries/checked-value/checked-value.ts:19
↓ 1 callers
Function
childrenOf
(node: unknown)
mods/diff/tests/fixtures/tree/children-of.ts:8
↓ 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:406
↓ 1 callers
Function
codeBlocksOf
( hunks: readonly Git.Hunk[], room: Types.BodyRoom, )
mods/diff/hooks/views/detail/code-blocks-of/code-blocks-of.ts:22
↓ 1 callers
Function
codeOf
(segment: HunkSegment, cut: WindowCut)
mods/diff/hooks/views/body/draw-window.tsx:42
↓ 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
contextOf
(probe: Git.StampProbe, listing: string)
mods/diff/tests/git/probes/datings-of.test.ts:66
↓ 1 callers
Function
countOf
(counted: PaneState.HeaderTotals)
mods/diff/hooks/views/sections/header-view.tsx:31
↓ 1 callers
Function
countedRead
()
mods/sec-default/tests/policy/create-policy-memo.test.ts:10
↓ 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:65
↓ 1 callers
Function
currentOf
()
mods/diff/hooks/pane-state/dialog-title-of.ts:22
↓ 1 callers
Function
cutHunks
( hunks: readonly Types.Hunk[], )
mods/diff/hooks/git/cut-hunks/cut-hunks.ts:14
↓ 1 callers
Function
dataIn
( mode: Git.BaseMode, source: Git.DiffSource, )
mods/diff/tests/pane-state/mode-label-of.test.ts:10
↓ 1 callers
Function
dataIn
( mode: Git.BaseMode, overrides: Partial<Git.DiffData> = {}, )
mods/diff/tests/pane-state/empty-state-of.test.ts:10
↓ 1 callers
Function
dataOf
( files: readonly Git.FileStat[], filesCount: number, )
mods/diff/tests/pane-state/header-totals-of.test.ts:10
↓ 1 callers
Function
datedBefore
(suffix: string)
mods/diff/tests/git/fetch-diff.test.ts:47
↓ 1 callers
Function
datingOf
(stamp: Types.Stamp)
mods/diff/hooks/git/probes/datings-of/datings-of.ts:27
↓ 1 callers
Function
defaultBranchOf
(run: Types.GitRun)
mods/diff/hooks/git/probes/default-branch-of/default-branch-of.ts:14
↓ 1 callers
Function
depsOf
( script: Script, overrides: Partial<Git.GitDeps> = {}, )
mods/diff/tests/git/fetch-diff.test.ts:21
↓ 1 callers
Function
depsOf
(run: Git.GitRun, probe: Git.StampProbe)
mods/diff/tests/git/probes/datings-of.test.ts:57
↓ 1 callers
Function
depsOf
()
mods/diff/tests/git/probes/head-key-of.test.ts:27
↓ 1 callers
Function
depsOf
()
mods/diff/hooks/git/git-backend-of.ts:52
↓ 1 callers
Function
detailOf
(entry: Entries.BodyEntry)
mods/diff/hooks/views/dialog-pane/dialog-pane.tsx:111
↓ 1 callers
Function
dialogPane
( kit: Kit, model: PaneState.PaneModel, )
mods/diff/hooks/views/dialog-pane/dialog-pane.tsx:29
↓ 1 callers
Function
docksPane
( $: Engine, on: On, overrides: Partial<Omit<Views.Kit, 'ui'> & Views.PaneSeat> = {}, )
mods/diff/tests/fixtures/pane-view/docks-pane.ts:21
↓ 1 callers
Function
drawnFilesOf
( model: Pick< PaneState.PaneModel, 'data' | 'isNoiseShown' | 'isPreSessionShown' >, )
mods/diff/hooks/drawn-files-of/drawn-files-of.ts:15
↓ 1 callers
Function
drawsPane
( on: On, view: (kit: Views.Kit) => RenderElement, overrides: Partial<Omit<Views.Kit, 'ui'>> = {}, )
mods/diff/tests/fixtures/pane-view/draws-pane.ts:20
↓ 1 callers
Function
edgeOf
(way: 'up' | 'down', count: number)
mods/diff/hooks/views/dialog-pane/dialog-pane.tsx:108
↓ 1 callers
Function
elementOf
(segment: Segment, cut: WindowCut)
mods/diff/hooks/views/body/draw-window.tsx:58
← previous
next →
101–200 of 532, ranked by callers