/delegate-local:delegate-localfrom delegate-local
Pipes large text inputs (logs, diffs, PR threads, documents) in chunks to a local model (MLX, Ollama, Docker Model Runner) for summaries, matching lines, field extraction, or item classification. Keeps content on-device and offline. Use when input exceeds ~20k characters or user requests local processing.
Ships in delegate-local. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Read a large input on this machine so it never enters your context. You decide what to ask; a local model reads the input in chunks and returns a short answer with anchors (quoted lines, line numbers, item ids) that you verify with grep instead of reading the input. Since ADR 0035 this is the skill's only job: drafting text you will publish costs more of your output tokens than it saves, so write that yourself.
Paths below are relative to the skill directory (~/.claude/skills/delegate-local/ on a Claude Code install).
Fits, when the input is large and you have not read it:
Do NOT delegate:
When the content may leave the machine and the user has not asked for a local model, a subagent on a small cloud model is an equally good way to keep a large input out of your context. The local path is the one to take when the content must stay on the device.
grep, jq, awk or git log --grep answer most questions about a large input for free and exactly; delegate only the part that needs reading.grep -n against the input, then combine the chunk answers yourself. The output is a pointer to where to look, not a finding.grep -nE 'ERROR|FAIL|panic' build.log | bash scripts/delegate.sh reasoning \
"Group these log lines by root cause. One line per cause: the cause, then the line numbers it covers."
d="${TMPDIR:-/tmp}/delegate-chunks.$$"; mkdir -p "$d"
grep -n '' big.log | split -l 400 -a 4 - "$d/chunk."
for c in "$d"/chunk.*; do
bash scripts/delegate.sh reasoning "Each line starts with its line number and a colon. List each line that reports a timeout as <number>: <quoted line>. If none, reply REFUSE: none." < "$c"
done
rm -r "$d"
grep -n numbers the lines before the split, so every anchor is a line number in the original file; a fresh directory per run keeps leftover chunks out, and a four-letter suffix leaves room for any number of chunks.
delegate.sh <tier> "<prompt>" takes the input on stdin, resolves the tier with pick-model.sh, and posts to the winning provider's {base}/chat/completions with temperature:0 and thinking off. The answer is plain text on stdout. After each successful call a delegate-meta: line on stderr names the model, tier, backend, tokens_local (characters in and out divided by 4, which is what stayed local, not a saving) and duration_ms; in your reply, say the input was read locally and name the model, e.g. "Read locally by (reasoning tier), 41k characters in 12 s." Each call appends one row to ~/.local/share/delegate-local/metrics.jsonl; DELEGATE_LOCAL_NO_METRICS=1 opts out. The first call to a model that is not loaded can take tens of seconds; a call that runs well past a minute with no output should be killed and split.
Single-quote any prompt that names a literal $VARNAME, or pass it through a <<'EOF' heredoc, so the shell does not expand it. Never put secrets in a prompt: it lands in shell history and, on recipe calls, in the stored input.
Three recipes in prompts/ fit the shape. Each declares its tier, so pass no tier.
| You need | Recipe |
|---|---|
| a status timeline of a long issue, PR thread or CI log | summarise-issue (--var kind=... --var N_FACTS=...) |
| a label per item from a fixed set | bulk-classify (--var categories=... --var output_format=...) |
| a one-sentence summary of one document, one call per file | file-summary |
gh issue view 142 --comments | bash scripts/delegate.sh --recipe summarise-issue --var kind=issue --var N_FACTS=5
Piped stdin fills {{stdin}} and each --var fills its {{key}}; a missing key exits 2. Recipe calls first send a 1-token canary and exit 3 when it does not answer within DELEGATE_PREFLIGHT_TIMEOUT seconds (default 10), which a cold model causes: rerun with DELEGATE_PREFLIGHT_TIMEOUT=90. For a batch over many files, run the calls one after another, not in parallel.
Closed prompts work; open prompts invent findings. "List the lines matching", "Extract these fields as JSON", "Classify each item as P0, P1 or P2" are reliable. "Find anything interesting" or "suggest improvements" produce confident claims that do not survive a check. One question per call. Give a one-shot example as an angle-bracket skeleton (<line number>: <quoted line>), drawn from a different item than the input, so a leak is visible. For a fixed output set, state priority-ordered rules with keyword triggers rather than relying on the example.
pick-model.sh <tier> resolves a tier to the first served model in that tier's preference list; never hardcode model names in calls. Providers come from DELEGATE_BASE_URL, defaulting to MLX (localhost:8080), Docker Model Runner (localhost:12434) and Ollama (localhost:11434), first reachable wins. Use reasoning for filtering, extraction and classification, long-context for the largest chunks, and prose for summaries; by default they resolve the same model. If no provider is reachable the call fails: do the work another way and say why.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
local-model, large-input, offline, summarization, text-processing
Other plugins' skills for the same job
Generated from the plugin's indexed repository (ismaelmartinez/delegate-local) — no native marketplace selected
npx claudepluginhub p/ismaelmartinez-delegate-to-ollama