auto

auto is a command for coding agents from sofumel/claude-handoff-revive. It costs 24 tokens per session (1,421 once invoked), scanned B, original, MIT.

A session-only switch for automatically saving a coding session before the agent hands work over. It can be turned on, turned off, or checked.

In plain words
What is it for?
Use it to change or check the current session’s automatic-save setting.
Why use it?
It lets you control automatic handoff saves without changing future sessions. This helps avoid unwanted saves or confirm that saving is enabled.

Command

Part of the handoff-revive plugin — 1 skill, 11 commands, 5 hooks shipped together

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/sofumel/claude-handoff-revive/auto
Clone the repo
git clone --depth 1 https://github.com/sofumel/claude-handoff-revive

Or install handoff-revive, the plugin that ships this one along with the rest of its 1 skill, 11 commands, 5 hooks.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for auto

README.md
[![agentmods](https://agentmods.dev/badge/commands/sofumel/claude-handoff-revive/auto.svg)](https://agentmods.dev/commands/sofumel/claude-handoff-revive/auto)
Your own site
<a href="https://agentmods.dev/commands/sofumel/claude-handoff-revive/auto"><img src="https://agentmods.dev/badge/commands/sofumel/claude-handoff-revive/auto.svg" alt="Measured on agentmods" height="20"></a>
Per session 24 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,421 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.00024 $0.01421
Opus 5 $0.00012 $0.00711
Sonnet 5 $0.00005 $0.00284
Haiku 4.5 $0.00002 $0.00142

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

Security

Grade B, and why

auto 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 3d 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.

SID=$(cat .claude/handoff/.session-id 2>/dev/null || true)
plugins/handoff-revive/commands/auto.md · 101 lines

How it starts

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

Toggle the per-session auto-save switch. Auto-save is enabled by default; this command lets the user opt out (or back in) for the current session only — new sessions reset to default.

Argument: $ARGUMENTS (one of: on, off, status, or empty for status)

How to handle

  1. Resolve and validate the session id. Use the Bash tool (Linux/macOS/WSL/Git-Bash) OR the PowerShell tool (Windows-only environments) to read and validate .claude/handoff/.session-id. Pick whichever shell is available in this environment.

    Bash variant:

    SID=$(cat .claude/handoff/.session-id 2>/dev/null || true)
    # Whitelist: only alphanumerics, dashes, and underscores. Defends against
    # path traversal (../) or shell metacharacters in case .session-id was
    # tampered with. Real Claude Code session_ids are UUIDs; this matches them.
    if [ -z "$SID" ] || ! printf '%s' "$SID" | grep -qE '^[A-Za-z0-9_-]+$'; then
      echo "ERROR: session id missing or invalid"
      exit 1
    fi
    echo "$SID"
    

    PowerShell variant:

    $sid = (Get-Content .claude/handoff/.session-id -Raw -ErrorAction SilentlyContinue)
    if ($sid) { $sid = $sid.Trim().TrimStart([char]0xFEFF) }
    # Same whitelist as the bash variant — defense in depth.
    if (-not $sid -or $sid -notmatch '^[A-Za-z0-9_-]+$') {
      Write-Output "ERROR: session id missing or invalid"
      exit 1
    }
    Write-Output $sid
    

    If the command exits non-zero (empty or invalid), tell the user in their language:

    • "Session ID not yet captured. Make sure the SessionStart hook is enabled (see HOOK_SETUP.md). Try again after one Claude turn."
    • And stop. Do NOT proceed to step 2.
  2. Resolve the action based on $ARGUMENTS:

    • on — Re-enable auto-save for this session:

      rm -f ".claude/handoff/sessions/${SID}.disabled" && echo "ENABLED"
      

      PowerShell: Remove-Item ".claude/handoff/sessions/$sid.disabled" -Force -ErrorAction SilentlyContinue; Write-Output "ENABLED"

      Confirm to user in their language (e.g. ja: 「✓ このセッションでの自動保存を有効にしました。90% / 95% で自動保存が走ります。」)

    • off — Disable auto-save for this session only:

      mkdir -p .claude/handoff/sessions && touch ".claude/handoff/sessions/${SID}.disabled" && echo "DISABLED"
      

      PowerShell:

      New-Item -ItemType Directory -Force -Path .claude/handoff/sessions | Out-Null
      New-Item -ItemType File -Force -Path ".claude/handoff/sessions/$sid.disabled" | Out-Null
      Write-Output "DISABLED"
      

      Confirm: "✓ Auto-save disabled for this session. Use /handoff-revive:save to save manually whenever you want. New Claude sessions reset to enabled."

    • status (or empty) — Report current state:

      if [ -f ".claude/handoff/sessions/${SID}.disabled" ]; then
        echo "DISABLED"
      else
        echo "ENABLED"
      fi
      

      PowerShell: if (Test-Path ".claude/handoff/sessions/$sid.disabled") { "DISABLED" } else { "ENABLED" } Then report to user:

      • State: ENABLED / DISABLED
      • Effective thresholds (read env vars HANDOFF_AUTO_SAVE_PERCENT, HANDOFF_URGENT_PERCENT; defaults 90 / 95)
      • Reminder: "New Claude sessions start ENABLED by default."
      • If both env vars are disabled, mention that auto-save is also globally disabled regardless of session toggle.
    • Anything else: tell the user usage is /handoff-revive:auto on | off | status.

  3. Always respond in the user's language (read .claude/handoff/lang if it exists, otherwise detect from the user's message). Confirmation patterns:

    • ja: 「✓ このセッションでの自動保存を{有効|無効}にしました。」
    • en: "✓ Auto-save {enabled|disabled} for this session."
    • zh: "✓ 已为本会话{启用|禁用}自动保存。"
    • zh-TW: 「✓ 已為本會話{啟用|停用}自動儲存。」
    • ko: "✓ 이 세션에서 자동 저장 {활성화|비활성화}."
    • es: "✓ Auto-guardado {activado|desactivado} para esta sesión."
    • pt: "✓ Auto-save {ativado|desativado} para esta sessão."
    • de: "✓ Auto-Save für diese Sitzung {aktiviert|deaktiviert}."
    • fr: "✓ Auto-sauvegarde {activée|désactivée} pour cette session."
    • tr: "✓ Bu oturum için otomatik kayıt {etkinleştirildi|devre dışı bırakıldı}."

Read the full file on GitHub · 101 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. 3d ago First seen · 101 lines · 24 tokens per session scan B 740f331ea7e4

Subscribe to this mod's changes

auto is a command published in the GitHub repository sofumel/claude-handoff-revive (6 stars, last pushed 2mo ago), licensed MIT. It adds 24 tokens to every session and 1,421 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.