Sandboxed Tool-Output Compactor

Route Claude's tool calls through a sandbox so raw command output gets compressed before it hits the context window.

AI Systemsai-systemsp4
by AgentVoltv1.0.0Published 1y ago1 install
Free to sign up · every skill included with AgentVolt Pro

Before & after

Same prompt, same agent — the only difference is the skill.

PromptMy Claude Code sessions hit 200K tokens after an hour. How do I extend them?
Beforegeneric AI agent
Long Claude Code sessions can use a lot of tokens. One approach is to periodically clean up old messages or delete files you're no longer working with. You could also try to be more concise in your requests or break large tasks into smaller sessions. Another option is to reduce the amount of verbose output from command-line tools by parsing it yourself first. You might also want to batch related work together. Have you considered breaking this into multiple sessions? That way each one stays more focused and manageable.
Afterwith Sandboxed Tool-Output Compactor
SESSION COMPRESSION REPORT

BEFORE COMPACTION:
• Raw shell output: 312 KB (git log, test runs, find commands)
• Browser snapshots: 428 KB (screenshots of 12 pages)
• JSON responses: 156 KB (API results, unfiltered)
• Total session footprint: 896 KB (computes to ~178K tokens)

AFTER COMPACTION:
• Compressed shell output: 8 KB (errors + key lines only)
• Snapshot summaries: 12 KB (DOM structure, no pixels)
• API response extraction: 3 KB (used fields only)
• Total session footprint: 23 KB (~5K tokens)
• Time saved: 170K tokens = 2.1 hours of work capability

COMPRESSION TIERS (configured):
• Shell (tier 2): Capture exit code, last 5 lines, errors; drop intermediate output
• Browser (tier 3): Store accessibility tree only; drop images
• HTTP (tier 1): Extract response body fields matching schema

JOURNAL ENTRY:
Session ID: sess_20260731_proj42
Duration: 67 minutes
Files edited: 12
Tasks opened: 3
Errors recovered: 2 (npm install timeout, redirect loop)
Rollback available: /ctx-stats --since 45m --recover

NEXT: Enable auto-compress when crossing 100K tokens.

About this skill


name: sandboxed-output-compactor description: Route Claude's tool calls through a sandbox so raw command output gets compressed before it hits the context window. Use when working on sandboxed tool-output compactor.

Sandboxed Tool-Output Compactor

Every shell command, Playwright snapshot, or HTTP fetch runs in an isolated subprocess. Only the semantically useful slice returns to Claude. A local SQL journal captures files edited, tasks opened, and errors so that compaction never loses state. Sessions stretch from 30 minutes to multi-hour. Use during any long-running Claude Code build where tool output is noisy.

What you get

  • Sandbox routing hook
  • Output-compression rules
  • SQL session journal
  • /ctx-stats reporter
  • Per-tool compression tier
  • Rollback command

Customize your output

  • Compression aggressiveness per tool: shell, browser, HTTP
  • Sandbox runtime: Docker, local
  • Journal retention: 7, 30, 90 days
  • Auto-clean thresholds: 50k, 100k tokens
  • Whitelist tools: comma list
  • Log format: JSON, SQLite

Example output

'A 315 KB session footprint compressed to 5 KB while preserving every file-edit decision.'

Best for

Heavy Claude Code users, long-running agent operators.


Note: Real plugin exists under similar name. Skill formalizes install and tuning. High confidence.

SKILL.md preview

SKILL.md
---
name: sandboxed-output-compactor
description: Use this skill during any long-running Claude Code build where raw shell, browser, or HTTP tool output would otherwise flood the context window.
version: 1.0.0
category: AI Systems
author: AgentVolt
license: proprietary
tags:
  - ai-systems
  - p4
---

# Sandboxed Tool-Output Compactor

Routes every tool call — shell commands, browser snapshots, HTTP fetches — through an isolated subprocess so only the semantically useful slice of output returns to the model, while a local journal preserves what actually happened.

## When to use

… (sign up to view the full skill)
Sign up to view, copy, and install the full skill