Memory skill
Session Compact Skill
Turn a long or finished coding session into a structured handoff and resume prompt.
On this page
Install command
AI DevKit installs its built-in skills as one curated set. Run this once to install session-compact with the rest of the built-in workflow skills.
npx ai-devkit@latest skill add --built-inWhat it does
Use session-compact when a session's context is getting long, work is being handed to another agent, or a long implementation or debugging run is ending. It runs ai-devkit agent session compact to produce a continuation artifact with a resume prompt and memory candidates. It needs the TYPESAFE_API_KEY environment variable and stops with a clear message when it is missing.
When to use it
- Hand work off to another agent without losing decisions and open questions
- Resume stale work from a structured summary instead of a long transcript
- Pull durable memory candidates out of a long session for review
Supported agents
- Claude Code
- Codex
- opencode
The SKILL.md file
This is what your agent reads when the skill runs. View it on GitHub (opens in a new tab)
Use AI DevKit's Jev-backed CLI to create a structured continuation artifact from a historical session. Prefer this command over a hand-written compact when it is available.
When to Use#
- Context is getting long and useful state needs to survive compaction.
- Work is being handed to another agent or resumed after becoming stale.
- A complex implementation or debugging session is closing.
- Durable memory candidates or task-progress facts need to be identified after a long run.
Workflow#
- Find the session ID when it is not already known:
bash npx ai-devkit@latest agent sessions --all - Produce Markdown for a human handoff:
bash npx ai-devkit@latest agent session compact --id <session-id> - Use JSON for automation or structured inspection:
bash npx ai-devkit@latest agent session compact --id <session-id> --format json - Add
--type <provider>when the same session ID is ambiguous across providers. - Review the artifact before using its resume prompt, memory candidates, or validation claims. Compaction preserves selected transcript evidence; it does not independently verify that evidence.
Jev Availability#
The command requires TYPESAFE_API_KEY. If it reports:
Jev is unavailable because TYPESAFE_API_KEY is not set.
report that result clearly and stop the compaction attempt. Do not silently replace it with hand-written summarization or imply that Jev classified the session. A user may explicitly request a separate manual summary afterward.
Never print, log, store, or pass the API key as a command argument. The CLI reads it from the environment.
Boundaries#
- The command is read-only and does not write memories or mutate tasks.
- Treat memory candidates as proposals until they pass the memory skill's quality gate.
- Record task progress separately when the task workflow requires it.
- API, authentication, schema, or network failures with a configured key are errors, not Jev-unavailable results.