agent-resume

A command that reads handoff and workflow status files left by an earlier coding agent and decides what action should happen next. It can consider a pull request, issue, continuous-integration checks, or a failed previous workflow.

In plain words
What is it for?
Use it to resume work on a pull request or issue, wait for CI checks, investigate CI failures, or determine whether a previous agent completed or needs follow-up.
Why use it?
It helps continue unfinished work without making the next agent reconstruct the project’s current state from the beginning.

Command for Claude Code

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/xsovad06/sova/agent-resume
Clone the repo
git clone --depth 1 https://github.com/xsovad06/sova

Made for: Claude Code.

Per session 16 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,672 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00016 $0.01672
Opus 5 $0.00008 $0.00836
Sonnet 5 $0.00003 $0.00334
Haiku 4.5 $0.00002 $0.00167

Measured 2d ago against content hash ae62be257cf1, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade B, and why

agent-resume scanned grade B with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

cat .claude/agent-control/handoff.json 2>/dev/null
.claude/commands/agent-resume.md · 160 lines

How it starts

The opening of the file, as written. The whole thing — 160 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Agent Resume

Read the current handoff state and determine what to do next. This is the "smart router" command -- it inspects the current state of a PR or issue and autonomously decides the next action.

ARGS: $ARGUMENTS

Instructions

You are an autonomous agent that picks up where a previous agent left off. Your job is to assess the current situation and take the appropriate next step.

1. Read Current State

Read all available state:

# Handoff from previous agent
cat .claude/agent-control/handoff.json 2>/dev/null

# Agent control status
cat .claude/agent-control/status.json 2>/dev/null

Parse the arguments -- they may include:

  • pr=<NUMBER> -- a specific PR to work on
  • issue=<NUMBER> -- a GitHub Issue to work on
  • wait_for=ci -- wait for CI checks to pass
  • investigate_ci=true -- investigate CI failures

2. Determine Situation

If a handoff exists, check its status:

  • awaiting_action -- previous agent finished but needs human decision. Assess if any action can be taken automatically based on the args.
  • completed -- previous workflow is done. Check if there is follow-up work.
  • failed -- previous agent failed. Diagnose and suggest recovery.

If no handoff exists, use the PR number or issue to assess the current state:

# Get PR state
gh pr view <PR_NUMBER> --json state,reviewDecision,statusCheckRollup,headRefName,baseRefName,mergeable,commits

# Check if branch is behind base
gh pr view <PR_NUMBER> --json mergeStateStatus --jq '.mergeStateStatus'

# Check CI
gh pr checks <PR_NUMBER>

# Check for review comments needing attention
gh api repos/<OWNER>/<REPO>/pulls/<PR_NUMBER>/comments --jq '[.[] | select(.in_reply_to_id == null)] | length'
gh api repos/<OWNER>/<REPO>/pulls/<PR_NUMBER>/reviews --jq '.[] | "\(.user.login): \(.state)"'

3. Act Based on Situation

PR is behind base branch -- rebase and push:

  • Fetch latest base, rebase the PR branch, push with --force-with-lease
  • If there are merge conflicts, attempt to resolve them (read each conflicted file, understand both sides of each conflict marker, resolve, git add, git rebase --continue -- up to 3 rebase steps)
  • If resolution fails, run git rebase --abort and write a failed handoff listing conflicting files
  • Write handoff with merge options

Read the full file on GitHub · 160 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 160 lines · 16 tokens per session scan B ae62be257cf1

Subscribe to this mod's changes

agent-resume is a command published in the GitHub repository xsovad06/sova (2 stars, last pushed 3d ago), licensed Apache-2.0. It adds 16 tokens to every session and 1,672 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.