Skip to content

Agent skills

uh install writes two skills into your coding agents. Each skill tells the agent how to start a uh review and give you the URL. Supported agents: Claude Code, Codex, Antigravity, OpenCode and GitHub Copilot.

uh install --dry-run   # show what would change
uh install             # install into every detected agent

For the full flag table, see uh install in the CLI reference.

The skills

Skill Use it for What the agent runs
uhdiff-local-review Working tree changes, a commit range, or a branch diff against main uh queue add . ... then uh queue --open, or uh review . [RANGE]
uhdiff-github-review A GitHub pull request URL uh queue add <github-pr-url> then uh queue --open, or uh review <github-pr-url>

Both skills tell the agent to run the server in the background and print the http://127.0.0.1:<port> URL.

uhdiff-local-review

The skill offers two options.

Option A, add to the review queue. Use this for a titled summary or several diffs:

uh queue add . --target main --head HEAD --title "Short summary" --body "Markdown overview..." --ephemeral
uh queue --open    # or `uh queue` to print the localhost URL without opening a browser
  • Leave out --head to diff uncommitted working-tree changes against --target.
  • --body is Markdown shown in the Overview tab.
  • --ephemeral adds a one-click Discard.

Option B, a single uh review:

Scope Command
Uncommitted changes (or the latest commit if the tree is clean) uh review .
Branch diff against main uh review . main...HEAD
Explicit range uh review . <base>..<head> or uh review . --base <rev> --head <rev>
Patch file or stdin uh review . --diff <path-or-dash>

The skill also mentions --open, --ast-diff, --port <port> and --dump-html <path>.

