К основному содержанию
скилл CX Codex

Sandbox Routing — скилл для Claude Code: что делает и установка

Скилл Sandbox Routing для Claude Code направляет чтение больших файлов и длинный вывод команд через инструменты песочницы. Он включается, когда агенту нужно извлечь отдельные данные без загрузки всего вывода в контекст.

MIT ★ 26 обновлён 2026-11-16

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add wrg32786/aigent-os --skill sandbox-routing -a claude-code
Открыть на GitHub

Что делает Sandbox Routing

Скилл перенаправляет анализ больших файлов и команд с выводом больше 20 строк в инструменты песочницы. В контекст попадает только напечатанное резюме, а не весь сырой вывод. Для нескольких команд предусмотрен пакетный запуск с индексированием для поиска FTS5.

Для работы нужны инструменты context-mode или их аналоги: ctx_execute, ctx_execute_file и ctx_batch_execute. Если их нет, скилл предлагает ограничивать поиск через head_limit, читать нужные диапазоны строк и не выводить большие файлы целиком. При редактировании файла его можно читать полностью.

Какие задачи решает

  • найти строку или значение в большом файле
  • сократить вывод длинной команды до нужного результата
  • обработать несколько команд и индексировать их вывод для поиска

Примеры запросов агенту

  • Найди в skill-index.json строку sandbox-routing, не загружая весь файл в контекст.
  • Запусти git log --oneline -100 и покажи только совпадения со словом ship.
  • Извлеки нужное поле из large-config.yaml через инструменты песочницы.

Как установить Sandbox Routing

1Через Skills CLI (Vercel)

npx skills add wrg32786/aigent-os --skill sandbox-routing -a claude-code

2Вручную: положить файлы

~/.claude/skills/sandbox-routing/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/sandbox-routing/

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Вопросы о Sandbox Routing

Как установить Sandbox Routing в Claude Code?

Выполни npx skills add wrg32786/aigent-os --skill sandbox-routing -a claude-code. Файл скилла находится по пути ~/.claude/skills/sandbox-routing/SKILL.md.

Что делает Sandbox Routing?

Он направляет анализ больших файлов и команд с длинным выводом через инструменты песочницы, чтобы в контекст попадали только нужные результаты.

Что нужно для работы Sandbox Routing?

Нужны инструменты context-mode или совместимые с ними ctx_execute, ctx_execute_file и ctx_batch_execute. Без них остаются запасные приёмы: ограниченный поиск через head_limit и чтение выбранных диапазонов строк.

Исходный текст

SKILL.md · MIT
---
name: Sandbox Routing
description: "Route large files and command output through sandbox tools that return summaries. Use when extracting small details from huge files or avoiding context flooding."
---

# Sandbox Routing

> [!danger] HARD RULE — fires before any large Read or Bash that isn't for editing
> If you're about to Read a long file to *analyze* (not to Edit), or run a Bash command with >20 line output, **route through sandbox tools instead**. Raw output stays out of context; only the summary you print enters context.

This skill assumes your Claude Code install includes context-mode (or equivalent) sandbox tools — `ctx_execute`, `ctx_execute_file`, `ctx_batch_execute`. If those aren't available, the principle still applies: use `head_limit` on Grep, narrow Read to specific line ranges, and avoid `cat large.log`.

## The decision tree

```
Am I about to Read or run Bash?
   ├── Editing a file? (need full content for Edit tool)
   │     → Read is correct, proceed
   │
   ├── Running git status / git log -n short / mkdir / mv / rm / short command?
   │     → Bash is correct, proceed
   │
   ├── Reading a file just to extract a piece of info / find a line?
   │     → STOP. Use ctx_execute_file with grep/awk code that prints just the answer.
   │
   ├── Running a shell command with >20 line output?
   │     → STOP. Use ctx_execute with the same command — only printed summary enters context.
   │
   └── Multiple commands at once?
         → Use ctx_batch_execute with all commands as labelled chunks, indexed for FTS5 search.
```

## When to use each tool

### `ctx_execute(language, code)`
- Shell command with large output → `language: "shell"`
- Python data processing → `language: "python"`
- API calls + response analysis → wrap the call in code
- Anything where you want *the answer*, not the raw output

### `ctx_execute_file(path, language, code)`
- File analysis without loading the file into context
- Searching within a specific known file
- Extracting structured info from JSON/YAML/MD

### `ctx_batch_execute(commands, queries)`
- Multiple commands you want to run + index together
- Chained recon (e.g., git log + git diff + git status as one batch)
- Building a knowledge base for later FTS5 queries

## Calibration anchors

| File size | Read/Bash OK? | Sandbox? |
|---|---|---|
| <20 lines | ✅ Read/Bash | not needed |
| 20-100 lines | ✅ if editing or referencing in full | ✅ if extracting |
| 100-500 lines | ⚠️ only if editing | ✅ for extraction |
| 500+ lines | ❌ unless absolutely editing | ✅ always for extraction |

## Concrete examples

