npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

teneb-claude-code

v5.0.0

Published

Claude Code plugin: compresses tool outputs, blocks wasteful prompts, manages context budget. ~42% token reduction.

Downloads

117

Readme

Teneb

A Claude Code plugin that reduces token usage by compressing tool outputs, blocking wasteful prompts, and managing your context budget automatically.

What it does

Teneb hooks into Claude Code's lifecycle and works silently in the background:

  • Compresses tool outputs — Read, Bash, Edit results are compacted before re-entering Claude's context window. ~42% average token reduction.
  • Blocks vague prompts — Catches ambiguous or gibberish prompts before they waste an API call (~40K tokens saved per blocked prompt).
  • Fixes typos — Auto-corrects 50 common programming typos (e.g. fucntionfunction) silently.
  • Manages context budget — Tracks token usage across your session with three pressure tiers (green/yellow/red). Compression gets more aggressive as you approach the context limit.
  • Suggests next steps — After each tool call and at session end, recommends what to do next and which model to use.
  • Learns across sessions — Records tool reliability, success rates, and patterns to improve recommendations over time.
  • Rust/WASM engine — Optional native compaction engine for faster processing.

Install

Pick whichever you prefer.

One-line curl:

cd your-project
curl -fsSL https://raw.githubusercontent.com/5uf/teneb/main/install.sh | bash

npm (global):

npm i -g teneb-claude-code
cd your-project
teneb init

Manual (clone the repo):

git clone https://github.com/5uf/teneb.git
cd your-project
node /path/to/teneb/src/cli.js init

As a Claude Code plugin (system-wide, all projects):

Point Claude Code at the cloned repo via its plugin system. The repo includes a hooks.json manifest using $CLAUDE_PLUGIN_ROOT so one install activates Teneb across every project. No per-project copying needed.

Any of these will copy hooks + runtime into your project's .claude/hooks/ and src/, and write .claude/settings.json. Restart Claude Code in that directory and Teneb is active.

Run teneb doctor to check the install.

Optional: Build the WASM engine

For faster compaction, compile the Rust engine:

rustup target add wasm32-unknown-unknown
cd rust-wasm
cargo build --target wasm32-unknown-unknown --release

Teneb auto-detects the WASM binary and uses it. Falls back to JavaScript if not compiled.

How it works

Teneb uses Claude Code hooks to intercept key events:

| Hook | What Teneb does | |------|----------------| | SessionStart | Resets the token budget for the new session | | PromptSubmit | Fixes typos, blocks vague prompts, tracks token usage | | PreToolUse | Recommends tools, blocks risky commands, injects conciseness hints at high pressure | | PostToolUse | Compresses tool output, applies smart truncation, tracks budget, hints next step | | Stop | Suggests what to do next and which model to use | | SessionEnd | Prints session summary (tokens saved, tools used, budget status) |

Token budget tiers

| Tier | Context used | What changes | |------|-------------|-------------| | Green | < 40% | Normal compaction | | Yellow | 40–80% | Tighter compression, stricter prompt gate, "prefer short answers" hint | | Red | > 80% | Aggressive compression, vague prompts blocked, "be concise" injected |

Benchmarking

Offline comparison

npm run ab

Compares raw token counts vs Teneb-compacted output on built-in fixtures:

source                        type      raw_tok teneb_tok  reduction  engine
────────────────────────────────────────────────────────────────────────────
research-dup                  fixture        73        45      38.4%  rust-wasm
implementation-tools          fixture        68        38      44.1%  rust-wasm
debug-failure-loop            fixture        59        32      45.8%  rust-wasm
────────────────────────────────────────────────────────────────────────────
AVERAGE                                      67        38      42.5%

Live A/B comparison

Runs the same prompt through Claude Code with and without hooks:

npm run live-ab                          # 3 runs, default prompt
npm run live-ab -- --runs 5              # more runs for statistical confidence
npm run live-ab -- --prompt-set code     # test code-related prompts
npm run live-ab -- --prompt-set all      # all prompt categories
npm run live-ab -- --prompt "your prompt here"

Results saved to benchmarks/results/.

Capture real data

Record raw tool outputs from real Claude Code sessions for replay:

TENEB_CAPTURE=1 claude    # captures raw outputs to benchmarks/captures/
npm run ab                # replays them alongside synthetic fixtures

Scripts

| Command | What it does | |---------|-------------| | npm test | Run all tests (129 tests) | | npm run ab | Offline A/B token comparison | | npm run live-ab | Live Claude Code A/B benchmark | | npm run benchmark | Full benchmark suite | | npm run report | Generate benchmark dashboard |

Configuration

Teneb uses sensible defaults. Override via .teneb/config.json:

{
  "compaction": {
    "maxSummaryLength": 240,
    "aliasMinLength": 16
  },
  "budget": {
    "max_tokens": 200000,
    "green_threshold": 0.4,
    "yellow_threshold": 0.8
  }
}

Project structure

src/
  micro-compact.js        # Text compaction (filler removal, alias tables)
  semantic-deduper.js     # Near-duplicate sentence removal
  token-budget.js         # Per-session budget tracking
  prompt-guard.js         # Typo correction + ambiguity detection
  next-step-advisor.js    # Next action + model recommendations
  tool-broker.js          # Tool scoring + auto-install gate
  predictive-planner.js   # Predictive execution planning
  learning-store.js       # Cross-session JSONL learning store
  wasm-bridge.js          # Rust/WASM engine loader
  config.js               # Configuration defaults + merging
  tests/                  # 129 tests across 27 suites

.claude/hooks/            # Claude Code hook entry points
rust-wasm/                # Rust compaction engine (no_std, 51KB WASM)
benchmarks/               # Benchmark results + captured data

License

MIT