uhdiff-github-review

  1. Confirm the PR URL (https://github.com/<owner>/<repo>/pull/<number> or the GitHub Enterprise equivalent).
  2. If gh has more than one account, pass --gh-account <login>, or save a default with uh config set default_gh_account <login> (see configuration).
  3. Start the review with uh queue add <github-pr-url> and uh queue --open, or with uh review <github-pr-url> (add --open or --ast-diff if wanted).

Explicit-only invocation

The agent runs these skills only when you ask. Three settings enforce this:

  • Each SKILL.md has this frontmatter:

    disable-model-invocation: true
    user-invocable: true
    
  • Codex also gets agents/openai.yaml in each skill directory:

    policy:
      allow_implicit_invocation: false
    
  • The body of each skill starts with "Explicit invocation only: Never trigger this skill automatically."

Install locations

All paths are relative to $HOME, or to the directory you pass with --home.

Harness --target Root Files written
Claude Code claude (alias claude-code) ~/.claude/skills/ <skill>/SKILL.md, <skill>/.managed-by-uhdiff
Codex codex ~/.codex/skills/ <skill>/SKILL.md, <skill>/agents/openai.yaml, <skill>/.managed-by-uhdiff
Antigravity antigravity (alias agy) ~/.gemini/config/plugins/uhdiff/ plugin.json, skills/<skill>/SKILL.md, .managed-by-uhdiff
OpenCode opencode ~/.config/opencode/skills/ <skill>/SKILL.md, <skill>/.managed-by-uhdiff
GitHub Copilot copilot ~/.copilot/skills/ <skill>/SKILL.md, <skill>/.managed-by-uhdiff

<skill> is uhdiff-local-review and uhdiff-github-review. Every harness except Antigravity gets one directory per skill. Antigravity gets one uhdiff plugin directory holding both skills and this plugin.json:

{
  "name": "uhdiff",
  "version": "0.1.0",
  "description": "Explicit user-invoked skills for launching local and GitHub PR code reviews with uhdiff."
}

version is the uh binary version that wrote the file.

Choosing harnesses

--target accepts a comma-separated list (--target claude,codex), can be repeated, and accepts all.

If you leave out --target:

  • uh install targets every detected harness.
  • uh install --uninstall targets all five harnesses, detected or not.

A harness counts as detected when its CLI is on PATH or one of its paths exists under the home directory:

Harness Program on PATH Or any of these exists
Claude Code claude ~/.claude, ~/.claude.json
Codex codex ~/.codex
Antigravity agy ~/.gemini/config, ~/.gemini/antigravity-cli, ~/.gemini/antigravity
OpenCode opencode ~/.config/opencode
GitHub Copilot copilot ~/.copilot

--home turns off PATH probing

With --home <dir>, detection checks only paths under <dir>, not PATH. Without --home, uh reads $HOME and fails with HOME is not set; pass --home <path> explicitly if it is unset or empty.

If nothing is detected, nothing is written and the command exits 0:

uhdiff install: no supported agent harnesses detected (claude, codex, antigravity, opencode, copilot).
Pass `--target all` or `--target claude,codex,...` to target specific harnesses.

Preview with --dry-run

--dry-run reports changes without writing or deleting anything. Every output line starts with [dry-run]. With only ~/.claude and ~/.config/opencode present:

$ uh install --dry-run
[dry-run] uhdiff install summary:
  claude       (Claude Code   ) : would install (/home/me/.claude/skills)
    - uhdiff-local-review    : would install
    - uhdiff-github-review   : would install
  opencode     (OpenCode      ) : would install (/home/me/.config/opencode/skills)
    - uhdiff-local-review    : would install
    - uhdiff-github-review   : would install

Each harness line shows the result and root path, then one line per skill. Antigravity gets one uhdiff plugin line.

Re-running and upgrading

uh install writes a .managed-by-uhdiff marker into each directory it manages. On every run, uh checks each target directory:

State of the target directory Install Uninstall
Missing installed (dry run: would install) not present
Has the marker, contents match exactly unchanged removed (dry run: would remove)
Has the marker, contents differ updated (dry run: would update) removed (dry run: would remove)
No marker (yours) skipped (user-owned) skipped (user-owned)
  • Running it again with nothing changed reports unchanged and writes nothing.
  • After you upgrade uh, run uh install again to replace managed skills. Any edit to a managed file, or any extra file in a managed directory, counts as different. The next install overwrites the whole directory.
  • An update builds the new directory beside the old one, then renames it into place.
  • To keep your own edits, delete .managed-by-uhdiff from that directory. Then uh install and uh install --uninstall leave it alone.
$ uh install --target claude
uhdiff install summary:
  claude       (Claude Code   ) : unchanged (/home/me/.claude/skills)
    - uhdiff-local-review    : unchanged
    - uhdiff-github-review   : unchanged

Uninstall

uh install --uninstall --dry-run   # preview
uh install --uninstall             # remove from all five harnesses
uh install --uninstall --target codex

Uninstall deletes only managed skill directories (or the Antigravity uhdiff plugin directory). It keeps the parent directory, such as ~/.claude/skills/. Harnesses with nothing installed report not present:

$ uh install --uninstall --dry-run
[dry-run] uhdiff uninstall summary:
  claude       (Claude Code   ) : not present (/home/me/.claude/skills)
    - uhdiff-local-review    : not present
    - uhdiff-github-review   : not present
  codex        (Codex         ) : not present (/home/me/.codex/skills)
    - uhdiff-local-review    : not present
    - uhdiff-github-review   : not present
  antigravity  (Antigravity   ) : not present (/home/me/.gemini/config/plugins/uhdiff)
    - uhdiff plugin          : not present
  opencode     (OpenCode      ) : not present (/home/me/.config/opencode/skills)
    - uhdiff-local-review    : not present
    - uhdiff-github-review   : not present
  copilot      (GitHub Copilot) : not present (/home/me/.copilot/skills)
    - uhdiff-local-review    : not present
    - uhdiff-github-review   : not present

Testing in a scratch home

--home points the install at another directory. Use it to see the exact files without touching your agent configuration:

mkdir -p /tmp/uh-home
uh install --target all --home /tmp/uh-home
find /tmp/uh-home -type f
uh install --uninstall --home /tmp/uh-home