hive.context-preservation

Extracts critical values from tool results into working notes before context pruning.

11.0k|5.7k|Updated Jan 12, 2026
One-click install
npx skills add https://github.com/aden-hive/hive --skill hive-context-preservation
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: hive.context-preservation
Source: https://github.com/aden-hive/hive/tree/main/core/framework/skills/_default_skills/context-preservation
Command: npx skills add https://github.com/aden-hive/hive --skill hive-context-preservation

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Long-running agent tasks lose important information when older tool results are automatically pruned from the finite context window, causing agents to forget URLs, IDs, and analysis conclusions they still need.

Core Features & Use Cases

  • Save-as-you-go extraction: Immediately copies key data from tool results into _working_notes or _preserved_data before pruning removes the originals.
  • Selective preservation guidance: Defines what to extract (URLs, API fields, specific values, conclusions) versus what to discard (raw JSON blobs, full pages, entire files).
  • Database-backed handoffs: Routes cross-task state through progress.db fields like steps.evidence and tasks.last_error instead of shared-buffer blobs.
  • Use Case: A worker agent scraping multiple pages saves each target URL and key snippet as it goes, so when early results are pruned at the context limit, it can still compile the final report.

Quick Start

Instruct the agent to preserve important values from each tool result into working notes so nothing critical is lost when older context is pruned.

Frequently Asked Questions about hive.context-preservation

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

FAQPage Schema
How do I prevent an AI agent from losing information when context is pruned?

Extract key values from each tool result into working notes immediately after the call, before pruning occurs. Save URLs, relevant API fields, specific IDs, and conclusions rather than relying on referring back to old tool outputs.

What data should an agent save from tool results before context pruning?

Save URLs and key snippets, relevant API fields, specific lines or IDs, and analysis conclusions. Avoid storing raw JSON blobs, full pages, or entire files, which waste limited note space.

How do agents pass state between tasks in a multi-worker workflow?

Handoffs happen through progress.db rather than shared-buffer blobs. State the next worker needs goes into task row fields such as steps.evidence, tasks.last_error, and sop_checklist.note.

When does the context preservation warning trigger?

The agent receives an alert when context usage reaches the configured warn_at_usage_ratio_pct threshold. At that point it should immediately preserve any remaining critical values before further pruning occurs.

What are the limitations of working notes for agent memory?

Working notes only cover state that the progress.db schema does not capture, so structured task state belongs in the database. Notes also require discipline to keep concise, since storing raw outputs defeats the purpose of selective extraction.