Restore Context Management

VerifiedSafe

Manage restore context files so skills can survive /clear and /compact commands.

Sby Skills Guide Bot
ProductivityIntermediate
8/26/2026
Claude Code
#context-management#session-persistence#claude-code-hooks#slash-command#workflow-continuity

Recommended for

Automated summary

Manages `.agent-restore-context-<skill-name>` files in the project root so skills can pick up where they left off after `/clear` or `/compact`.

Strengths

  • Four clear, idempotent actions: write, delete, check, and status
  • Verifies the SessionStart hook exists in the settings files before writing anything
  • Ships a self-contained resume-prompt template that callers can adapt
  • `check` automatically offers to install the hook through `/agent-restore-context-setup`

Limitations

  • Claude Code only, since it depends on the SessionStart hook and `.claude/settings*.json` files
  • Does not resume work by itself: without the hook, written content is never re-injected
  • Restore files are plain text at the project root with no versioning or conflict handling
When to use it

Use it when a long-running skill must survive a context clear or compaction and resume its state afterwards.

When not to use it

Avoid it if you are not on Claude Code, or if the SessionStart hook is not installed and you do not plan to set it up.

Security analysis

Safe
Quality score92/100

The skill only manages files with a specific naming pattern (.agent-restore-context-<skill-name>) in the project root, reads settings files, and deletes only those context files. No destructive commands, network access, exfiltration, or obfuscation are present. It is a legitimate utility for context persistence.

No concerns found

How this analysis is made

Examples

Save a resume prompt
/agent-restore-context write jira-implement-task — save this content: ticket PROJ-482, branch feat/PROJ-482, step 3 of the plan; on resume, reload the skill then read the plan and the failing test.
List active restore contexts
/agent-restore-context status
Clean up after finishing
/agent-restore-context delete jira-implement-task

name: agent-restore-context description: Manage restore context files so skills can survive /clear and /compact. Use to write, delete, check, or list .agent-restore-context-* files. disable-model-invocation: false argument-hint: <action> <skill-name> [content] allowed-tools: Bash, Grep, Glob, Read, Edit, Write

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

From the file to a first result

The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.

View the source and supporting files

This download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.

1. Download the file

Download SKILL.md

From the root of a test project, save the file as .skill-downloads/restore-context-management-mt9mglrv/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.

Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.

mkdir -p '.skill-downloads/restore-context-management-mt9mglrv' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/restore-context-management-mt9mglrv/download' --output '.skill-downloads/restore-context-management-mt9mglrv/SKILL.md.part' && mv '.skill-downloads/restore-context-management-mt9mglrv/SKILL.md.part' '.skill-downloads/restore-context-management-mt9mglrv/SKILL.md'

2. Check prerequisites

Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.

Tools declared by the author (check availability in your agent): Bash, Grep, Glob, Read, Edit, Write

No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.

The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.

3. Load the skill

After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.

Claude Code
test -f '.skill-downloads/restore-context-management-mt9mglrv/SKILL.md' && test -s '.skill-downloads/restore-context-management-mt9mglrv/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/agent-restore-context' && cp -R '.skill-downloads/restore-context-management-mt9mglrv' '.claude/skills/agent-restore-context'

OpenSkills

OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.

Official OpenSkills installation
openskills install './.skill-downloads/restore-context-management-mt9mglrv'

openskills read 'restore-context-management-mt9mglrv'

Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.

For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.

openskills sync

Manual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.

4. Try a first task

Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:

Read .skill-downloads/restore-context-management-mt9mglrv/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.

Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.

Related skills