cleanup-issue
Delete an issue's working directory (.claude-work/issues/<ID>/) after confirming with the user via interactive prompt
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Delete an issue's working directory (.claude-work/issues/<ID>/) after confirming with the user via interactive prompt
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Add a dependency relationship between GitHub issues using the native addBlockedBy mutation
Reusable file sequence numbering with prefix (NNNN-name) and suffix (name-NNNN) modes. Returns the next available zero-padded sequence number for a given directory.
Drop a timestamped note for the current issue - collected by /finish-issue for PR descriptions
Create or update CHANGELOG entries with tone guardrails, thematic grouping, and implementation-detail leak detection.
Create a commit message file in .claude-work/commit-msgs/ with auto-numbered filenames. Focuses on WHY not WHAT. The diff already shows what changed. User reviews and commits manually.
Create a GitHub issue from a file draft or inline description, with smart label discovery and sub-issue linking
| name | cleanup-issue |
| version | 2026.07.27@6dc7d1d |
| description | Delete an issue's working directory (.claude-work/issues/<ID>/) after confirming with the user via interactive prompt |
| argument-hint | [{"optional":"issue-number"}] |
| allowed-tools | Read, Glob, AskUserQuestion, Bash(git branch --show-current), Bash(*/skills/cleanup-issue/remove-issue-dir.sh *), Bash(*/skills/issue-context/claude-work-root.sh *) |
Remove an issue's working directory after the work is done. Uses AskUserQuestion to confirm before deleting anything.
Input: $ARGUMENTS (optional issue number; if omitted, detects from branch)
If $ARGUMENTS is provided and is a number, use it as the issue ID.
Otherwise, detect from the current branch:
git branch --show-current
Extract the issue ID from the issues/<ID> pattern (numeric prefix before the first -/_ when present, otherwise the full segment after issues/). If the branch doesn't match issues/*, and no argument was provided, STOP:
/cleanup-issue 42"The remove-issue-dir.sh script enforces ID validation internally (regex ^[A-Za-z0-9][A-Za-z0-9._-]*$, rejects . and ..). The ID extracted above is passed verbatim to the script in Step 4; if invalid, the script exits with a clear error and performs no deletion. No separate prose validation step is needed.
First, resolve the .claude-work/ root directory:
~/.claude/skills/issue-context/claude-work-root.sh
Use the stdout as <base> for all .claude-work/ paths below. This script automatically detects git worktrees and returns the shared location.
Check if the issue directory exists:
<base>/issues/<ID>/
Use Glob to list contents:
Glob(pattern="**/*", path="<base>/issues/<ID>")
If directory doesn't exist or is empty:
<ID> at <base>/issues/<ID>/."Use AskUserQuestion to prompt for confirmation. Include the full directory path and file list in the question so the user knows exactly what will be deleted.
AskUserQuestion(
question: "Delete working directory for issue #<ID>?\n\n<base>/issues/<ID>/ contains:\n<file list from Step 2>\n\nThis is irreversible.",
options: [
{ label: "Delete", description: "Remove <base>/issues/<ID>/ and all contents" },
{ label: "Keep", description: "Leave everything untouched" }
]
)
<base>/issues/<ID>/ untouched." and STOPOnly reached if the user selected Delete in Step 3. The remove-issue-dir.sh script validates the ID, verifies the base path, checks that the resolved physical path stays under <base>/issues/, and performs the removal. No raw rm -rf is used.
~/.claude/skills/cleanup-issue/remove-issue-dir.sh <base> <ID>
The script prints the removed path on stdout. Report that path to the user:
Cleaned up <stdout>/. All working files removed.
Regardless of whether the issue directory existed or was deleted, scan for orphaned side-quest files in the .claude-work/ root (using <base> from Step 2):
Glob(pattern="breadcrumb-*.md", path="<base>")
Glob(pattern="scratchpads/*side-quest*", path="<base>")
Glob(pattern="commit-msgs/*side-quest*", path="<base>")
If side-quest artifacts are found:
If no side-quest artifacts found: skip silently.
See /prose-style for hard-wrap rules.