
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
RTK token reduction extension for pi-coding-agent - reduces LLM token consumption 60-90% by intelligently filtering tool output
A token reduction plugin for pi-coding-agent that intelligently filters tool output to reduce token consumption by 60-90% while preserving essential information.
Based on the RTK (Rust Token Killer) specification from RTK.
Recommended: install the package via the pi package manager.
pi install npm:pi-rtk
Or add the package to your pi agent config to load automatically. Edit ~/.pi/agent/settings.json and include:
{
"packages": [
"npm:pi-rtk"
]
}
If you need to install manually (older pi versions), you can clone into the extensions directory:
git clone https://github.com/mcowger/pi-rtk ~/.pi/agent/extensions/pi-rtk
Create ~/.pi/agent/rtk-config.json:
{
"enabled": true,
"logSavings": true,
"showUpdateEvery": 10,
"techniques": {
"ansiStripping": true,
"truncation": { "enabled": true, "maxChars": 10000 },
"sourceCodeFiltering": { "enabled": true, "level": "minimal" },
"smartTruncation": { "enabled": true, "maxLines": 200 },
"testOutputAggregation": true,
"buildOutputFiltering": true,
"gitCompaction": true,
"searchResultGrouping": true,
"linterAggregation": true
}
}
minimal: Remove comments, normalize whitespaceaggressive: Keep only signatures and structureSource code filtering can be toggled independently of its level via commands or the rtk_configure tool.
/rtk-stats - Show token savings statistics/rtk-on / /rtk-off - Enable/disable token reduction/rtk-clear - Clear metrics history/rtk-what - Show current technique configuration/rtk-toggle-ansiStripping - Toggle ANSI stripping/rtk-toggle-truncation - Toggle output truncation/rtk-toggle-sourceCodeFiltering - Toggle source code filtering/rtk-toggle-smartTruncation - Toggle smart truncation/rtk-toggle-testOutputAggregation - Toggle test output aggregation/rtk-toggle-buildOutputFiltering - Toggle build output filtering/rtk-toggle-gitCompaction - Toggle git compaction/rtk-toggle-searchResultGrouping - Toggle search result grouping/rtk-toggle-linterAggregation - Toggle linter aggregationThe rtk_configure tool is registered for use by the AI agent to programmatically adjust any RTK parameter at runtime. This is particularly useful when file edits fail due to text-matching errors: the agent can temporarily disable sourceCodeFiltering, re-read the file, apply the edit, and re-enable filtering.
| Output Type | Expected Savings |
|---|---|
| Source code | 60-90% (aggressive mode) |
| Build output | 70-90% |
| Test results | 50-80% |
| Git output | 60-80% |
| Search results | 40-60% |
The plugin intercepts tool_result events and applies appropriate filtering based on:
Metrics are tracked in-memory and can be viewed with /rtk-stats.
MIT - Based on the RTK specification
FAQs
RTK token reduction extension for pi-coding-agent - reduces LLM token consumption 60-90% by intelligently filtering tool output
We found that pi-rtk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.