agentsop-llm-tool-idempotency

agentsop-llm-tool-idempotency is a skill for Claude Code from agentsope/SkillAlchemy. It costs 160 tokens per session (8,678 once invoked), scanned A, original, MIT.

A decision guide for making agent tools safe when the same request may be run more than once.

In plain words
What is it for?
Use it when designing tools that write data, send notifications, charge money, or call external services through agent and MCP systems.
Why use it?
Agent calls can be retried after timeouts or interruptions, which may otherwise send messages, create records, charge accounts, or perform another action twice.

Skill for Claude Code

Written for Claude Code: when-to-use in frontmatter. Also seen: positional $N argument.

Good fit Use it when designing tools that write data, send notifications, charge money, or call external services through agent and MCP systems.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/agentsope/skillalchemy/agentsop-llm-tool-idempotency
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.

Any agent
npx skills add agentsope/SkillAlchemy --skill agentsop-llm-tool-idempotency
Clone the repo
git clone --depth 1 https://github.com/agentsope/SkillAlchemy

Made for: Claude Code.

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 agentsop-llm-tool-idempotency

README.md
[![agentmods](https://agentmods.dev/badge/skills/agentsope/skillalchemy/agentsop-llm-tool-idempotency.svg)](https://agentmods.dev/skills/agentsope/skillalchemy/agentsop-llm-tool-idempotency)
Your own site
<a href="https://agentmods.dev/skills/agentsope/skillalchemy/agentsop-llm-tool-idempotency"><img src="https://agentmods.dev/badge/skills/agentsope/skillalchemy/agentsop-llm-tool-idempotency.svg" alt="Measured on agentmods" height="20"></a>
Per session 160 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 8,678 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.1 $0.00160 $0.08678
Opus 5 $0.00080 $0.04339
Sonnet 5 $0.00032 $0.01736
Haiku 4.5 $0.00016 $0.00868

Measured 8d ago against content hash f5de047ac2f2, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

agentsop-llm-tool-idempotency scanned grade A with 0 findings 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 8d 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/agentsop-llm-tool-idempotency/SKILL.md · 667 lines

How it starts

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

LLM Tool Idempotency · SOP

One-liner: The LM is at-least-once; the tool must be at-most-once. Every framework that promises "durable execution" still re-runs node bodies on resume. Every HTTP client retries on timeout. Every model occasionally emits the same tool_call twice. Idempotency belongs in the tool, not in a wish.


1. 何时激活 (Activation Rules)

Activate this skill when any of the following triggers fire:

  • You're defining a tool whose name contains send_, create_, charge_, post_, write_, publish_, transfer_, delete_, update_, or notify_.
  • The tool wraps a third-party API call (Stripe, SendGrid, Twilio, Slack, Discord webhook, S3 PUT, payment gateway, internal write API).
  • You're inside a LangGraph node that contains an interrupt(...) call AND a side effect in the same function body — the resume re-runs the body from the top [langgraph/gotchas].
  • The tool is invoked through MCP, OpenAI tool-calling, Anthropic tool use, CrewAI delegation, or any layer where a transport timeout could be interpreted as "retry" even though the operation succeeded server-side.
  • The user reports "the agent sent it twice" / "charge appeared twice" / "duplicate row" / "got two emails".
  • Your test harness records the same (tool_name, args_hash) invoked more than once within a single user turn.

Do not activate when the tool is read-only (GET-equivalent), or when the side effect is genuinely commutative AND verified safe under duplication.


2. 核心心智模型 (Core Mental Model)

2.1 The fundamental asymmetry

   LM tool-call semantics       Tool side-effect semantics
   ─────────────────────        ─────────────────────────
   At-least-once delivery       Must be at-most-once
   (network retry, framework    (one charge, one email,
    resume, model dup-emit,      one record)
    user re-prompt)
        │                                │
        └────── gap to bridge ───────────┘
                       ↓
              IDEMPOTENCY KEY
       (a stable identifier the LM
        commits to BEFORE the call,
        which the tool dedupes on)

Read the full file on GitHub · 667 lines

Files

What ships with it

4 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 8d ago First seen · 667 lines · 160 tokens per session scan A f5de047ac2f2

Subscribe to this mod's changes

agentsop-llm-tool-idempotency is a skill published in the GitHub repository agentsope/SkillAlchemy (370 stars, last pushed 5d ago), licensed MIT. It adds 160 tokens to every session and 8,678 once invoked, about $0.0008 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

shellgames

Play board games on ShellGames.ai — Chess, Poker, Ludo, Tycoon, Memory, and Spymaster. Use when the agent wants to play games against humans or other AI agents, join tournaments, chat with players, check leaderboards, or manage a ShellGames account. Triggers on "play chess/poker/ludo/memory", "shellgames", "join…

MemTensor/skills-vote · 103 tokens

curl-search

Web search using curl + multiple search engines (Baidu, Google, Bing, DuckDuckGo). Activates when user asks to search, look up, or query something online. Includes security enhancements: input sanitization, command injection protection, and URL encoding.

MemTensor/skills-vote · 55 tokens

skills-vote-local

Use when retrieving the most relevant skills from a local or private skill library instead of relying on network-based skill discovery.

MemTensor/skills-vote · 28 tokens

skills-vote

Find the most relevant external agent skills for the current task, then submit grounded feedback about which skills were actually used and useful in the same session. Whenever you start a task, use this skill first.

MemTensor/skills-vote · 44 tokens

xlsx

Use this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or…

MemTensor/skills-vote · 201 tokens

pdf

Use this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple PDFs into one, splitting PDFs apart, rotating pages, adding watermarks, creating new PDFs, filling PDF forms, encrypting/decrypting PDFs, extracting images, and…

MemTensor/skills-vote · 92 tokens