Ado· @adocomplete · X·精选AI 评分69
Claude Code 技能技巧:用 !`gh pr diff` 让技能加载时先跑 shell 命令
AI 导读
Anthropic 开发者关系的 Ado 在 Advent of Claude 2026 第二天介绍 Claude Code 的一个技巧,技能可以在 Claude 读取前先运行 shell 命令。在 SKILL.md 中写入 !`gh pr diff`,技能加载时真实 diff 就已就位,省去一轮'让我看看 diff'的等待。
推荐理由
作者演示了 Claude Code 技能可在加载时先运行 shell 命令的写法,方法可直接迁移到日常 SKILL.md 编排。
正文 · 原文
Advent of Claude 2026 - Day 2 - Claude Code - Skills that run the shell first
A skill can run commands before Claude reads it. Write !gh pr diff in SKILL.md and the real diff is sitting there when the skill loads. No turn wasted on "let me check the diff".
来源:Ado · x.com