claude-plugins-official

资源汇总

anthropics/claude-plugins-official

Anthropic 官方管理的 Claude Code 高质量插件目录。

项目简介

这是 Claude Code 的高质量插件集合市场,包含 Anthropic 内部及第三方开发的插件。每个插件可添加 MCP 服务器、命令、代理或技能,扩展 Claude Code 的功能。可通过 Claude Code 插件系统安装。

README 预览

# Claude Code Plugins Directory\n\nA curated directory of high-quality plugins for Claude Code.\n\n> **⚠️ Important:** Make sure you trust a plugin before installing, updating, or using it. Anthropic does not control what MCP servers, files, or other software are included in plugins and cannot verify that they will work as intended or that they won't change. See each plugin's homepage for more information.\n\n## Structure\n\n- **`/plugins`** - Internal plugins developed and maintained by Anthropic\n- **`/external_plugins`** - Third-party plugins from partners and the community\n\n## Installation\n\nPlugins can be installed directly from this marketplace via Claude Code's plugin system.\n\nTo install, run `/plugin install {plugin-name}@claude-plugins-official`\n\nor browse for the plugin in `/plugin > Discover`\n\n## Contributing\n\n### Internal Plugins\n\nInternal plugins are developed by Anthropic team members. See `/plugins/example-plugin` for a reference implementation.\n\n### External Plugins\n\nThird-party partners can submit plugins for inclusion in the marketplace. External plugins must meet quality and security standards for approval. To submit a new plugin, use the [plugin directory submission form](https://clau.de/plugin-directory-submission).\n\n## Plugin Structure\n\nEach plugin follows a standard structure:\n\n```\nplugin-name/\n├── .claude-plugin/\n│   └── plugin.json      # Plugin metadata (required)\n├── .mcp.json            # MCP server configuration (optional)\n├── commands/            # Slash commands (optional)\n├── agents/              # Agent definitions (optional)\n├── skills/              # Skill definitions (optional)\n└── README.md            # Documentation\n```\n\n## Skill-bundle plugins\n\nWhen a plugin's source repository ships skills (`SKILL.md` files) without a `.claude-plugin/plugin.json` manifest, the marketplace entry can declare the skills directly using `strict: false` and an explicit `skills` array.\n\n```json\n{\n  "name": "exa

常见问题 (5)

故障排除
如何阻止 security-guidance 插件的 python_subprocess_shell 规则标记 Markdown 文档中的代码?

这是安全指南 v2.0.0 中已知的误报情况。该规则当前缺少用于排除文档文件的路径过滤器。作为临时解决方案,您可以忽略 .md/.mdx/.rst 文件中的这些警告,或手动编辑 hooks/patterns.py,在规则中添加 path_filter: lambda p: not p.endswith(_DOC_EXTS)。预计未来更新中将提供正式修复;请跟踪问题 #2045 了解进展。

来源 Issue #2045
故障排除
如何修复 security-guidance 插件中的 'output_format deprecated' HTTP 400 错误?

更新 plugins/security-guidance/hooks/llm.py,将 schema 嵌套到 output_config.format 下,而不是已弃用的顶层 output_format。具体而言,将 "output_format": {"type": "json_schema", "schema": output_schema} 替换为 "output_config": {"format": {"type": "json_schema", "schema": output_schema}}。如果你在 adaptive-thinking 分支上,请将 effort 合并到现有字典中:将 payload["output_config"] = {"effort": "high"} 改为 payload["output_config"]["effort"] = "high"。该补丁位于 issue #2097。这解决了 400 错误并防止防护栏失效。

来源 Issue #2098
故障排除
为什么Claude Code在没有给出任何原因的情况下显示“Permission to use Edit has been denied”?

安全指南插件钩子通过sys.exit(2)发出拒绝信号,且未携带JSON负载,导致生成通用拒绝消息。请将该插件升级至能输出包含permissionDecisionReason的正确JSON拒绝消息的版本。如无法立即升级,请手动修补钩子脚本(例如security_reminder_hook.py),将裸sys.exit(2)替换为:

import json
print(json.dumps({
    "hookSpecificOutput": {
        "hookEventName": "PreToolUse",
        "permissionDecision": "deny",
        "permissionDecisionReason": f"{rule_name}: {reminder[:120]}"
    }
}))
sys.exit(0)

此举可在UI中提供上下文(匹配模式、风险类别)。请追踪上游修复以移除本地补丁的需求。

来源 Issue #1783
故障排除
为什么Claude Code的安全指南钩子会显示'hook json output validation failed'错误?

该钩子输出的是纯文本而非 JSON。编辑 hooks/security_reminder_hook.py 第 272 行:将 print(reminder, file=sys.stderr); sys.exit(2) 替换为 print(json.dumps({"decision": "block", "reason": reminder})); sys.exit(2)。这将输出有效的 JSON,从而解决验证错误。

来源 Issue #1375
故障排除
为什么 Microsoft Store Python 会报错 "can't open file ... [Errno 2] No such file or directory",即使文件在 Windows 上确实存在?该如何修复?

根本原因:Microsoft Store/MSIX 版本的 Python(例如 PythonSoftwareFoundation.Python.3.10,从 PATH 解析为 WindowsApps 下的 python3.10/python3)运行在 Windows AppContainer 沙箱中。它能通过 python -c 探测并报告真实的版本号,但被拒绝读取其他应用的数据文件夹(例如 %APPDATA%\Roaming\Claude\...),因此对于明确存在的文件也会报告 Errno 2。sg-python.sh 在 Pass 1 中就锁定了这个解释器,永远不会回退到可正常工作的 python.org 安装版本,因此每个 hook(UserPromptSubmit、PostToolUse、Stop)都会失败——而带有 asyncRewake: true 的 Stop 会在每一轮重新触发该错误。

修复方案 A —— 从 PATH 中移除沙箱化的解释器:卸载 Store 版 Python(设置 > 应用),或在 设置 > 应用 > 高级应用设置 > 应用执行别名 中禁用它,然后从 python.org 安装 Python,并用 where python / where python3 验证真正的解释器被优先解析。

修复方案 B —— 修补 sg-python.sh,使探测验证真实的脚本执行,而不仅仅是 -c。将一个一次性脚本写入与目标脚本相同的目录(不是 /tmp —— 该目录在沙箱允许的范围内,无法重现故障):

can_run_script() {
    local target_dir="$1"; shift
    target_dir="$(dirname -- "$target_dir")"
    local tmp="$target_dir/.sg-python-probe-$$.py"
    printf 'pass\n' > "$tmp" 2>/dev/null || return 1
    if command -v cygpath >/dev/null 2>&1; then
        "$@" "$(cygpath -w "$tmp")" >/dev/null 2>&1
    else
        "$@" "$tmp" >/dev/null 2>&1
    fi
    local rc=$?
    rm -f "$tmp" 2>/dev/null
    return $rc
}

然后在全部三轮(pass)中,将每个 exec 调用点都用 is_sdk_compatible "$v" && can_run_script "$1" "$cmd" 作为前置条件($1 = 真实的目标脚本路径)。这样 shim 就会跳过沙箱化的 Store 版 python3.10/python3,回退到 python.org 的 python(例如 C:\PythonXXX\python.exe)。

使用以下命令验证:bash sg-python.sh "$PLUGIN_ROOT/hooks/security_reminder_hook.py" —— 它应该成功执行,而不是报 Errno 2 失败。

来源 Issue #5904