### Example A: Find an insertion anchor in a 900-line JSON
- ❌ **Wrong:** `Read skill-index.json (entire file)` to find where to insert
- ✅ **Right:** `ctx_execute_file path=skill-index.json code='grep -n "skill-name" skill-index.json'` → returns just the line number, then use Edit

### Example B: Check git log for a specific commit pattern
- ❌ **Wrong:** `Bash: git log --oneline -100` (100 lines of log into context)
- ✅ **Right:** `ctx_execute language=shell code='git log --oneline -100 | grep -i "ship"'` → returns just matches

### Example C: Read a large config file for one value
- ❌ **Wrong:** `Read large-config.yaml`
- ✅ **Right:** `ctx_execute_file path=large-config.yaml code='grep "specific_key" large-config.yaml'`

## Output format

When this skill fires, internally evaluate before the tool call:
- Will the raw output be >20 lines AND I don't need it for editing?
- If yes → re-route to sandbox before invoking

You don't need to announce this to the principal. Just use the right tool.

## Anti-patterns this prevents

- Reading a 900-line skill-index just to find an insertion anchor
- `cat large.log` via Bash to "see what's happening"
- Reading 50-page docs to extract one quote
- Running parallel Bash commands when a single batch call could do one round-trip
- The PreToolUse hooks firing reminders that get ignored as false positives

## Connects to

- [`/timeline-calibration`](../timeline-calibration/SKILL.md) — sister discipline rule, both about respecting the resource budget

© wrg32786 · MIT · wrg32786/aigent-os

Похожие скиллы

Все скиллы по теме «Настройка агента: память, контекст, субагенты» →
sandbox-stable cloudflare Скилл sandbox-stable помогает создавать и поддерживать Cloudflare Sandbox на стабильном пакете @cloudflare/sandbox. Он нужен для изолированных Linux-сред в Workers. CX Codex +1 85 900установок sandbox-next cloudflare Скилл для разработки приложений Cloudflare Sandbox на превью-версии SDK 1.0 (@cloudflare/sandbox@next). Даёт агенту правила работы с новым API процессов и терминалов. CX Codex +1 85 100установок zeroboot-vm-sandbox reason-machines Скилл zeroboot-vm-sandbox запускает код агента в отдельной KVM-виртуалке через Zeroboot: форк шаблона занимает меньше миллисекунды. CX Codex +1 1 300установок bailian-sandbox modelstudioai Скилл bailian-sandbox управляет песочницами и шаблонами Alibaba Bailian из терминала: создать, подключить, поставить на паузу, удалить. CX Codex +1 1 100установок sandbox-guard UseAI-pro Скилл sandbox-guard для Claude Code и Codex генерирует Docker-конфигурацию песочницы для недоверенных скиллов. Не даёт чужому коду доступ к хосту. CX Codex +1 484установок rivet-sandbox-agent rivet-dev Скилл rivet-sandbox-agent для Claude Code запускает кодинг-агентов в изолированных песочницах и управляет ими через HTTP API для удалённого выполнения кода и работы с виртуальным рабочим столом. CX Codex +1 442установок

Из того же набора58

Весь набор →
setup Настраивает identity, приоритеты и границы полномочий aigent-OS. Запускается командой /setup для первичной или повторной настройки отдельных разделов. CX Codex +1 ★ 26звёзд репо semantic-search Скилл semantic-search для Claude Code ищет заметки в хранилище Obsidian по смыслу с помощью локальных эмбеддингов. Запускается для поиска похожих записей и воспоминаний о написанном. CX Codex +1 ★ 26звёзд репо Self-Review Скилл Self-Review для Claude Code запускает отдельную проверку кода перед завершением работы. Он включается для крупных или межфайловых изменений, горячих участков кода и при сомнениях в результате. CX Codex +1 ★ 26звёзд репо scout-vault Скилл scout-vault для Claude Code ищет связанные заметки, ссылки и определения кода. Запускается для инвентаризации хранилища или обхода цепочек вызовов. CX Codex +1 ★ 26звёзд репо resume Восстанавливает контекст незавершённой работы. По команде /resume он сверяет капсулу с актуальной памятью и выполняет следующий шаг. CX Codex +1 ★ 26звёзд репо research-deep Скилл research-deep для Claude Code собирает исследования по заметкам, веб-источникам и GitHub в брифинг с доказательствами и рекомендацией. Запускается по запросу изучить тему или сопоставить несколько источников. CX Codex +1 ★ 26звёзд репо reconcile Скилл reconcile для Claude Code сравнивает внимание к проектам за семь дней с заданными долями Tier 1. Запускается по запросу сверить приоритеты или найти их дрейф. CX Codex +1 ★ 26звёзд репо Promote Скилл Promote для Claude Code сохраняет важные выводы из диалога в заметках хранилища. Он включается, когда нужно оставить решение, факт или идею для будущих сессий. CX Codex +1 ★ 26звёзд репо

Спонсоры проекта

Компании, которые помогают держать аналитику открытой