Agent skill

Berth Hooks

by sean-brydon in sean-brydon/berthd

Automate berth with hooks — run a command when something happens (an agent finishes or needs the user, a worktree is created or removed, a session starts) or gate an action with a before: hook that…

MITAuto-check passedDevelopment

Install Berth Hooks

skills CLI
$ npx skills add sean-brydon/berthd --skill berth-hooks -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install sean-brydon/berthd berth-hooks --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/sean-brydon/berthd.git skills-src && mkdir -p .claude/skills && cp -r skills-src/internal/integrations/skills/berth-hooks .claude/skills/berth-hooks && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
berth-hooks
GitHub stars
286
Token cost
~944 tokens
SKILL.md length
318 words
Files
1
Skills in repo
10
Repo updated
First seen
Licence
MIT

At a glance

Automate berth with hooks — run a command when something happens (an agent finishes or needs the user, a worktree is created or removed, a session starts) or gate an action with a before: hook that…

  • The user asks to automate a workflow
  • SKILL.md covers Where a hook lives decides…, What a hook gets, Events and Test before you rely on it, plus 1 more section
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md
  • React to agents

What it does

Berth Hooks is an agent skill from sean-brydon/berthd. Automate berth with hooks — run a command when something happens (an agent finishes or needs the user, a worktree is created or removed, a session starts) or gate an action with a before: hook that can refuse it. Covers where hooks live (a repository's .berth/config.json, a box, the laptop), the event catalog, the variables hooks get, and how to test them. Use when the user asks to automate a workflow, react to agents or worktrees, block something, or set up per-worktree databases and ports.

Its SKILL.md is about 940 tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Development, covering Git worktrees. It works with React. The repository describes itself as: Run coding agents on your dev boxes: worktrees, terminals, orchestration, kits and automations, with a desktop app. The licence is MIT.

When your agent uses it

  • The user asks to automate a workflow
  • React to agents
  • Block something
  • Set up per-worktree databases and ports

Example prompts

  • “/berth-hooks”

What it can do on your machine

Read from SKILL.md and the folder at commit fc5b184. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are json and bash).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Berth Hooks loads about 944 tokens when it runs. Until then it costs about 127 tokens; SKILL.md has 318 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~127
When it runs · the whole SKILL.md, loaded when a task matches
~944

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from sean-brydon/berthd at commit fc5b184, republished under its MIT licence (© sean-brydon). 318 words, ~944 tokens.

