Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/anthropics/claude-plugins-official
/ functions
Functions
313 in github.com/anthropics/claude-plugins-official
⨍
Functions
313
◇
Types & classes
5
↓ 2 callers
Function
fetchTextChannel
(id: string)
external_plugins/discord/server.ts:394
↓ 2 callers
Function
find_project_root
Find the project root by walking up from cwd looking for .claude/. Mimics how Claude Code discovers its project root, so the command file we
plugins/skill-creator/skills/skill-creator/scripts/run_eval.py:22
↓ 2 callers
Method
from_dict
Create Rule from frontmatter dict and message body.
plugins/hookify/core/config_loader.py:45
↓ 2 callers
Function
generate_html
Generate the complete standalone HTML page with embedded data.
plugins/skill-creator/skills/skill-creator/eval-viewer/generate_review.py:250
↓ 2 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:460
↓ 2 callers
Function
get_state_file
Get session-specific state file path.
plugins/security-guidance/hooks/session_state.py:37
↓ 2 callers
Function
improve_description
Call Claude to improve the description based on eval results.
plugins/skill-creator/skills/skill-creator/scripts/improve_description.py:50
↓ 2 callers
Function
judge
(finding, stance, label)
plugins/code-modernization/workflows/harden-scan.js:135
↓ 2 callers
Function
load_state
Load the full state dict from file.
plugins/security-guidance/hooks/session_state.py:88
↓ 2 callers
Function
messageText
(r: Row)
external_plugins/imessage/server.ts:498
↓ 2 callers
Function
pct
(a, b)
plugins/session-report/skills/session-report/analyze-sessions.mjs:609
↓ 2 callers
Function
print_eval_stats
(label, results, elapsed)
plugins/skill-creator/skills/skill-creator/scripts/run_loop.py:154
↓ 2 callers
Function
pruneExpired
(a: Access)
external_plugins/telegram/server.ts:210
↓ 2 callers
Function
readAccessFile
()
external_plugins/telegram/server.ts:147
↓ 2 callers
Function
readAccessFile
()
external_plugins/discord/server.ts:151
↓ 2 callers
Function
readAccessFile
()
external_plugins/imessage/server.ts:241
↓ 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
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:352
↓ 2 callers
Function
run_eval
Run the full eval set and return results.
plugins/skill-creator/skills/skill-creator/scripts/run_eval.py:184
↓ 2 callers
Function
safeAttName
(att: Attachment)
external_plugins/discord/server.ts:436
↓ 2 callers
Function
save_state
Save the full state dict to file.
plugins/security-guidance/hooks/session_state.py:104
↓ 2 callers
Function
score_class
(correct: int, total: int)
plugins/skill-creator/skills/skill-creator/scripts/generate_report.py:244
↓ 2 callers
Function
sites
plugins/code-modernization/workflows/uplift-deltas.js:196
↓ 2 callers
Function
topPrompts
(n)
plugins/session-report/skills/session-report/analyze-sessions.mjs:728
↓ 2 callers
Function
trackEcho
(chatGuid: string, key: string)
external_plugins/imessage/server.ts:445
↓ 2 callers
Function
validate_skill
Basic validation of a skill
plugins/skill-creator/skills/skill-creator/scripts/quick_validate.py:12
↓ 1 callers
Function
_bootstrap_pywin32
Manually replicate the pywin32 `.pth` bootstrap so a venv added via `sys.path.insert()` (not site.py) can still import `pywintypes`. No-op whe
plugins/security-guidance/hooks/llm.py:76
↓ 1 callers
Function
_build_via_target
Fallback install when `python -m venv` can't bootstrap pip (ensurepip missing — Debian python3-venv absent, or a python.org/pyenv build without
plugins/security-guidance/hooks/ensure_agent_sdk.py:379
↓ 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:341
↓ 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:742
↓ 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:813
↓ 1 callers
Function
_cooldown_remaining
Seconds left in the signal-kill cooldown (0 if none/expired). Reads the marker's mtime; a missing/unreadable marker means not in cooldown.
plugins/security-guidance/hooks/ensure_agent_sdk.py:219
↓ 1 callers
Function
_detect_main_branch
(repo_root)
plugins/security-guidance/hooks/gitutil.py:251
↓ 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:872
↓ 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:90
↓ 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:589
↓ 1 callers
Function
_encode_errno
Extract the OS errno from an "exc:<TypeName>:<errno>" err_kind. OSError-family exceptions embed their errno (ENOENT=2, EACCES=13, ENOSPC=28, …
plugins/security-guidance/hooks/ensure_agent_sdk.py:286
↓ 1 callers
Function
_encode_exc_kind
Map an "exc:<TypeName>[:errno]" err_kind to its exception-type code (SDK_BOOTSTRAP_EXC_CODES). Returns 0 for non-exc err_kinds (so the sdk_boo
plugins/security-guidance/hooks/ensure_agent_sdk.py:272
↓ 1 callers
Function
_encode_phase
Map err_phase string to its telemetry integer code, or 0 if unset. Empty/None → 0 lets `if encoded:` cleanly skip emission. Per SDK_BOOTSTRAP_
plugins/security-guidance/hooks/ensure_agent_sdk.py:167
↓ 1 callers
Function
_encode_rc
Extract the subprocess returncode embedded in a 'signal_killed:<rc>' err_kind (e.g. -11 SIGSEGV / -9 SIGKILL / 139 shell-wrapped). Emitted as
plugins/security-guidance/hooks/ensure_agent_sdk.py:195
↓ 1 callers
Function
_encode_stderr_sig
Bounded integer hash of the stderr tail captured in "other:<tail>" err_kinds. Lets us distinguish patterns INSIDE the _uncategorized (code 99)
plugins/security-guidance/hooks/ensure_agent_sdk.py:241
↓ 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:64
↓ 1 callers
Function
_find_runs_recursive
(root: Path, current: Path, runs: list[dict])
plugins/skill-creator/skills/skill-creator/eval-viewer/generate_review.py:68
↓ 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:227
↓ 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:267
↓ 1 callers
Function
_git_rev_list_range
Shas in `base..head`, oldest→newest. Empty list on error.
plugins/security-guidance/hooks/gitutil.py:211
↓ 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:389
↓ 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
_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:1471
↓ 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:328
↓ 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:443
↓ 1 callers
Function
_kill_port
Kill any process listening on the given port.
plugins/skill-creator/skills/skill-creator/eval-viewer/generate_review.py:288
↓ 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:334
↓ 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:2112
↓ 1 callers
Function
_maybe_emit_user_notice
Return a one-time user-visible notice when the agentic reviewer is in a persistent broken state on this machine, or None if we've already show
plugins/security-guidance/hooks/ensure_agent_sdk.py:675
↓ 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:293
↓ 1 callers
Function
_pip_err_from_stderr
Categorize a pip-install stderr into a known err_kind (the pip subset of SDK_BOOTSTRAP_ERR_CODES). Used by the --target fallback; mirrors the
plugins/security-guidance/hooks/ensure_agent_sdk.py:321
↓ 1 callers
Function
_plugin_version_int
()
plugins/security-guidance/hooks/ensure_agent_sdk.py:426
↓ 1 callers
Function
_probe_has_pip
True iff the current interpreter can run pip (`-m pip --version`). Probed only on the venv_ensurepip_fail path (see __main__), NOT on the hap
plugins/security-guidance/hooks/ensure_agent_sdk.py:302
↓ 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:97
↓ 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
_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:587
↓ 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
_sdk_on_syspath
()
plugins/security-guidance/hooks/ensure_agent_sdk.py:416
↓ 1 callers
Function
_strip_anthropic_from_no_proxy
()
plugins/security-guidance/hooks/llm.py:180
↓ 1 callers
Function
_target_sdk_importable
True iff the --target libs dir has an importable claude_agent_sdk, probed with THIS interpreter (the one llm.py will import it from) and the t
plugins/security-guidance/hooks/ensure_agent_sdk.py:359
↓ 1 callers
Function
_unchanged_since_baseline
(p)
plugins/security-guidance/hooks/diffstate.py:423
↓ 1 callers
Function
_usage_metrics
Snapshot the accumulator as metric keys. Returns {} when no API calls AND no HTTP errors were made so skip-path emits don't burn key budget. c
plugins/security-guidance/hooks/_base.py:204
↓ 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
addUsage
(s, u)
plugins/session-report/skills/session-report/analyze-sessions.mjs:86
↓ 1 callers
Function
aggregate_results
Aggregate run results into summary statistics. Returns run_summary with stats for each configuration and delta.
plugins/skill-creator/skills/skill-creator/scripts/aggregate_benchmark.py:176
↓ 1 callers
Function
assertSendable
(f: string)
external_plugins/telegram/server.ts:135
↓ 1 callers
Function
assertSendable
(f: string)
external_plugins/discord/server.ts:139
↓ 1 callers
Function
assertSendable
(f: string)
external_plugins/imessage/server.ts:230
↓ 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:303
↓ 1 callers
Function
buildByDay
()
plugins/session-report/skills/session-report/analyze-sessions.mjs:681
↓ 1 callers
Function
build_run
Build a run dict with prompt, outputs, and grading data.
plugins/skill-creator/skills/skill-creator/eval-viewer/generate_review.py:85
↓ 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:173
↓ 1 callers
Function
chunk
(text: string, limit: number, mode: 'length' | 'newline')
external_plugins/telegram/server.ts:357
↓ 1 callers
Function
chunk
(text: string, limit: number, mode: 'length' | 'newline')
external_plugins/discord/server.ts:373
↓ 1 callers
Function
chunk
(text: string, limit: number, mode: 'length' | 'newline')
external_plugins/imessage/server.ts:479
↓ 1 callers
Function
classifyFile
(p)
plugins/session-report/skills/session-report/analyze-sessions.mjs:111
↓ 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
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:386
↓ 1 callers
Function
consumeEcho
(chatGuid: string, key: string)
external_plugins/imessage/server.ts:451
↓ 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
downloadAttachment
(att: Attachment)
external_plugins/discord/server.ts:418
↓ 1 callers
Function
embed_file
Read a file and return an embedded representation.
plugins/skill-creator/skills/skill-creator/eval-viewer/generate_review.py:149
↓ 1 callers
Function
expandTilde
(p: string)
external_plugins/imessage/server.ts:773
← previous
next →
101–200 of 313, ranked by callers