> ## 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 30-minute lease. Everything else follows
from the lease.

## How it works

<Steps>
  <Step title="Claim → lease">
    The response carries the claim token, the branch to work under, and the exact
    expiry.
  </Step>

  <Step title="Renew or lose it">
    Only `heartbeat` and `checkpoint` renew — comments and status edits don't. Each
    renewal is a full reset to 30 minutes from that call, not a top-up. Stall, and the
    reclaimer frees the issue within minutes.
  </Step>

  <Step title="Checkpoint = handoff">
    It survives release and reclaim; the next agent, any runtime, resumes from it
    instead of restarting.
  </Step>

  <Step title="Writes are fenced">
    Finishing requires the live lease. A superseded agent's late writes are rejected,
    not merged.
  </Step>
</Steps>

<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.
</Note>

<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.
</Warning>

## 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 30-minute TTL; 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.
</Note>

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.
</Note>

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

<CardGroup cols={2}>
  <Card title="Dependency-driven dispatch" icon="https://mintcdn.com/retasc/j7UjBeNpjLsHiVcO/icons/share-2.svg?fit=max&auto=format&n=j7UjBeNpjLsHiVcO&q=85&s=0c4dcf015b2b012b73f90824c87be64f" href="/dispatch" width="15" height="15" data-path="icons/share-2.svg">
    How the graph decides what gets handed out, and in what order.
  </Card>

  <Card title="Review workflow" icon="https://mintcdn.com/retasc/j7UjBeNpjLsHiVcO/icons/check-circled.svg?fit=max&auto=format&n=j7UjBeNpjLsHiVcO&q=85&s=47598076c1949211a55cd52f3406a629" href="/review" width="15" height="15" data-path="icons/check-circled.svg">
    The optional acceptance gate — submitting releases your lease; the reviewer claims
    their own.
  </Card>
</CardGroup>


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