Download SKILL.mdSave it as .claude/skills/berth-hooks/SKILL.md (or your agent's skills folder).
name
berth-hooks
description
Automate berth with hooks — run a command when something happens (an agent finishes or needs the user, a worktree is created or removed, a session starts) or gate an action with a before: hook that can refuse it. Covers where hooks live (a repository's .berth/config.json, a box, the laptop), the event catalog, the variables hooks get, and how to test them. Use when the user asks to automate a workflow, react to agents or worktrees, block something, or set up per-worktree databases and ports.

berth hooks

A hook runs a shell command when an event happens. A hook whose on starts with before: runs first and can refuse the action by exiting non-zero; what it prints becomes the error everyone sees.

json
{ "hooks": [
  { "on": "agent.waiting", "run": "notify-send \"$BERTH_PATH needs you\"" },
  { "on": "worktree.*", "run": "echo \"$BERTH_EVENT $BERTH_NAME\" >> ~/worktrees.log" },
  { "on": "before:worktree.create", "run": "case \"$BERTH_BRANCH\" in main|master) echo 'not on main'; exit 1;; esac" }
] }

on is an event type, a prefix like worktree.*, or *. Optional: timeout (30s, 5m; default 1m, 30s for gates) and tool (a hook with "tool": "slack" skips events whose origin is slack, which stops loops).

Where a hook lives decides where it runs

ScopeFileRunsGood for
A repositoryhooks in .berth/config.json (or the box's config for the location)on the box, only for that repo's events, in the worktree with its environmentper-worktree databases, seeding, codegen
A box~/.berth/hooks.json on the boxon the box, for every event therebox-wide policy, logging
The laptop~/.berth/hooks.json on the laptopon the laptop, for events from every boxnotifications, opening things locally

Repository hooks get the worktree's variables ($BERTH_WORKTREE_PATH, $BERTH_WORKTREE_SLUG, $BERTH_PORT, …) plus the repository's env. Prefer setup / archive in .berth/config.json for one-time worktree setup and teardown; use hooks for reactions to other events.

What a hook gets

  • The event as JSON on stdin: {"type","time","box","origin","data":{…}}.
  • BERTH_EVENT, BERTH_EVENT_BOX, BERTH_EVENT_ORIGIN, and each data field upper-cased: BERTH_PATH, BERTH_NAME, BERTH_LOCATION, BERTH_BRANCH, …

Events

worktree.created, worktree.removed, worktree.setup.{started,finished,failed}, worktree.archive.{started,finished,failed}, task.created, session.started, session.stopped, session.sent, agent.ready (idle at its prompt), agent.started, agent.waiting (needs a human), agent.finished, service.started, service.stopped, exec.finished, preview.open, location.added, location.removed, config.changed, share.started, share.stopped, and on the laptop box.connected, box.disconnected, forward.*.

Gates: before:worktree.create, before:worktree.remove, before:task.create, before:session.start, before:session.stop, before:session.send, before:exec, before:location.add, before:config.change, before:skills.install, before:skills.uninstall.

Test before you rely on it

sh
berthd events                                   # watch events arrive (Ctrl-C to stop)
berthd emit agent.finished path="$PWD"          # fire one to try a hook

Safety

  • Ask before adding or changing hooks: they run automatically, as the user.
  • Keep commands short, idempotent and quick; put long work in a script.
  • Never put secrets in a committed .berth/config.json; use the box's own config for the location, or read them from the environment at run time.
  • A gate that fails closed blocks the user; print a clear reason.

© sean-brydon, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in internal/integrations/skills/berth-hooks of sean-brydon/berthd.

Open the folder on GitHubat commit fc5b184

Compare with similar skills

Berth Hooks next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Berth Hooks compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Berth Hooks this skillsean-brydon/berthd286—~944Automated safety check: PassMIT
WorktreesGetStream/stream-chat-react845—~794Automated safety check: PassCustom licence
React Refactor Tournamentragnar-pwninskjold/tech-snacks137—~1.3kAutomated safety check: PassMIT
Vercel Composition Patternssupabase/supabase111k58 repos~726Automated safety check: PassMIT
Finishing a Development Branchobra/superpowers297k5 repos~1.9kAutomated safety check: PassMIT
Electron Multi-Process ArchitectureiOfficeAI/AionUi33k1 repos~1.8kAutomated safety check: PassApache-2.0

Similar skills

  • Worktrees

    GetStream/stream-chat-react

    Creates and manages git worktrees for isolated plan execution.

    845 GitHub stars~794 tokensUpdated yesterday
    DevelopmentAuto-check passed
  • React Refactor Tournament

    ragnar-pwninskjold/tech-snacks

    Review React/Next.js code against the real vercel-react-best-practices skill, backlog the performance findings keyed to actual rule ids + impact tiers, rank the most over-subscribed tiers, then fix…

    137 GitHub stars~1.3k tokensUpdated 1 mo ago
    DevelopmentAuto-check passed
  • Official

    React composition patterns that scale. An agent skill from supabase/supabase.

    111k GitHub starsUsed in 58 repos~726 tokens
    DevelopmentAuto-check passed
  • Walks the last step of a branch: confirm tests pass, detect the git environment, ask how to integrate, carry out your choice and clean up the worktree.

    297k GitHub starsUsed in 5 repos~1.9k tokens
    DevelopmentAuto-check passed
  • Tells the agent where new code belongs in an Electron multi-process project and which APIs each process may use, with rules for new bridges, services, agents and workers.

    33k GitHub starsUsed in 1 repo~1.8k tokens
    DevelopmentAuto-check passed
  • Migrate Core Code to Submodules

    tinyhumansai/openhuman

    Plans and carries out moving non-host-specific code and its tests from the OpenHuman core into vendored tiny submodule libraries, then releases the submodule and re-pins the host.

    42k GitHub stars~2.6k tokensUpdated today
    DevelopmentAuto-check passed

More from sean-brydon/berthd

All 10 skills in this repo
  • Berth

    sean-brydon/berthd

    Use berth to work across development boxes — list repos (locations) and their worktrees, make a worktree or a task (a worktree with an agent in it), start or read terminal sessions, find which port…

    286 GitHub stars~1.7k tokensUpdated today
    Auto-check passed
  • Berth Artifacts

    sean-brydon/berthd

    Show the user data as a chart, table, diagram, notes or one small page in their Shipyard app instead of a wall of text — write a berth.chart JSON, a CSV, Mermaid, Markdown or a self-contained HTML…

    286 GitHub stars~2.6k tokensUpdated today
    Auto-check: notes
  • Berth Browser

    sean-brydon/berthd

    Use your worktree's own page in a headless browser on the box — open it, read a compact snapshot with @refs, click, fill, press keys, wait, take a screenshot to a file, read console errors, and set…

    286 GitHub stars~1.4k tokensUpdated today
    Auto-check passed
  • Berth Orchestrate

    sean-brydon/berthd

    Drive other coding agents through berth — prompt a running agent, wait for its turn to end, run a check in its worktree, loop until a check passes, hand work to a fresh agent in a new worktree, ask…

    286 GitHub stars~2.1k tokensUpdated today
    Auto-check passed
  • Berth Preview

    sean-brydon/berthd

    Run a worktree's dev server on its own port and show the page to the user in their Shipyard app — start the app on $BERTHPORT, check it answers, and open it as a browser tab next to your terminal…

    286 GitHub stars~551 tokensUpdated today
    Auto-check passed
  • Berth Visual Diff

    sean-brydon/berthd

    Check what your change did to a web app's pages before you say you're done — berthd shots compare screenshots your worktree's dev server and the main checkout's at phone, tablet and desktop widths…

    286 GitHub stars~2k tokensUpdated today
    Auto-check passed

Works with

Categories

Questions about Berth Hooks

What does Berth Hooks do?

Automate berth with hooks — run a command when something happens (an agent finishes or needs the user, a worktree is created or removed, a session starts) or gate an action with a before: hook that…. Berth Hooks is an agent skill from sean-brydon/berthd. Automate berth with hooks — run a command when something happens (an agent finishes or needs the user, a worktree is created or removed, a session starts) or gate an action with a before: hook that can refuse it.

When should I use Berth Hooks?

Berth Hooks fits situations like: the user asks to automate a workflow; React to agents; block something; set up per-worktree databases and ports.

How do I install Berth Hooks in Claude Code?

Run `npx skills add sean-brydon/berthd --skill berth-hooks -a claude-code`. Or copy the skill folder (internal/integrations/skills/berth-hooks in sean-brydon/berthd) into .claude/skills/berth-hooks in your project. Claude Code loads it when a task matches its description.

How do I install Berth Hooks in Codex?

Run `npx skills add sean-brydon/berthd --skill berth-hooks -a codex`. Or copy the skill folder (internal/integrations/skills/berth-hooks in sean-brydon/berthd) into .agents/skills/berth-hooks in your project. Codex loads it when a task matches its description.

Can I use Berth Hooks in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add sean-brydon/berthd --skill berth-hooks -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/berth-hooks, .gemini/skills/berth-hooks, .github/skills/berth-hooks and .opencode/skills/berth-hooks in your project.

What does Berth Hooks need to run?

SKILL.md names no scripts, command-line tools or credentials: Berth Hooks is instructions for the agent only.

Does Berth Hooks access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Berth Hooks safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Berth Hooks use?

Berth Hooks is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Berth Hooks use?

About 944 tokens (SKILL.md is roughly 3.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Berth Hooks?

Skills that share tags, products or a category with Berth Hooks: Worktrees (GetStream/stream-chat-react, 845 stars), React Refactor Tournament (ragnar-pwninskjold/tech-snacks, 137 stars), Vercel Composition Patterns (supabase/supabase, 111k stars) and Finishing a Development Branch (obra/superpowers, 297k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Berth Hooks?

sean-brydon (a GitHub user) maintains it in sean-brydon/berthd, which has 286 GitHub stars. The repository holds 10 skills in this directory. The repository was last updated on October 9, 2026.

Source: sean-brydon/berthd on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.