← Browse

@blackfrost-ai/context-saver

A

Token-saving execution layer (v6). Runs skill commands in sandboxed subprocesses where compact summaries enter the context window while full output is FTS-indexed. Session continuity via SQLite events + snapshots (16KB default budget, auto-log from execute, restore fallback). Supports intent filtering, batch execution, and progressive memory loading. Use for data-heavy ops; always snapshot before compact and restore/recent on resume.

skillclaude

Install

agr install @blackfrost-ai/context-saver --target claude

Writes 11 files into .claude/skills/, pinned to git-cbb3b65c.

  • .claude/skills/context-saver/.gitignore
  • .claude/skills/context-saver/CHANGELOG.md
  • .claude/skills/context-saver/LICENSE
  • .claude/skills/context-saver/README.md
  • .claude/skills/context-saver/SESSION.md
  • .claude/skills/context-saver/SKILL.md
  • .claude/skills/context-saver/install.py
  • .claude/skills/context-saver/package-lock.json
  • .claude/skills/context-saver/package.json
  • .claude/skills/context-saver/skill.json
  • .claude/skills/context-saver/tsconfig.json

Document


name: context-saver description: "Token-saving execution layer (v6). Runs skill commands in sandboxed subprocesses where compact summaries enter the context window while full output is FTS-indexed. Session continuity via SQLite events + snapshots (16KB default budget, auto-log from execute, restore fallback). Supports intent filtering, batch execution, and progressive memory loading. Use for data-heavy ops; always snapshot before compact and restore/recent on resume." metadata: {"emoji":"ðŸŠķ","requires":{"bins":["python3"],"env":[]}}

Context Cooler — Token Optimization

Reduces token consumption by 70-98% through sandboxed execution, intent filtering, and session continuity.

Core Concept

Instead of dumping raw API responses (3-50 KB) into context, Context Saver:

  1. Runs skill commands in subprocesses
  2. Captures full output
  3. Extracts only relevant fields based on intent
  4. Returns compact summaries (100-500 bytes)
  5. Indexes full output in FTS5 for on-demand retrieval

Commands

Sandboxed Skill Execution

# Run any skill command with automatic summarization
python3 scripts/ctx_run.py --skill my-api --cmd "dashboard" [--intent "check error rate"]
python3 scripts/ctx_run.py --skill my-api --cmd "list-items" [--intent "find failures"]
python3 scripts/ctx_run.py --skill my-api --cmd "search users" --intent "inactive accounts over 90 days"

# Run with explicit summary fields
python3 scripts/ctx_run.py --skill my-api --cmd "dashboard" --fields "active_users,error_rate,uptime"

Batch Execution (Multiple Skills in One Call)

python3 scripts/ctx_batch.py --commands '[
  {"skill": "my-api", "cmd": "dashboard", "fields": ["active_users","error_rate"]},
  {"skill": "analytics-engine", "cmd": "metrics", "intent": "summary"},
  {"skill": "health-monitor", "cmd": "check", "intent": "failures only"}
]'

Session Event Tracking

# Log a session event
python3 scripts/ctx_session.py log --type "action" --priority critical --data '{"operation":"deploy","service":"api-v2"}'

# Build compaction snapshot (called before conversation compacts)
python3 scripts/ctx_session.py snapshot

# Restore from snapshot (called on session resume; falls back across sessions)
python3 scripts/ctx_session.py restore

# List recent events / rotate session id
python3 scripts/ctx_session.py recent --limit 10
python3 scripts/ctx_session.py new

# View session stats
python3 scripts/ctx_session.py stats

Context Search (Query Indexed Data)

python3 scripts/ctx_search.py "error rate spike" [--source my-api]
python3 scripts/ctx_search.py "failed deployments" --source last-run

Context Stats

python3 scripts/ctx_stats.py
# Shows: total bytes saved, calls made, avg compression ratio, session events

How It Saves Tokens

OperationWithout Context SaverWith Context SaverSavings
Dashboard summary3 KB JSON120 B summary96%
List items (50 records)5 KB JSON300 B summary94%
Search results (200 hits)20-50 KB500 B filtered97%
Multi-skill pipeline23 KB (4 calls)2 KB (1 batch)91%
Session cold start20 KB workspace files2 KB snapshot90%

When to Use

  • Any data-heavy skill command (APIs, analytics, search)
  • Multi-step pipelines (daily reports, status checks)
  • Session resumption after compaction
  • When context window is running low
  • Don't use for small operations (<500 bytes output)
  • Don't use when you need full raw data for editing/modification

Trustgrade A

  • passBody integrity

    Whether the stored document is plausibly the kind of file the artifact declares, rather than something fetched by mistake.

  • passType matchnot applicable to this artifact type

    Whether the artifact is really the kind of thing its metadata claims it is.

  • passFreshness

    How long since the source repository was last pushed to.

  • passPrompt injection

    Scans the artifact's own text for instructions aimed at your agent rather than at you.

  • passLicense

    Whether the source repository declares an SPDX license permissive enough to redistribute.

How the grade is calculated

Each check contributes 0 points when it passes, 1 when it warns, and 2 when it fails. The total maps to a letter:

  • Aevery check passed
  • Bone warning
  • Ctwo warnings
  • Dprompt injection or body integrity failed, or three warnings
  • Fone of those failed, and something else is wrong

These are automated hygiene checks, not a security audit, and not a dependency or vulnerability scan. A grade of A means nothing was flagged — not that the artifact is safe.

Versions

  • git-cbb3b65c22ce2026-07-31