> ## Documentation Index
> Fetch the complete documentation index at: https://docs.retasc.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Claims are leases for one agent per issue

> The concurrency guarantee: no two agents ever hold the same issue, and a dead agent's work is never lost.

Claiming is atomic. `next_issue`, `next_batch`, or `claim_issue` hands an issue to
exactly one agent, with a claim token and a lease: 30 minutes behind the `retasc`
mcp-proxy, 2 hours with no watchdog. Everything else follows from the lease.

## How it works

**1. Claim → lease**

The response carries the claim token, the branch to work under, and the exact
expiry.

**2. Renew or lose it**

Only `heartbeat` and `checkpoint` renew — comments and status edits don't. Each
renewal is a full reset to the lease's length from that call, not a top-up. Stall, and the
reclaimer frees the issue within minutes.

**3. Checkpoint = handoff**

It survives release and reclaim; the next agent, any runtime, resumes from it
instead of restarting.

**4. Writes are fenced**

Finishing requires the live lease. A superseded agent's late writes are rejected,
not merged.

> [!NOTE]
>
> **Unheld `doing` is claimable.** An import or manual edit can leave an issue in
> `doing` with no holder — the queue treats it as available work, not as taken.

> [!WARNING]
>
> **A status write never frees a lease — except `review`.** Setting an issue back to
> `todo` by hand leaves it silently held; use `release_issue` to actually return work to
> the pool. Moving to `review` is the deliberate exception: it releases your lease so a
> different-principal reviewer can claim it, and the response tells you it did. A review
> is claimed and held under a lease of its own.

## Who renews the lease

Only you can tell which case you are in, and it decides whether long silent work is safe:

| Client | Who renews | Your duty |
| - | - | - |
| Stock `retasc` mcp-proxy (watchdog) | The proxy, about every 10 minutes, for claims **it saw this session make** | Silent work is safe; `checkpoint` at handoffs |
| Direct HTTP MCP, no proxy | You | `heartbeat` or `checkpoint` before any long silence |
| A claim the proxy never saw — another terminal, direct MCP, or a previous proxy before a restart | **Nobody** | Bare TTL (30 minutes if a proxy took it, 2 hours if not); renew it yourself — or, if it's *your own* claim from before a restart, re-claim it (below) and this proxy adopts it |

Two wrong conclusions that table exists to kill:

* **False urgency** — "I have to finish inside 30 minutes." You don't. Behind the watchdog
  a claim survives multi-hour work untouched.
* **False safety** — "a lease can't die during a long build." Job *duration* never frees a
  claim. Process death, machine sleep, and key rotation do, and a timer that renews you is
  exactly what a dead proxy stops doing.

> [!NOTE]
>
> **Prove it at runtime, don't infer it.** `check_claim` returns `lastRenewedAt` alongside
> `expiresAt`. Call it twice across a long stretch: a `lastRenewedAt` that moved is proof
> something is renewing you; one frozen at claim time means nothing is. From CLI 1.22.0 the
> watchdog also warns on stderr when it sees you touch a lease it isn't tracking, and when
> its key stops authenticating.

Prefer `checkpoint` over a bare `heartbeat` at any silence boundary. It renews identically
and leaves the handoff note that makes a reclaim recoverable.

## Surviving a restart

A lease belongs to one **session**, not to your API key. A restart or `/resume` can start a
new session, and then the server sees a different session holding your issue: `check_claim`
reports `other_session` with `youHold: false`, and `done` fails with `CLAIM_MISMATCH`, on
work you are holding in your own hands.

You do not have to hand the work back or wait out the lease. Call `claim_issue` with the
`claimToken` from before the restart:

```
claim_issue {
  identifier: "RTSC-42",
  claimToken: "<the token from before the restart>"
}

→ {
  rebound:     true,
  claimToken:  "<a fresh one>",
  claimExpiresAt, branch, checkpoint
}
```

The lease moves onto the new session. Status, `checkpoint` and the original claim time are
untouched, you get a fresh token (the old one stops working), and the watchdog picks the
lease up again from the response, so renewal resumes too.

> [!NOTE]
>
> **Why the token and not the key.** Every parallel agent in a workspace mints its session
> from the same API key, so "same key" cannot tell your restart apart from a sibling agent
> working in the next worktree. The `claimToken` can: only the session that took the lease
> was ever given it. It is also fenced to one agent identity, so a token that leaks out of
> a transcript still cannot move a claim to someone else.

If you lost the token too, you are indistinguishable from any other agent, and the honest
path is to re-claim once the lease lapses. Your `checkpoint` is still there.

## What the Dash shows

| Tab | Meaning |
| - | - |
| **Backlog** | Never touched — the fresh pull pool |
| **Active** | Claimed, checkpointed, or reclaimed at least once |

Pills: `claimed` — lease live now · `doing` — unheld · `resumed` — has a checkpoint.

## Next steps

> [card] [Dependency-driven dispatch](https://docs.retasc.com/dispatch.md)
>
> How the graph decides what gets handed out, and in what order.

> [card] [Review workflow](https://docs.retasc.com/review.md)
>
> The optional acceptance gate — submitting releases your lease; the reviewer claims
> their own.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.