Skip to main content
Agent skill

Claim Issue

Atomically claim an issue for a developer (human or agent) via the cross-developer lock ref, so two devs never pick up the same task. Syncs with origin first, refuses if already claimed or already done on main, and pushes the claim immediately without touching main or triggering CI.

Get started

Get the complete skill folder, including its scripts and reference files.

When to use this skill

Use Claim Issue when an AI agent needs a reusable SKILL.md workflow for this job: Atomically claim an issue for a developer (human or agent) via the cross-developer lock ref, so two devs never pick up the same task. Syncs with origin first, refuses if already claimed or already done on main, and pushes the claim immediately without touching main or triggering CI.

When not to use it

Skip Claim Issue when the task is outside the coding category, or when a more specific skill in this directory already covers the same workflow with clearer triggers.

How to install

Where will you use it?

Install scope
Claude Code folder setup
mkdir -p ~/.claude/skills/claim-issue
# Save SKILL.md to ~/.claude/skills/claim-issue/SKILL.md
  1. Claude Code personal install: place the skill and its bundled files at ~/.claude/skills/claim-issue/SKILL.md. For a shared project, commit the folder at .claude/skills/claim-issue/ instead.
  2. Current Claude Code detects SKILL.md changes in watched directories during the session. If you just created a top-level skills directory, run /reload-skills. Check that the skill is listed before testing its trigger.
  3. For Claude chat or Cowork in the Desktop app, manage uploaded skills in Customize > Skills; copying files into a local Claude Code folder is not a Desktop install. Other agents may use different install locations.

Full install guide for Claude, Cursor, and Codex →

Try a starter prompt

After installing the skill, paste this starter prompt into your agent to verify it triggers on a small task.

Starter prompt
Use the Claim Issue skill for this task: Use Claim Issue when this documented workflow matches the task. Confirm any required inputs or files before making changes.

What supports this recommendation?

70/100 provisional content score. This measures documentation, practical detail and source signals. It is not a measured task success rate or a security certification.

Documentation
77/100
Practical detail
68/100
Source evidence
58/100
Source signals
72/100
Model compatibility evidence
  • claudeinferred

    The skill text mentions Claude or a closely associated term. This is keyword-derived compatibility; no hands-on model test is recorded.

  • chatgptuntested

    No model-specific signal or recorded compatibility test was found.

  • geminiuntested

    No model-specific signal or recorded compatibility test was found.

  • copilotuntested

    No model-specific signal or recorded compatibility test was found.

  • llamauntested

    No model-specific signal or recorded compatibility test was found.

  • perplexityuntested

    No model-specific signal or recorded compatibility test was found.

  • mistraluntested

    No model-specific signal or recorded compatibility test was found.

  • grokuntested

    No model-specific signal or recorded compatibility test was found.

Inferred compatibility is based on content signals. Check the app, its available tools and setup requirements before running a skill.

What this skill does

# /claim-issue — atomic cross-developer issue claim (#2168)

With several developers (humans + agents, possibly across forks) on the project, the in-memory TaskList is invisible to other devs. Before starting work on an issue you MUST take a **git-backed lock** so nobody else grabs the same task.

The lock lives on a dedicated orphan ref — `refs/heads/issue-assignments` on `origin` — holding one `<id>.json` per claimed issue. Pushing there does **not** move `main`, so it never rebuilds queued merge groups (#1951) and never triggers CI. The first `git push` wins; a concurrent claimant gets a non-fast-forward rejection, re-fetches, and re-evaluates.

## Claim before you start

```bash # Humans: node scripts/claim-issue.mjs <id> <your-name>

# Dev agents — use your github-account-prefixed name: node scripts/claim-issue.mjs <id> ttraenkler/<agent-name> --branch issue-<id>-<slug> # (or set CLAIM_GITHUB_ACCOUNT=ttraenkler and pass just <agent-name>) ```

The script does the sync-and-check for you, in this order: 1. `git fetch origin` (the assignment ref **and** `main`). 2. Refuse (exit **4**) if the issue is already `done`/`wont-fix` on `origin/main`. 3. Refuse (exit **3**) if it's already claimed by someone else — STOP and pick another issue. (Pass `--force` only to deliberately steal, e.g. reclaiming a suspended branch.) 4. Otherwise write `<id>.json` and push to the ref immediately.

**Interpret the exit code, don't just read the text:** - `0` — you own it. Proceed: create your worktree, set the issue's `status: in-progress` + `assignee:` in your branch (lazy reflection onto `main` lands with your PR), implement. - `3` — taken. Pick the next candidate. - `4` — already closed on main. Skip; flag the tech lead to reconcile the queue. - `5` — push kept getting rejected (heavy contention). Just re-run.

## Inspect / release / complete

```bash node scripts/claim-issue.mjs --list # all live claims (id, assignee, branch) node scripts/claim-issue.mjs --check <id> # is #<id> free? (exit 0 free / 3 taken) node scripts/claim-issue.mjs --release <id> <name> # abandon/suspend — frees it for others node scripts/claim-issue.mjs --complete <id> # mark done when your PR merges ```

Always `--release` when you suspend or abandon a branch so the issue doesn't stay locked. `--complete` is optional bookkeeping (the merged PR's `status: done` on `main` is the real signal); use it to keep `--list` clean.

## Why a separate ref instead of committing to main

Committing the claim to `main` would satisfy "everyone sees it", but **any** push to `main` — even with `[skip ci]` — rebuilds every queued merge group (full 114-job validation per queued PR, ~10 min latency each; see #1951). The orphan ref gives the same cross-developer visibility with zero CI and zero queue churn. The issue file's `assignee` on `main` is updated lazily inside the issue's own PR.

Intended uses

  • Use Claim Issue when this documented workflow matches the task.

Implementation notes

  • Review the source instructions and adapt inputs before running the workflow.

Try it, then tell us how it went

A copied prompt does not tell us whether the task worked. Report your result after checking the output. We collect your tool and outcome, never your files or prompt.