AG

agent-restore-context

Persists session state and skill context so work can resume after system resets.

Install

mkdir -p .claude/skills/agent-restore-context && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/12030" && unzip -o skill.zip -d .claude/skills/agent-restore-context && rm skill.zip

Installs to .claude/skills/agent-restore-context

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Manage restore context files so skills can survive /clear and /compact. Use to write, delete, check, or list .agent-restore-context-* files.
140 charsno explicit “when” trigger
Intermediate

Key capabilities

  • Write .agent-restore-context files
  • Delete .agent-restore-context files
  • Check if the restore context hook is set up
  • List all active restore context files
  • Verify hook setup in .claude/settings.json

How it works

This skill manages .agent-restore-context files in the project root, which are injected into context after session resets to allow skills to resume. It supports writing, deleting, checking, and listing these files.

Inputs & outputs

You give it
Action (write, delete, check, status) and skill-name
You get back
Managed .agent-restore-context-* files or status report

When to use agent-restore-context

  • Restore context after clear
  • Persist state across sessions
  • Manage session restoration files

About this skill

Agent Restore Context

Manage .agent-restore-context-<skill-name> files in the project root. These files are automatically injected into context after /clear or /compact by a SessionStart hook, allowing skills to resume where they left off.

Arguments

  • action (required): One of write, delete, check, or status
  • skill-name (required for write/delete): The skill name used as the file suffix
  • content (required for write): The full prompt content to inject after a context reset

Usage Examples

  • /agent-restore-context write jira-implement-task — create or overwrite a restore context file with the provided content
  • /agent-restore-context delete jira-implement-task — remove the file when the workflow is complete
  • /agent-restore-context check — verify the hook is set up, offer to install if not
  • /agent-restore-context status — list all active restore context files

Process

1. Verify Hook Setup

Read .claude/settings.json and .claude/settings.local.json (if it exists). Search both for restore-context. If not found:

  • If the action is check, invoke /agent-restore-context-setup and stop.
  • For any other action, warn the user that the hook is not configured and ask if they want to run /agent-restore-context-setup first. Do not proceed with write until the hook is confirmed.

2. Execute Action

write <skill-name>

  1. Write .agent-restore-context-<skill-name> to the project root with the provided content (creates or overwrites). The content should be a complete, self-contained prompt that tells the model how to resume. Recommended structure (callers may use any format):

    === <SKILL-NAME> — RESUMED AFTER CONTEXT RESET ===
    
    <Key state: ticket, branch, current task, etc.>
    
    You MUST do the following before any other work:
    1. Invoke /<skill-name> <arguments> to reload the full skill instructions.
    2. <Read relevant plan/state files>
    3. <Read relevant source/test files>
    4. Continue from where you left off.
    
    Do NOT start any work until you have completed the above steps.
    === END RESUMED CONTEXT ===
    
  2. Confirm the file was written and its path.

delete <skill-name>

  1. Delete .agent-restore-context-<skill-name> from the project root.
  2. If the file does not exist, report that it was already removed (not an error).
  3. Confirm the deletion.

check

  1. Report whether the hook is configured (found in settings).
  2. List any active .agent-restore-context-* files in the project root.
  3. If the hook is not configured, invoke /agent-restore-context-setup.

status

  1. List all .agent-restore-context-* files in the project root.
  2. For each file, show the skill name (derived from the filename suffix) and the first few lines of content as a preview.
  3. If no files exist, report that no active restore contexts were found.

Guidelines

  • Always read target files before modifying them
  • All actions are idempotent (check/status/delete are safe to repeat; write silently overwrites)
  • Do not create .agents/ directories — only use them if they already exist

Agent restore context: $ARGUMENTS

When not to use it

  • When not needing to persist state across sessions
  • When not needing to survive /clear or /compact
  • When not managing .agent-restore-context-* files

Limitations

  • Requires the restore-context hook to be configured
  • Does not automatically create .agents/ directories
  • Content for 'write' action must be a complete, self-contained prompt

How it compares

This workflow provides a mechanism for skills to persist state across session resets, enabling continuity that is not natively supported by /clear or /compact commands.

Compared to similar skills

agent-restore-context side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
agent-restore-context (this skill)04moNo flagsIntermediate
notion-knowledge-capture109moNo flagsIntermediate
apple-reminders252moReviewBeginner
memory-keeper-proactive-context-maintenance69moReviewIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

You might also like

notion-knowledge-capture

makenotion

Transforms conversations and discussions into structured documentation pages in Notion. Captures insights, decisions, and knowledge from chat context, formats appropriately, and saves to wikis or databases with proper organization and linking for easy discovery.

10115

apple-reminders

openclaw

Manage Apple Reminders via the `remindctl` CLI on macOS (list, add, edit, complete, delete). Supports lists, date filters, and JSON/plain output.

2593

memory-keeper-proactive-context-maintenance

b4CU-R4U

Automatically detect and maintain memory freshness by monitoring context staleness, significant code changes, task completions, and phase transitions. Proactively suggests and executes memory sync operations with user confirmation. Use when the user says "sync memory", "update context", or when the Skill detects that context is stale (>2 hours), significant changes have occurred (new commits), tasks completed, or major milestones reached. Replaces passive "context is stale" warnings with active maintenance.

694

notion-meeting-intelligence

openai

Prepare meeting materials with Notion context and Codex research; use when gathering context, drafting agendas/pre-reads, and tailoring materials to attendees.

656

agent-memory

yamadashy

Use this skill when the user asks to save, remember, recall, or organize memories. Triggers on: 'remember this', 'save this', 'note this', 'what did we discuss about...', 'check your notes', 'clean up memories'. Also use proactively when discovering valuable findings worth preserving.

943

apple-notes

openclaw

Manage Apple Notes via the `memo` CLI on macOS (create, view, edit, delete, search, move, and export notes). Use when a user asks OpenClaw to add a note, list notes, search notes, or manage note folders.

718

Search skills

Search the agent skills registry