ai-core/client-persistence

ai-core/client-persistence is a skill for Claude Code from TanStack/ai. It costs 141 tokens per session (2,630 once invoked), scanned A, original, MIT.

Browser chat persistence that saves conversation data for a chat thread in browser storage. It can restore the transcript after a reload and, in supported cases, reconnect to an unfinished response.

In plain words
What is it for?
Saving and restoring chat threads with local storage, session storage, or IndexedDB, including pending interruptions and in-progress responses.
Why use it?
It prevents users from losing chat history or pending work when a page reloads. Different storage choices control whether data lasts for a tab, browser restart, or longer.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the tanstack-ai plugin — 47 skills shipped together

Good fit Saving and restoring chat threads with local storage, session storage, or IndexedDB, including pending interruptions and in-progress responses.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/tanstack/ai/client-persistence
About the project

TanStack AI is a TypeScript SDK for building applications that stream AI responses, call tools, run agents, produce structured output, and handle multimodal or realtime interactions. Developers use it across frameworks and AI providers through shared typed interfaces and provider adapters. The catalogue entries are add-ons for working with this SDK.

TanStack/ai · 3,340 stars · on GitHub · tanstack.com

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 TanStack/ai --skill client-persistence
Clone the repo
git clone --depth 1 https://github.com/TanStack/ai

Made for: Claude Code.

Or install tanstack-ai, the plugin that ships this one along with the rest of its 47 skills.

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 ai-core/client-persistence

README.md
[![agentmods](https://agentmods.dev/badge/skills/tanstack/ai/client-persistence/github.svg)](https://agentmods.dev/skills/tanstack/ai/client-persistence)
Your own site
<a href="https://agentmods.dev/skills/tanstack/ai/client-persistence"><img src="https://agentmods.dev/badge/skills/tanstack/ai/client-persistence/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 ai-core/client-persistence

Your own site · 80×15
<a href="https://agentmods.dev/skills/tanstack/ai/client-persistence"><img src="https://agentmods.dev/badge/skills/tanstack/ai/client-persistence.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 141 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,630 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.00141 $0.02630
Opus 5.5 $0.00056 $0.01052
Sonnet 5.5 $0.00028 $0.00526
Haiku 4.5 $0.00014 $0.00263

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

Security

Grade A, and why

ai-core/client-persistence 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.

packages/ai/skills/ai-core/client-persistence/SKILL.md · 290 lines

How it starts

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

Client Persistence

Builds on ai-core, and on ai-core/chat-experience for useChat itself.

No extra package. The adapters below ship in the framework packages (@tanstack/ai-react and friends, re-exported from @tanstack/ai-client), so browser persistence needs nothing installed beyond what a chat UI already has. The server half is a separate package — see @tanstack/ai-persistence and its ai-persistence/server skill.

A ChatClient / useChat keeps messages in memory. The persistence option stores one record per threadId so a reload can repaint the transcript, restore a pending interrupt, and rejoin an in-flight run.

Import adapters from the framework package (not @tanstack/ai-client unless vanilla JS):

import {
  useChat,
  fetchServerSentEvents,
  localStoragePersistence,
  sessionStoragePersistence,
  indexedDBPersistence,
} from '@tanstack/ai-react'

Adapters

Adapter Survives Notes
localStoragePersistence() Reloads + browser restarts Sync hydrate; quota-bound; JSON codec default
sessionStoragePersistence() Reloads in the same tab Cleared when tab/session ends
indexedDBPersistence() Reloads + restarts Async open (first paint may be empty briefly); structured clone

All default to the chat persisted-state shape — no type argument or codec required for normal use.

Mode A — cache everything (client-authoritative)

import {
  useChat,
  fetchServerSentEvents,
  localStoragePersistence,
} from '@tanstack/ai-react'

function Chat() {
  const { messages, sendMessage } = useChat({
    threadId: 'support-chat', // stable — required
    connection: fetchServerSentEvents('/api/chat'),
    persistence: localStoragePersistence(),
  })
  // ...
}

Read the full file on GitHub · 290 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 Changed · +12 lines d815f1374824
  2. 2mo ago First seen · 278 lines · 141 tokens per session scan A 7c2875bca921

Subscribe to this mod's changes

ai-core/client-persistence is a skill published in the GitHub repository TanStack/ai (3,340 stars, last pushed today), licensed MIT. It adds 141 tokens to every session and 2,630 once invoked, about $0.0006 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-30.

Related

ai-core/client-persistence compared with skills from other repositories

ai-core/client-persistence next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
ai-core/client-persistenceTanStack/aiSkill3.3ktodayMITA141Claude Code
create-data-contextasgeirtj/system_prompts_leaksSkill71ktodayCC0-1.0A55Claude Code, Codex
self-awarenessasgeirtj/system_prompts_leaksSkill71ktodayCC0-1.0A0Claude Code, Codex
forgetasgeirtj/system_prompts_leaksSkill71ktodayCC0-1.0A0Claude Code, Codex
context-{team-slug}-{topic-slug}asgeirtj/system_prompts_leaksSkill71ktodayCC0-1.0A28Claude Code, Codex
consolidate-memoryasgeirtj/system_prompts_leaksSkill71ktodayCC0-1.0A24Claude Code, Codex
ha-data-storesshiwenwen/hope-agentSkill1.9ktodayMITA115Claude Code, Codex