delegating-with-context

Solid

Delegates work to a subagent or spawned session by writing only the task, while a PreToolUse hook pages the parent transcript through Jev and appends the chunks that task needs. Use before writing any Agent tool prompt or create_session prompt, and when asked to delegate this, hand this off, use a subagent, spawn an agent, run agents in parallel, or brief a subagent on what we have done so far.

AI & Automation 150 stars 6 forks Updated yesterday MIT

Install

View on GitHub

Quality Score: 85/100

Stars 20%
73
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Delegating with context Writing a background brief for a subagent costs output tokens, generation time, and fidelity: exact paths, error strings and numbers get paraphrased or dropped, and the brief omits what the orchestrator did not know mattered. The `context_hook.py` PreToolUse hook removes the need. It reads the session transcript, asks Jev which chunks the task needs, and appends those chunks to the subagent's prompt verbatim. The hook fires after the prompt is written, so it cannot save a brief you already wrote. The saving happens here, before the tool input exists. ## Procedure 1. **Check the hook is live.** `test -s ~/.claude/context-filter-log.jsonl && tail -1 ~/.claude/context-filter-log.jsonl` shows the last filtered delegation. No file on a first delegation is normal; the hook's reply after your first Agent call confirms it (step 5). Where the hook is not wired (claude.ai, a machine without the settings entry), stop here and write a normal brief. 2. **Preview what the filter would pass.** One call, all tasks at once: ```bash python3 /mnt/skills/user/delegating-with-context/scripts/preview.py \ --task "Write the xr latency note for the follow-up memory" \ --task "Draft the closing status for both PRs" ``` Each task prints the kept chunk ids with a one-line gist. This is the check: find the chunk that holds the fact the subagent must not miss. It takes one to two seconds and costs a fraction of a cent. 3. **Write on...

Details

Author
oaustegard
Repository
oaustegard/claude-skills
Created
11 months ago
Last Updated
yesterday
Language
Python
License
MIT

Similar Skills

Semantically similar based on skill content — not just same category

AI & Automation Listed

delegate

Snapshots the full current context — open file, conversation history, project memory files, decisions made, and what's left — then hands the task off to a specialized subagent (preferred) or general-purpose subagent (fallback) that drives to completion autonomously. Use when you need to offload work without losing context, when a task spans files or domains that don't fit a focused specialist, or when you want a subagent to own a task end-to-end while you stay free to work on other things. Also useful for keeping the main context window clean during long multi-step sessions. The subagent receives a structured briefing and works independently — no further prompting required. Check Agency catalog for named specialists first.

3 Updated 3 weeks ago
Tekkiiiii
AI & Automation Listed

subagent-delegation

Split work across subagents so each has a focused context, and combine their results deliberately. Use when a task is too large for one context or has independent parallel parts.

8 Updated 2 weeks ago
Amey-Thakur
Data & Documents Listed

delegation-handoff

Use when handing work to a background agent or subprocess, or when one comes back reporting success. Covers verifying the premise before dispatch, writing a brief the worker can finish inside its budget, and checking the artifact yourself afterward. Prevents acting on a self-reported success, since a worker claiming "uploaded" or "file written" is a claim, not evidence.

0 Updated 2 weeks ago
TechNickAI