delegating-with-context
Installation
SKILL.md
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
- Check the hook is live.
test -s ~/.claude/context-filter-log.jsonl && tail -1 ~/.claude/context-filter-log.jsonlshows 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.