Skip to main content
skill CX Codex

graceful-degradation — Claude Code skill: fallback messages when

A skill that has the agent check optional services up front and explain what broke and how to fix it instead of returning nothing.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add parcadei/Continuous-Claude-v3 --skill graceful-degradation -a claude-code
Open on GitHub

What graceful-degradation does

Agents tend to fail quietly when a local server or an external API is down. This skill sets a different order: check availability before doing real work, cache the answer for the session, and keep going with reduced functionality when the service does not respond.

Inside is the pattern plus an LMStudio check against localhost:1234 with a 60-second cache. The result sits in a variable so the service is not pinged on every call. A message template covers what is missing, which features are degraded, and the steps that bring the service back.

The skill does not start anything for you. It reports what to do. If your project has no availability checks yet, you still write them — the skill gives the shape, not code for your stack.

What it helps with

  • tell a downed service apart from an empty result
  • explain to the user why part of the features is off
  • avoid burning compute on calls to a dead server
  • cut repeated health checks of the same service
  • point to the steps that start a local model

Example prompts for the agent

  • check whether LMStudio is up before generating tactics
  • add a fallback with a clear message when the local server is down
  • cache the health check result for the session

How to install graceful-degradation

1Skills CLI (Vercel)

npx skills add parcadei/Continuous-Claude-v3 --skill graceful-degradation -a claude-code

2Manually: put the files in place

~/.claude/skills/graceful-degradation/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/graceful-degradation/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about graceful-degradation

How do I install graceful-degradation in Claude?

Run npx skills add parcadei/Continuous-Claude-v3 --skill graceful-degradation -a claude-code. The skill lands in ~/.claude/skills/graceful-degradation/SKILL.md.

What does graceful-degradation do?

It describes a graceful degradation pattern: an early availability check, a cached result, and a message that says what is missing and how to enable it.

Does the skill start services on its own?

No. It checks availability and prints instructions; starting the service is on you.

Source text

SKILL.md · MIT
---
name: graceful-degradation
description: Graceful Degradation with Helpful Messages
user-invocable: false
---

# Graceful Degradation with Helpful Messages

When optional services are unavailable, degrade gracefully with actionable fallback messages.

## Pattern

Check availability at the start, cache the result, and provide helpful messages that explain what's missing and how to fix it.

## DO

- Check service availability early (before wasting compute)
- Cache health check results for the session (e.g., 60s TTL)
- Provide actionable fallback messages:
  - What service is missing
  - What features are degraded
  - How to enable the service
- Continue with reduced functionality when possible

## DON'T

- Silently fail or return empty results
- Check availability on every call (cache it)
- Assume the user knows how to start missing services

## Example: LMStudio Check Pattern

```typescript
let lmstudioAvailable: boolean | null = null;
let lastCheck = 0;
const CACHE_TTL = 60000; // 60 seconds

async function checkLMStudio(): Promise<boolean> {
  const now = Date.now();
  if (lmstudioAvailable !== null && now - lastCheck < CACHE_TTL) {
    return lmstudioAvailable;
  }

  try {
    const response = await fetch('http://localhost:1234/v1/models', {
      signal: AbortSignal.timeout(2000)
    });
    lmstudioAvailable = response.ok;
  } catch {
    lmstudioAvailable = false;
  }
  lastCheck = now;
  return lmstudioAvailable;
}

// Usage
if (!await checkLMStudio()) {
  return {
    result: 'continue',
    message: `LMStudio not available at localhost:1234.

To enable Godel-Prover tactic suggestions:
1. Install LMStudio from https://lmstudio.ai/
2. Load "Goedel-Prover-V2-8B" model
3. Start the local server on port 1234

Continuing without AI-assisted tactics...`
  };
}
```

## Fallback Message Template

```
[Service] not available at [endpoint].

To enable [feature]:
1. [Step to install/start]
2. [Configuration step if needed]
3. [Verification step]

Continuing without [degraded feature]...
```

## Source Sessions

- This session: LMStudio availability check with 60s caching and helpful fallback
- 174e0ff3: Environment variable debugging - print computed paths for troubleshooting

© parcadei · MIT · parcadei/Continuous-Claude-v3

Similar skills

All skills for Agent setup: memory, context, orchestration →

From the same set69

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor