cd /news/developer-tools/claude-code-plugin-that-shunts-work-โ€ฆ ยท home โ€บ topics โ€บ developer-tools โ€บ article
[ARTICLE ยท art-122430] src=github.com โ†— pub= topic=developer-tools verified=true sentiment=ยท neutral

Claude Code plugin that shunts work saving 82-94% of tokens

A new Claude Code plugin called shunt redirects I/O-heavy work to AiKA modes, saving 82-94% of tokens on large file reads and boilerplate generation. The plugin uses hooks, scripts, and skills to delegate tasks through the Portal CLI actions registry, requiring the portal plugin and jq. It includes two AiKA modes, bulk-reader and code-writer, which can be created if not present.

read7 min views1 publishedSep 7, 2026
Claude Code plugin that shunts work saving 82-94% of tokens
Image: Michielbdejong (auto-discovered)

A Claude Code plugin that shunts I/O-heavy work to AiKA modes, saving 82-94% of tokens on large file reads and boilerplate generation.

Three layers, from hard gate to soft suggestion:

  1. Hooks block Claude from reading large files and redirect to the bulk-reader skill
  2. Scripts handle the AiKA invocation and output cleanup
  3. Skills tell Claude when and how to call the scripts

Claude never assembles bash pipelines from prose. It calls a script with named arguments. The scripts handle everything internally.

Delegation goes through the Portal CLI actions registry โ€” one aika:invoke-chat call per delegation โ€” so the plugin works against any Portal instance with AiKA enabled. Modes are addressed by name and resolved server-side: case-insensitive, preferring your own mode, then your groups', then public ones; a name matching nothing or several modes equally fails with the candidate ids.

  • jq โ€” brew install jq
  • The portal plugin from this marketplace, which provides the Portal CLI that shunt delegates through:
claude plugin install portal@portal

Then, in a new session, set up and authenticate the CLI against your Portal instance:

/portal:setup

shunt sets PORTAL_CLI_ENABLE_EXPERIMENTAL for its own calls (the actions registry is experimental in portal-cli 0.4.x); you only need it exported for the manual portal-cli commands below.

Check whether the two AiKA modes (bulk-reader and code-writer) already exist on your instance โ€” many instances ship them as public modes:

portal-cli actions aika:list-modes --json --input '{"search": "bulk-reader"}'

If they exist, no mode creation is needed โ€” just install the plugin and go. If not, or to create your own customized versions (e.g. different model or instructions):

portal-cli actions aika:create-mode --input '{
  "name": "bulk-reader",
  "description": "Bulk file reader for code analysis",
  "instructions": "You are a precise code analyst. Read the provided files and answer the question concisely. Output structured bullets only. No greetings, no prose, no preambles, no summaries. Lead every bullet with the exact name, type, or line number. Use nested bullets for details. Skip anything the caller did not ask for.",
  "tags": ["coding", "delegation"],
  "resource_limits": { "temperature": 0.2 }
}'

portal-cli actions aika:create-mode --input '{
  "name": "code-writer",
  "description": "Boilerplate code generator",
  "instructions": "You generate code files based on a spec and reference files. Match the existing patterns, conventions, naming, and style exactly. Output only the code โ€” no explanations, no markdown fences unless asked. If the spec is ambiguous, make reasonable choices that match the patterns in the reference code.",
  "tags": ["coding", "delegation"],
  "resource_limits": { "temperature": 0.2 }
}'

A mode you create is private and owned by you, and name resolution prefers your own modes โ€” so your customized bulk-reader automatically shadows the public one, no configuration needed.

shunt/
โ”œโ”€โ”€ .claude-plugin/
โ”‚   โ””โ”€โ”€ plugin.json          # Plugin manifest (name, description, version)
โ”œโ”€โ”€ hooks/
โ”‚   โ”œโ”€โ”€ hooks.json           # Hook registration (PreToolUse matchers)
โ”‚   โ”œโ”€โ”€ check-file-size      # Blocks Read on files > 350 lines
โ”‚   โ””โ”€โ”€ check-bash-read      # Blocks cat/head/tail on large files
โ”œโ”€โ”€ scripts/
โ”‚   โ”œโ”€โ”€ lib/
โ”‚   โ”‚   โ””โ”€โ”€ aika.sh          # Shared aika:invoke-chat plumbing
โ”‚   โ”œโ”€โ”€ bulk-read            # Invokes the bulk-reader mode
โ”‚   โ””โ”€โ”€ code-write           # Invokes the code-writer mode
โ”œโ”€โ”€ skills/
โ”‚   โ”œโ”€โ”€ bulk-reader/
โ”‚   โ”‚   โ””โ”€โ”€ SKILL.md         # When/how to call bulk-read
โ”‚   โ””โ”€โ”€ code-writer/
โ”‚       โ””โ”€โ”€ SKILL.md         # When/how to call code-write
โ””โ”€โ”€ evals/
    โ”œโ”€โ”€ run.sh                # Runs hook + transport evals (50 tests)
    โ”œโ”€โ”€ hook-evals.json       # Read hook test cases (17)
    โ”œโ”€โ”€ bash-hook-evals.json  # Bash hook test cases (17)
    โ”œโ”€โ”€ transport-evals.sh    # scripts/lib/aika.sh against a stubbed CLI (16)
    โ”œโ”€โ”€ evals.json            # End-to-end skill test cases (3)
    โ”œโ”€โ”€ benchmarks.json       # Token savings scenarios (4)
    โ””โ”€โ”€ fixtures/             # Test fixture files

