Skip to content
Back to skills

Close

ASecurity

Use when the user says to close yourself, close your pane or tab, or that you're done, and when your dispatch prompt says to close once the PR is open. Closes this session's Rex or herdr pane and starts a background session to watch an open pull request, or minimizes the pane while CI is still running. Also closes a child pane this session dispatched.

  • 18 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added November 17, 2026
ai-agentsgobash

Works with

  • terminal

Security analysis

A100/100

Pro scans all 13 files and shows the line behind each finding

Scanned December 2, 2026

npx -y skills add bendrucker/claude --skill close --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Close?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Close
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/bendrucker-close/badge)](https://www.skillsdirectory.com/skills/bendrucker-close)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: close
description: >-
  Use when the user says to close yourself, close your pane or tab, or that you're done, and when your dispatch prompt says to close once the PR is open. Closes this session's Rex or herdr pane and starts a background session to watch an open pull request, or minimizes the pane while CI is still running. Also closes a child pane this session dispatched.
argument-hint: "[--target <name>]"
allowed-tools:
  - Bash(claude-dispatch-close:*)
  - 'Bash(sh "${CLAUDE_PLUGIN_ROOT}/scripts/bin-path-check.sh":*)'
---

# Close

Get a finished session out of the user's way without losing work. The pane closes. The worktree and branch stay on disk, where the nightly prune removes them once the PR merges. An open PR keeps a watcher: a new background session, started once this session's process exits, that keeps CI green and conflicts resolved until the PR merges or closes.

## Context

- Session: `${CLAUDE_SESSION_ID}`

## Arguments

- `--target <name>`: close the pane of a session this one dispatched, by its dispatch `name`. Default: this session's own pane.

## Close This Pane

!`sh "${CLAUDE_PLUGIN_ROOT}/scripts/bin-path-check.sh" claude-dispatch-close`

1. Leave the worktree, branch, and any `tmp/` output in place, and make no extra commits.
2. Write a summary of one to three lines: what is done, and what is left on disk.
3. Find the open PR or MR for this branch, and read its CI with `gh pr checks <url>` or `glab ci status`.
4. Tell the user in one line what happens to the pane, and where the work continues.
5. Run the command for the branch's condition, as one plain command:
   - No PR or MR: `claude-dispatch-close close --session ${CLAUDE_SESSION_ID} --summary "<summary>"`
   - Every check passed: `claude-dispatch-close close --handoff --session ${CLAUDE_SESSION_ID} --pr <url> --summary "<summary>"`
   - A check pending or failing: `claude-dispatch-close park --session ${CLAUDE_SESSION_ID} --pr <url> --summary "<summary>"`, then continue under Parked.

`close` is the last tool call of the session. On success it never returns, because closing the pane ends this session. When it returns, the pane is still open: report the error it printed and stop. When `park` refuses, run the command its error names.

## Parked

`park` minimizes the pane, and this session keeps running.

1. Run `pull-request:babysit <url>` in this session.
2. Once every check passes, run the `close --handoff` command above.
3. When a failure needs the user's judgment, run `claude-dispatch-close restore --session ${CLAUDE_SESSION_ID}`, then ask with `AskUserQuestion`. `restore` shows the pane without taking focus and marks its tab unread.

## Close a Child Pane

Run `claude-dispatch-close close --target <name>`. It refuses a pane this session did not dispatch. This session keeps running.

## Gotchas

- herdr refuses to close a pane whose workspace leads a group of linked worktree workspaces. `close.ts` reports it and leaves the pane for the user.
- herdr App terminals (`HC_TERMINAL_ID`) are not supported yet. `close.ts` says so, and the user closes the pane.
- `park` works in Rex only, and in a Rex tab with another visible pane.

## Ledger

Every close and park appends a row to the dispatch ledger. `claude-dispatch-close report --count` counts them per event. `claude-dispatch-close report --left-behind` lists closed sessions that left uncommitted or unpushed work. A failed handoff logs to `close-resume-<session>.log` in the dispatch data directory and appends an `ended` row whose summary starts with `resume failed:`.

Files in this skill

  • SKILL.md2.5 KB
  • references/background.md1.7 KB
  • scripts/close.test.ts19.4 KB
  • scripts/close.ts8.4 KB
  • scripts/errors.ts285 B
  • scripts/git.ts1.5 KB
  • scripts/herdr.ts1.6 KB
  • scripts/muxer.ts1.1 KB
  • scripts/muxers.ts958 B
  • scripts/resume.ts5.2 KB
  • scripts/rex.ts1.2 KB
  • scripts/rows.ts1.4 KB
  • scripts/text.ts237 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.