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.
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.
npx skills add TanStack/ai --skill client-persistencegit clone --depth 1 https://github.com/TanStack/aiWrote 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.
[](https://agentmods.dev/skills/tanstack/ai/client-persistence)<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.
<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>- NVIDIA SkillSpector pass
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.
| Model | Per session | Once 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 |
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.
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-experienceforuseChatitself.No extra package. The adapters below ship in the framework packages (
@tanstack/ai-reactand 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-persistenceand itsai-persistence/serverskill.
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(),
})
// ...
}
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.
- 2mo ago Changed · +12 lines d815f1374824
- 2mo ago First seen · 278 lines · 141 tokens per session scan A 7c2875bca921
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.
ai-core/client-persistence compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| ai-core/client-persistenceTanStack/ai | Skill | 3.3k | today | MIT | A | 141 | Claude Code |
| create-data-contextasgeirtj/system_prompts_leaks | Skill | 71k | today | CC0-1.0 | A | 55 | Claude Code, Codex |
| self-awarenessasgeirtj/system_prompts_leaks | Skill | 71k | today | CC0-1.0 | A | 0 | Claude Code, Codex |
| forgetasgeirtj/system_prompts_leaks | Skill | 71k | today | CC0-1.0 | A | 0 | Claude Code, Codex |
| context-{team-slug}-{topic-slug}asgeirtj/system_prompts_leaks | Skill | 71k | today | CC0-1.0 | A | 28 | Claude Code, Codex |
| consolidate-memoryasgeirtj/system_prompts_leaks | Skill | 71k | today | CC0-1.0 | A | 24 | Claude Code, Codex |
| ha-data-storesshiwenwen/hope-agent | Skill | 1.9k | today | MIT | A | 115 | Claude Code, Codex |