fusebase-flow: Skill for Claude Code

.agents/skills/handling-authentication-errors/SKILL.md

handling-authentication-errors is a skill for Claude Code from fusebase-dev/fusebase-flow. It costs 68 tokens per session (3,093 once invoked), scanned A, original, MIT.

A set of rules for handling two kinds of login and session failures in an app: platform access tokens and the app's own browser session cookie.

In plain words
What is it for?
Use it when building login checks, expired-login dialogs, session startup requests, and global handling for authentication-related API errors.
Why use it?
It prevents every failed network request from being mistaken for a logout. Temporary server failures, cold starts, and network problems should usually trigger retries or an error message instead of clearing the user's session.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: installed under .agents/ (shared by several agents); mentions AGENTS.md.

This is fusebase-dev/fusebase-flow's own configuration. It tells Claude Code how to work on fusebase-flow itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything fusebase-flow configures →

Part of the fusebase-flow plugin — 56 skills, 8 commands, 4 agents shipped together

Reuse

Borrowing it

Nothing to install: this file belongs to fusebase-dev/fusebase-flow. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/fusebase-dev/fusebase-flow/main/.agents/skills/handling-authentication-errors/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/fusebase-dev/fusebase-flow

Made for: Claude Code.

Or install fusebase-flow, the plugin that ships this one along with the rest of its 56 skills, 8 commands, 4 agents.

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 handling-authentication-errors

README.md
[![agentmods](https://agentmods.dev/badge/skills/fusebase-dev/fusebase-flow/handling-authentication-errors/github.svg)](https://agentmods.dev/skills/fusebase-dev/fusebase-flow/handling-authentication-errors)
Your own site
<a href="https://agentmods.dev/skills/fusebase-dev/fusebase-flow/handling-authentication-errors"><img src="https://agentmods.dev/badge/skills/fusebase-dev/fusebase-flow/handling-authentication-errors/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for handling-authentication-errors

Your own site · 80×15
<a href="https://agentmods.dev/skills/fusebase-dev/fusebase-flow/handling-authentication-errors"><img src="https://agentmods.dev/badge/skills/fusebase-dev/fusebase-flow/handling-authentication-errors.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 68 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,093 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.00068 $0.03093
Opus 5.5 $0.00027 $0.01237
Sonnet 5.5 $0.00014 $0.00619
Haiku 4.5 $0.00007 $0.00309

Measured 2mo ago against content hash e0c3e8cb3c80, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

handling-authentication-errors 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 2mo 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.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

.agents/skills/handling-authentication-errors/SKILL.md · 294 lines

How it starts

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

Handling Authentication Errors

Apps need two related but distinct patterns:

  1. Platform app token (fbsfeaturetoken / x-app-feature-token) — AppTokenValidationError on Gate/Dashboard proxy calls.
  2. App-owned session (httpOnly cookie, e.g. app_session) — backend /api/account/me (or equivalent) on load.

Do not treat every failed fetch as “logged out”. That lies to the user when the backend is restarting (deploy), the proxy returns 502, or the network blips.


Session probe invariant (backend SaaS apps)

Any SPA that boots auth from GET /api/account/me (or similar) MUST follow this table:

Response on session check Meaning UI action
401 Session rejected by backend Show login / anon state
403 with known business code (membership_revoked, tenant_suspended, …) Authenticated but blocked Dedicated blocked screen
Everything else (502/503/504, 5xx, network error, timeout, aborted) No verdict — server may be down Retry (see below), then “Can't reach server” + Try again. Do not clear session cookie or force login

A timeout on the first call after idle or deploy is a cold start, not a logout. Retry once with the full deadline, then report "Can't reach server" — never clear the session. Timeout sizing: skill app-backend § Cold Starts (Scale-to-Zero).

Anti-pattern (never ship)

// BAD — treats deploy blip as logout
catch (e) {
  if (e.code !== 'tenant_suspended' && e.code !== 'membership_revoked') {
    setAuth({ status: 'anon' }) // ← 502 during fusebase deploy looks like logout
  }
}

Required pattern

type SessionVerdict = 'authenticated' | 'anon' | 'blocked' | 'unknown'

async function probeSession(): Promise<SessionVerdict> {
  const res = await fetch('/api/account/me', { credentials: 'include' })
  if (res.status === 401) return 'anon'
  if (res.status === 403) {
    const body = await res.json().catch(() => ({}))
    if (body.code === 'membership_revoked' || body.code === 'tenant_suspended') return 'blocked'
    return 'unknown' // do not assume logout
  }
  if (!res.ok) return 'unknown'
  return 'authenticated'
}

async function probeSessionWithDeployTolerance(): Promise<SessionVerdict> {
  const delays = [0, 400, 1200] // ms — survives fusebase deploy pod restart window
  let last: SessionVerdict = 'unknown'
  for (const ms of delays) {
    if (ms) await new Promise((r) => setTimeout(r, ms))
    try {
      const v = await probeSession()
      if (v !== 'unknown') return v
      last = v
    } catch {
      last = 'unknown'
    }
  }
  return last
}

Read the full file on GitHub · 294 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. 2mo ago First seen · 294 lines · 68 tokens per session scan A e0c3e8cb3c80

Subscribe to this mod's changes

handling-authentication-errors is a skill published in the GitHub repository fusebase-dev/fusebase-flow (9 stars, last pushed 13d ago), licensed MIT. It adds 68 tokens to every session and 3,093 once invoked, about $0.0003 per session on Opus 5.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-31.

Related

handling-authentication-errors compared with skills from other repositories

handling-authentication-errors next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
handling-authentication-errorsfusebase-dev/fusebase-flowSkill913d agoMITA68Claude Code
adobe-express-cors-and-backendSandgrouse/adobe-express-dev-skillSkill92mo agononeA92Claude Code, Codex
adobe-express-oauth-authenticationSandgrouse/adobe-express-dev-skillSkill92mo agononeA50Claude Code, Codex
error-handling-patternswshobson/agentsSkill42k2d agoMITA43Claude Code
diagnose-backend-bugQoderAI/better-harnessSkill2.4ktodayMITA87Claude Code, Codex
config-secrets-environmentsmajiayu000/spellbookSkill2903d agoMITA73Codex
lov-clash-tun-doctorlovstudio/skillsSkill72yesterdayMITA93Claude Code