Who it is forA developer building an agent that must recover its conversation state after a restart or on a new host.
The problemAgent state kept only in memory or in ad hoc fields is hard to inspect, replay or recover.
The outcomeA durable atom that reduces an event log into trajectory state, with messages derived from it.
What you need first
- Bun installed, since the README uses bunx and bun add
- Working knowledge of TypeScript
- A model and credentials configured for the generated project
- A Cloudflare account for Cloudflare hosting, or a Celld fleet with a storage bucket for self-hosting
Steps
- Run
bun add tardiein your project to add the package. - Define a durableAtom with a name, the Event input, the TrajectoryState schema, an initial value and the reduceTrajectory reducer.
- Derive a messages atom from the durable history with get, as in the README example.
- Use an effectAtom, such as the compact example, to read messages and propose summarize actions.
Prompt for your agent
In the repo clavia-labs/tardigrade, add a durableAtom named <atom-name> that uses reduceTrajectory and the Event input, then derive a messages atom from it. Expected output: a TypeScript module that exports the durable history and messages atoms. Verify that the initial value matches the TrajectoryState schema.
Caveat. The README shows the durable atom pattern but does not document how events are persisted beyond the thread database, so check the docs before relying on a specific storage behavior.
Use this in your AI agent
Ask your agent
Using the Deduped MCP, get the setup steps for clavia-labs/tardigrade and "Rebuild agent state by replaying an event log"
Add Deduped to Claude Code once
claude mcp add --transport http deduped https://dedupedai.com/mcp
Every Monday: the 5 hottest repos and exactly how to use them. Free, one email a week, unsubscribe anytime.
Get them freeShare: X LinkedIn Hacker News Email Copy link
Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer