agent-restore-context

Manage .agent-restore-context-<skill-name> files and verify SessionStart hooks in .claude/settings.json.

154|28|Updated Aug 31, 2018
One-click install
npx skills add https://github.com/commercetools/ui-kit --skill agent-restore-context
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: agent-restore-context
Source: https://github.com/commercetools/ui-kit/tree/main/.agents/skills/agent-restore-context
Command: npx skills add https://github.com/commercetools/ui-kit --skill agent-restore-context

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

When an AI session is cleared or compacted, important in-progress skill state and prompts are lost, interrupting long-running or multi-step agent workflows. This Skill provides a lightweight, file-based mechanism to persist a complete resume prompt so a skill can be reloaded and continue after a context reset.

Core Features & Use Cases

  • Write restore context: Create or overwrite .agent-restore-context-<skill-name> files containing a self-contained resume prompt that tells the agent how to restore state and reload the full skill.
  • Delete cleanup: Remove restore files when workflows are complete; operations are idempotent and safe to repeat.
  • Check & setup validation: Inspect .claude/settings.json and optional settings.local.json for the restore-context SessionStart hook and offer to run setup if missing.
  • Status & previews: List all active restore-context files and show filename-derived skill names with a short content preview to help manage active resumes.
  • Use case: Save progress for long-running tasks like issue implementation or test runs so the agent can resume after a manual /clear or automatic compaction.

Quick Start

Run /agent-restore-context write jira-implement-task -- === RESUMED AFTER CONTEXT RESET === followed by the resume prompt content to save the restore context for the jira-implement-task skill.

Frequently Asked Questions about agent-restore-context

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I restore agent context after a session reset clears my in-progress prompts?▼

Restoring agent context after a session reset requires persisting a resume prompt to a `.agent-restore-context-<skill-name>` file, which a SessionStart hook automatically injects after `/clear` or `/compact` to reload the skill state.

How do I persist AI agent state across session compaction without losing progress?▼

Persisting AI agent state across compaction involves writing a self-contained resume prompt to a restore context file in the project root, ensuring the agent can resume long-running workflows like issue implementation or test runs seamlessly.

Where do I configure the hook to automatically reload skill prompts after context loss?▼

Configuring the hook to automatically reload skill prompts is done in `.claude/settings.json` and optional `settings.local.json`, where you verify the SessionStart hook exists to inject saved restore context files after context loss.

Can I safely delete agent restore context files when a workflow is complete?▼

You can safely delete agent restore context files when a workflow finishes, as the delete operations are idempotent and can be repeated without errors to clean up `.agent-restore-context-<skill-name>` files in the project root.

What is the best way to check active restore context files and preview their saved skill states?▼

Checking active restore context files and previewing saved skill states is done by listing all `.agent-restore-context-<skill-name>` files in the project root, which displays filename-derived skill names alongside a short content preview for managing active resumes.

Why does my agent lose its skill prompt state after context compaction?▼

Agents lose skill prompt state after context compaction because session resets clear in-progress memory, requiring a file-based persistence mechanism to save and inject a self-contained resume prompt via a SessionStart hook.