Repository navigation
Add opt-in token-efficient mode for Instruction Hub plugins - #104
Draft
adit-chandra wants to merge 1 commit into
Draft
adit-chandra wants to merge 1 commit into
adit-chandra wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds token-efficient mode to generated Instruction Hub plugins with independent switches for concise responses and experimental input compaction. Both default off. The canonical
pigplugin owns the Claude hooks; generated skill compaction also applies to the other targets and MCP projections.concise_outputinjects a short instruction onSessionStart/SubagentStart, preserving required detail, uncertainty, literals, and work/checks.compact_instructionsapplies seven audited phrase substitutions to generated skill entrypoints and Claude Agent/Task prompts. It preserves source files, frontmatter, code, possible literals, unrelated arguments, and permission decisions.pig compact-preview, an offline tokenizer measurement script, and a paid synthetic evaluation runner make the effects reviewable. Documented opt-out and rebuild behavior restore the baseline.The CAVEWOMAN study cautions against generic input word deletion; LLMLingua-2 evaluates a learned context-aware compressor rather than stopword stripping. The research and results explain how this informs the narrow scope. Like Caveman's activation hooks, output guidance is added as context. Typed user prompts cannot be replaced by
UserPromptSubmitand are untouched.Measured limits: the current hub's 69 skill entrypoints remain 116,660 tokens with
o200k_base: zero input savings. Twelve synthetic constraints passed in all four baseline/compact/concise/both arms on both workstations. The fixed-format answers did not get shorter, so concise guidance added overhead. This is not a guarantee of unchanged coding quality or whole-session savings. The follow-up hub PR enables only concise output.Validation:
PIG_TOKEN_EFFICIENT_MODE=offgets no injected instruction.Follow-up hub configuration: https://github.com/Promptless/instruction-hub/pull/1540 (merge this toolchain PR first).