graceful-tool-failure

graceful-tool-failure is a skill for Claude Code, Codex from HKUDS/OpenSpace. It costs 20 tokens per session (1,042 once invoked), scanned B, original, MIT.

A response procedure for cases where an essential tool, such as PDF extraction or web search, repeatedly fails. It requires explaining the failure and providing the most useful limited result possible.

In plain words
What is it for?
Use it when required tools fail several times and the task cannot be fully completed, so the agent can document the limitation and produce a clearly marked partial answer.
Why use it?
It prevents an agent from hiding blocked work or presenting guesses as a completed result.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

About the project

OpenSpace is a skill-management layer for AI agents that stores, retrieves, evaluates, shares, and improves reusable workflows. It is intended for people using multiple coding agents who want skills to be reused and refined based on task outcomes. The catalogue provides 200 skills for use with OpenSpace and the agents it supports.

HKUDS/OpenSpace · 7,510 stars · on GitHub

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 skills/hkuds/openspace/graceful-tool-failure
Any agent
npx skills add HKUDS/OpenSpace --skill graceful-tool-failure
Clone the repo
git clone --depth 1 https://github.com/HKUDS/OpenSpace

Made for: Claude Code, Codex.

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 graceful-tool-failure

README.md
[![agentmods](https://agentmods.dev/badge/skills/hkuds/openspace/graceful-tool-failure.svg)](https://agentmods.dev/skills/hkuds/openspace/graceful-tool-failure)
Your own site
<a href="https://agentmods.dev/skills/hkuds/openspace/graceful-tool-failure"><img src="https://agentmods.dev/badge/skills/hkuds/openspace/graceful-tool-failure.svg" alt="Measured on agentmods" height="20"></a>
Per session 20 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,042 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.1 $0.00020 $0.01042
Opus 5 $0.00010 $0.00521
Sonnet 5 $0.00004 $0.00208
Haiku 4.5 $0.00002 $0.00104

Measured 6d ago against content hash 4ed370ecac47, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade B, and why

graceful-tool-failure 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 6d 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.

Strips warnings and disclaimersmediumAnti-refusal

Omitting safety caveats hides risk from the user and is a common jailbreak preamble.

- ❌ Providing output without disclaimers about its reliability
benchmarks/gdpval/skills/graceful-tool-failure/SKILL.md · 144 lines

How it starts

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

Graceful Tool Failure Workflow

This skill guides agents on how to respond when critical tools (like PDF extraction, web search, data APIs) fail repeatedly and block task completion.

When to Apply This Skill

Use this pattern when:

  • A core tool required for task completion has failed multiple times (3+ attempts with different approaches)
  • Alternative approaches to achieve the same goal have also failed
  • The task cannot be fully completed without the blocked capability

Step-by-Step Instructions

1. Explicitly Report Blocking Issues

Clearly document what failed and why:

## Blocking Issues

The following tools/approaches were attempted but failed:

1. **PDF Extraction (pdftotext)**: Command returned error - file appears corrupted or uses non-standard encoding
2. **PDF Extraction (PyMuPDF)**: Library could not parse document structure
3. **Web Search**: Search queries returned no relevant results for [specific topic]

These failures prevent completion of [specific deliverable].

2. Attempt Minimal Viable Output

Using available domain knowledge, create the best possible output with clear limitations:

## Partial Output (Based on Domain Knowledge)

*Note: The following content is derived from general domain knowledge rather than the requested source materials.*

[Insert best-effort content here]

**Confidence Level**: Low - content has not been verified against source documents
**Recommendation**: Verify all claims against original source materials when available

3. Avoid Claiming Success

Never state the task is complete when core deliverables are missing or unverified:

Incorrect:

"Task completed successfully."

Correct:

"Task partially completed. Core deliverable [X] could not be produced due to tool failures. Minimal viable output provided with disclaimers. Manual review or alternative data sources recommended."

4. Provide Actionable Next Steps

Suggest concrete actions for human operators or alternative approaches:

Read the full file on GitHub · 144 lines

Files

What ships with it

1 file 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. 6d ago First seen · 144 lines · 20 tokens per session scan B 4ed370ecac47

Subscribe to this mod's changes

graceful-tool-failure is a skill published in the GitHub repository HKUDS/OpenSpace (7,510 stars, last pushed 24d ago), licensed MIT. It adds 20 tokens to every session and 1,042 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it B with 1 finding (strips warnings and disclaimers). 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

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

local-ai-agents

Build local-first AI agents that run entirely on a developer workstation with Microsoft Foundry Local and Qwen function-calling models. Covers Small Language Models (SLMs), the OpenAI-compatible local endpoint, sandboxed local tools, local RAG with Chroma, local MCP servers, hybrid cloud/local routing, and the…

microsoft/ai-agents-for-beginners · 200 tokens

next-cache-components-adoption

Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components, flip the cacheComponents flag, work through a flood of blocking-prerender / instant validation errors, run the cache-components-instant-false codemod, or…

vercel/next.js · 95 tokens

chat-pet-sprite-creation

Use when creating or changing VS Code chat pet sprite art, sprite sheets, state animations, eye treatments, Stable/Insiders variants, or pet transitions under src/vs/workbench/contrib/chat/browser/widget/media/chatPet.

microsoft/vscode · 53 tokens

cpu-profile-analysis

Analyze V8/Chrome CPU profiles (.cpuprofile) and DevTools trace files (Trace-.json). Use when: profiling performance, investigating slow functions, comparing code paths, finding bottlenecks, analyzing timeToRequest, understanding call trees from sampling profiler data, analyzing layout/paint/rendering, investigating…

microsoft/vscode · 71 tokens

insight-error-page

Write or audit an insight-kind error page for the Next.js dev overlay. Use when creating a new errors/ .mdx page, auditing an existing one, or checking that a page matches the framework fix cards. Covers page structure, title alignment, FixCard cards with Copy prompt button, code snippets, terminology verification…

vercel/next.js · 83 tokens