conversation-engine-persistent-session-state

conversation-engine-persistent-session-state is a skill for Claude Code, Codex from ychampion/cskill-agents. It costs 32 tokens per session (404 once invoked), scanned A, original, MIT.

A conversation-engine design for keeping long-lived session information separate from temporary per-turn data. A session can retain messages, permissions, usage, and read caches while each new turn rebuilds its short-lived working state.

In plain words
What is it for?
Use it when implementing retries, abort handling, conversation history, reusable read caches, and other state that must survive across user messages.
Why use it?
It prevents stale request data from leaking into later turns while preserving the context needed for an ongoing conversation.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when implementing retries, abort handling, conversation history, reusable read caches, and other state that must survive across user messages.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/ychampion/cskill-agents/conversation-engine-persistent-session-state
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 ychampion/cskill-agents --skill conversation-engine-persistent-session-state
Clone the repo
git clone --depth 1 https://github.com/ychampion/cskill-agents

Made for: Claude Code, Codex.

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 conversation-engine-persistent-session-state

README.md
[![agentmods](https://agentmods.dev/badge/skills/ychampion/cskill-agents/conversation-engine-persistent-session-state/github.svg)](https://agentmods.dev/skills/ychampion/cskill-agents/conversation-engine-persistent-session-state)
Your own site
<a href="https://agentmods.dev/skills/ychampion/cskill-agents/conversation-engine-persistent-session-state"><img src="https://agentmods.dev/badge/skills/ychampion/cskill-agents/conversation-engine-persistent-session-state/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 conversation-engine-persistent-session-state

Your own site · 80×15
<a href="https://agentmods.dev/skills/ychampion/cskill-agents/conversation-engine-persistent-session-state"><img src="https://agentmods.dev/badge/skills/ychampion/cskill-agents/conversation-engine-persistent-session-state.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 32 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 404 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.
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.00032 $0.00404
Opus 5.5 $0.00013 $0.00162
Sonnet 5.5 $0.00006 $0.00081
Haiku 4.5 $0.00003 $0.00040

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

Security

Grade A, and why

conversation-engine-persistent-session-state 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 1mo 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.

agents/claude-code/skills/conversation-engine-persistent-session-state/SKILL.md · 28 lines

What it actually says

SKILL: Conversation Engine Persistent Session State

Domain: session-state Trigger: Apply when architecting a conversation engine that must persist session context while allowing per-turn caches and abort controllers to restart cleanly. Source Pattern: Distilled from reviewed session memory, compaction, and context-budgeting implementations.

Core Method

Divide engine state into session scope and turn scope. Session scope keeps long-lived data such as conversation history, cumulative usage, permissions, and reusable read caches for the life of the engine. Turn scope recreates abort handles, transient discovery sets, scratch buffers, and other request-local intermediates every time a new submission starts. On retries, preserve the session data but rebuild the turn-local state from scratch so the engine stays consistent without leaking stale flags between turns.

Key Rules

  • Keep session-wide structures alive for the lifetime of the engine and mutate them in place as new data arrives.
  • Recreate and dispose of turn-local abort handles, discovery sets, and scratch buffers on every submission.
  • Clear any turn-specific derived context before the next turn begins, but do not reset the retained session history.
  • On soft retries, reuse the session state and throw away only the transient work for the failed attempt.

Example Application

When building a coding-cli-style engine, use this method to keep the conversation history, file caches, and usage counters across hundreds of turns while the abort controller, skill discovery set, and other per-turn caches are reinitialized each time.

Anti-Patterns (What NOT to do)

  • Don’t reconstruct the entire session state every turn; that drops history and resets usage tracking.
  • Don’t keep per-turn abort controllers or discovery sets alive past the turn—they can leak cancellations or stale skill data into future turns.
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. 1mo ago First seen · 28 lines · 32 tokens per session scan A 005db300bbba

Subscribe to this mod's changes

conversation-engine-persistent-session-state is a skill published in the GitHub repository ychampion/cskill-agents (36 stars, last pushed 6mo ago), licensed MIT. It adds 32 tokens to every session and 404 once invoked, about $0.0001 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

Other skills, from other repositories

grape

Use Grape MCP for Codex context continuity in coding repositories. Use when a task needs repeated-turn context, omitted context restore, stale-context checks, invalidation checks, or safe continuity across branch and dirty-worktree changes.

gael55x/Grape · 48 tokens

brain-page

Operating manual for reading and writing a project's brain — every read and write goes through the bundled zero-dependency brain CLI; never hand-edit brain files. Read it before creating or modifying any page or root page.

mindmuxai/brain.md · 47 tokens

brain-setup

Bootstrap the Open Project Brain Standard into the current project — prefer brain init (ensure BRAIN.md, scaffold empty brain brainRoot-aware, default-wire CLAUDE.md + AGENTS.md). Optionally install a pre-commit hook and a Claude Code or Codex SessionStart hook.

mindmuxai/brain.md · 63 tokens

brain-bootstrap

Seed a freshly-scaffolded brain with real project knowledge — on an existing (brownfield) project read the code, docs, and git log, then draft only the root pages that have meaningful content and capture key historical decisions; on a near-empty (greenfield) project interview the user. Every write goes through the…

mindmuxai/brain.md · 79 tokens

brain-ingest

The process for digesting a conversation, document, or research result, classifying it, and writing it down as brain content (a root-page update or a new/updated page) through the brain CLI.

mindmuxai/brain.md · 48 tokens

learn

Diagnose and fix agent behavioral surfaces when the user corrects a mistake — connects to Claude native memory.

automagik-dev/genie · 23 tokens