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

@tvonhake/opentk

v0.1.2

Published

Token reduction plugin for coding agents - reduces LLM token consumption by 60-90%

Readme

opentk

Reduces LLM token consumption by 60–90% on common developer commands. Works with Claude Code, OpenCode, and any AI coding agent that supports shell hooks or plugins.

  • 60+ command patterns — git, cargo, pytest, vitest, tsc, eslint, terraform, kubectl, and more
  • 12 filtering strategies — stats extraction, error-only, grouping, deduplication, tree compression, etc.
  • Zero config — auto-configures Claude Code and OpenCode on install
  • Local-only tracking — all data stays on your machine, no telemetry

Install

npm install -g @tvonhake/opentk

On install, opentk automatically configures:

  • Claude Code — adds a PreToolUse hook to ~/.claude/settings.json
  • OpenCode — adds itself as a plugin to ~/.config/opencode/opencode.json (if present)

That's it. No manual config needed.

How It Works

Claude Code

opentk runs as a PreToolUse hook. When Claude runs a matched bash command, opentk rewrites it to pipe the output through a filter before Claude sees it:

git log --oneline -20
  → bash -c '... git log --oneline -20 | opentk-filter --strategy stats ...'
  • Original exit code is preserved
  • Falls back to unfiltered output if the filter fails
  • Only intercepts simple commands — anything with &&, ||, |, $(, or sudo passes through unchanged

OpenCode

opentk runs as a JS plugin using OpenCode's tool.execute.before / tool.execute.after hooks, which can mutate tool output directly.

Manual Setup

If you prefer to configure manually:

Claude Code — add to ~/.claude/settings.json:

{
  "hooks": {
    "PreToolUse": [
      {
        "matcher": "Bash",
        "hooks": [{ "type": "command", "command": "opentk-hook" }]
      }
    ]
  }
}

OpenCode — add to ~/.config/opencode/opencode.json:

{
  "plugin": ["@tvonhake/opentk"]
}

Supported Commands

Git

git status, git diff, git log, git show, git blame, git stash list, git reflog, git shortlog, git branch, git ls-files

GitHub CLI

gh pr list/status, gh issue list, gh run list/view, gh workflow list

Files & Search

ls, tree, find, fd, du, df -h, grep, rg, ag, cat, head, tail

JavaScript / TypeScript

npm run, pnpm, yarn, bun, npx, vitest, jest, mocha, tsc, eslint, prettier, biome

Python

pytest, ruff, pip install/list/freeze/show/check/audit, mypy, pylint, flake8, pyright

Rust

cargo test/build/check/clippy/audit/outdated/metadata/tree

Go

go test/build/vet, golangci-lint

Ruby

rspec, bundle exec rspec, bundle list

Java / JVM

mvn test/build, gradle test/build

Docker & Kubernetes

docker ps/images/logs/inspect, kubectl get/describe/logs/top, helm list/status

Cloud & Infrastructure

terraform plan/show/state, tofu plan/state, aws ... list/describe, gcloud ... list/describe, az ... list

System

ps aux

Viewing Token Savings

opentk                          # overall stats
opentk --timeRange today        # today only
opentk --timeRange week         # past week
opentk --groupBy command        # breakdown by command type
opentk --groupBy project        # breakdown by project
opentk --reset                  # clear all data

Configuration

Optional — opentk works with defaults out of the box.

OpenCode

Add an opentk key to your project's opencode.json:

{
  "opentk": {
    "enabled": true,
    "excludeCommands": [],
    "filterLevel": "aggressive",
    "trackingEnabled": true,
    "historyDays": 90
  }
}

Claude Code

Create a .opentk.json file in your project directory (or ~/.opentk.json globally):

{
  "enabled": true,
  "filterLevel": "aggressive",
  "excludeCommands": ["my-custom-tool"]
}

Config priority (highest wins): env vars → project .opentk.json → global ~/.opentk.json

| Env var | Values | Description | |---|---|---| | OPENTK_ENABLED | true / false | Enable or disable filtering | | OPENTK_FILTER_LEVEL | aggressive / minimal / none | Filter aggressiveness | | OPENTK_EXCLUDE_COMMANDS | comma-separated list | Commands to skip filtering |

Config options

| Key | Default | Description | |---|---|---| | enabled | true | Enable or disable opentk | | filterLevel | "aggressive" | "aggressive", "minimal", or "none" | | excludeCommands | [] | Commands to pass through unfiltered |

Privacy

  • No network calls
  • No telemetry or analytics
  • All tracking data stored locally in ~/.local/share/opentk/

License

MIT