Delegates file reading to AiKA. Files are wrapped in XML tags (<file path="...">) for clear boundaries.

bulk-read --question "What does this service do?" --paths src/Service.java src/Handler.java

bulk-read --question "Which methods call the database?" --paths src/Service.java src/Handler.java

Delegates boilerplate generation to AiKA. Strips markdown fences from output. Can write directly to disk via --target. --reference is required โ€” without a file to match patterns against, the worker would generate context-free code that fits nothing in the project.

code-write --spec "Write tests for UserService" --reference tests/OrderTest.java --target tests/UserTest.java

code-write --spec "Now add edge case tests" --reference tests/UserTest.java --target tests/UserEdgeCases.java

code-write --spec "Generate a config stub" --reference config/existing.yaml

aika:invoke-chat is ephemeral: nothing is stored server-side, and the action's own follow-up mechanism is for the caller to replay prior turns. Replaying a file corpus is the exact cost this plugin exists to avoid, so shunt does not do it โ€” every call stands alone. Re-sending files is free where it matters, because the corpus goes to the worker model and never enters Claude's context.

Fires on every Read tool call. Blocks full-file reads on files exceeding MIN_LINES (default: 350, configurable via SHUNT_MIN_LINES env var). Allows through:

  • Targeted reads (offset or limit set)
  • Files under the threshold
  • Nonexistent files (let Read handle the error)

Fires on every Bash tool call. Catches cat, head, tail, less, more on large files. Allows through:

  • Piped commands (cat file | grep ) โ€” targeted reads
  • Redirections (cat file > out ) โ€” not reading into context
  • Commands with flags that indicate targeted reads
  • Non-read commands (git status ,grep , etc.)

All settings are environment variables โ€” add them to the env block in .claude/settings.json.

Variable Default Purpose
SHUNT_MIN_LINES 350 Line count above which the Read hook blocks and redirects
SHUNT_PORTAL_INSTANCE CLI default Portal instance name or URL to invoke against
PORTAL_CLI_BIN portal-cli , elsenpx Override how portal-cli is launched
SHUNT_MAX_PAYLOAD_BYTES 400000 (120000 on Linux) Request ceiling, since input travels through argv
SHUNT_BULK_READER_MODE_ID โ€” Pin a specific mode id if the name is ambiguous
SHUNT_CODE_WRITER_MODE_ID โ€” Pin a specific mode id if the name is ambiguous

The plugin is designed to know when NOT to delegate:

  • Debugging โ€” requires Claude's reasoning, not a summary
  • Editing โ€” Claude needs exact content in context; use targeted reads (offset/limit)
  • Small files โ€” delegation overhead exceeds savings under 350 lines
  • Architectural decisions โ€” judgment calls stay on Claude
bash evals/run.sh

bash evals/run.sh --benchmark

Tested against a 162K-line Java monorepo:

Scenario Lines Without shunt With shunt Savings
Single large file (SpotifyUri.java) 4,014 33,684 tokens 5,737 tokens 82%
Source + test pair (PromotionRuleRepository) 7,408 75,990 tokens 4,148 tokens 94%
Multi-file cross-service (permission handlers) 1,281 16,221 tokens 821 tokens 94%
Code-write (generate tests from reference) 3,667 40,614 tokens + generation 833 lines to disk -

Mean bulk-read savings: 90%

  • No enforcement for code-writer โ€” only bulk-reader has hook enforcement. Code-writer relies on Claude recognizing when to use it via the skill description.
  • Request size โ€”aika:invoke-chat input is passed on the command line, so a request must fit inARG_MAX (1 MB on macOS, shared with the environment; Linux additionally caps a single argument at 128 KiB). shunt refuses anything overSHUNT_MAX_PAYLOAD_BYTES with a clear error rather than failing withE2BIG . Split into smaller batches.
  • 30-second invocation cap โ€” portal-cli aborts an action invocation after 30s and does not expose a timeout flag. Large generations can exceed it; split the spec into smaller calls.
โ”€โ”€ more in #developer-tools 4 stories ยท sorted by recency
โ”€โ”€ more on @claude code 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain โ€” perfect for shipping the agent you just read about.

$git push zahid main
โ†’ Live at https://your-agent.zahid.host โœ“
Get free account โ†’ Pricing
from โ‚ฌ0/mo ยท no card required
LIVE [news/claude-code-plugin-tโ€ฆ] indexed:0 read:7min 2026-09-07 ยท โ€”