watch-branch

watch-branch is a skill for Claude Code from justincampbell/gh-watch. It costs 45 tokens per session (719 once invoked), scanned A, original, MIT.

A GitHub branch monitor that reports when new commits are pushed. A branch is a separate line of development in a Git repository, such as main or a feature branch.

In plain words
What is it for?
Use it to wait for the next commit, monitor a branch during a work session, or track activity on main.
Why use it?
It avoids repeatedly refreshing GitHub when you need to know whether a branch has changed.

Skill for Claude Code

Written for Claude Code: argument-hint in frontmatter.

Part of the gh-watch plugin — 4 skills shipped together

Good fit Use it to wait for the next commit, monitor a branch during a work session, or track activity on main.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/justincampbell/gh-watch/watch-branch
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add justincampbell/gh-watch --skill watch-branch
Clone the repo
git clone --depth 1 https://github.com/justincampbell/gh-watch

Made for: Claude Code.

Or install gh-watch, the plugin that ships this one along with the rest of its 4 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for watch-branch

README.md
[![agentmods](https://agentmods.dev/badge/skills/justincampbell/gh-watch/watch-branch/github.svg)](https://agentmods.dev/skills/justincampbell/gh-watch/watch-branch)
Your own site
<a href="https://agentmods.dev/skills/justincampbell/gh-watch/watch-branch"><img src="https://agentmods.dev/badge/skills/justincampbell/gh-watch/watch-branch/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for watch-branch

Your own site · 80×15
<a href="https://agentmods.dev/skills/justincampbell/gh-watch/watch-branch"><img src="https://agentmods.dev/badge/skills/justincampbell/gh-watch/watch-branch.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 45 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 719 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00045 $0.00719
Opus 5 $0.00023 $0.00360
Sonnet 5 $0.00009 $0.00144
Haiku 4.5 $0.00005 $0.00072

Measured 12d ago against content hash 40ffa549219b, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

watch-branch scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 12d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugin/skills/watch-branch/SKILL.md · 76 lines

How it starts

The opening of the file, as written. The whole thing — 76 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Watch a Branch

Monitor a branch for new commits using the gh watch CLI extension. It polls GitHub and emits one JSON event per line to stdout when the branch tip changes, which makes it a natural fit for the Monitor tool — each event arrives in the conversation as a notification.

Prerequisites

Check if the extension is installed:

gh watch --help

If not installed:

gh extension install justincampbell/gh-watch

Usage

Run with the Monitor tool (not Bash with run_in_background). The first notification is the initial-state snapshot; subsequent notifications are new-commit events as they land.

Wait for the next commit on main, then exit:

  • command: gh watch branch $ARGUMENTS --exit-on new-commit
  • description: New commits on $ARGUMENTS
  • persistent: false
  • timeout_ms: 3600000 (1 hour — raise/lower based on how long you're willing to wait)

Watch the branch for the rest of the session (every new commit reported as it lands):

  • command: gh watch branch $ARGUMENTS
  • description: Commits on $ARGUMENTS
  • persistent: true (no timeout — stop with TaskStop or end of session)

Flags

Flag Description Default
--interval <duration> Polling interval 60s
--exit Exit after any state change false
--exit-on <events> Exit after specific event types (comma-separated)

Event types

Event Description
initial-state Snapshot of the branch tip at the moment watching started (always emitted first)
new-commit A new commit was pushed to the branch

Output format

One JSON object per line on stdout. The first line is always initial-state — a snapshot of the branch at the moment watching began:

{"timestamp":"...","event":"initial-state","summary":"Branch main at abc1234: Latest commit message","details":{"branch":"main","sha":"abc1234...","message_headline":"Latest commit message","author":"octocat"}}

Read the full file on GitHub · 76 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 12d ago First seen · 76 lines · 45 tokens per session scan A 40ffa549219b

Subscribe to this mod's changes

watch-branch is a skill published in the GitHub repository justincampbell/gh-watch (4 stars, last pushed 24d ago), licensed MIT. It adds 45 tokens to every session and 719 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.