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

harnessleaks

v0.1.1

Published

Gitleaks-inspired secret scanner for AI agent and harness transcripts

Readme

HarnessLeaks

A small, dependency-free, Gitleaks-inspired secret scanner for AI-agent and harness transcripts.

It is designed for transcript formats such as JSON, JSONL/NDJSON, logs, Markdown, text, traces, YAML, and session dumps. Like ccusage does for token usage, HarnessLeaks auto-locates the local session files of popular harnesses so you can scan them by name.

Usage

npx harnessleaks                        # show help
npx harnessleaks codex                  # scan Codex CLI transcripts (auto-located)
npx harnessleaks claude-code cursor     # scan several harnesses at once
npx harnessleaks list                   # list supported harnesses
npx harnessleaks --known                # scan every known harness location
npx harnessleaks .                      # scan the current directory
npx harnessleaks ./transcripts          # scan a directory
npx harnessleaks ~/.my-agent/sessions
npx harnessleaks transcript.jsonl --json
cat transcript.jsonl | npx harnessleaks -

A bare harness name resolves to that harness's known transcript locations, so harnessleaks codex finds and scans every Codex session on the machine. Only transcript paths are scanned — never the harness's source code, caches, or SQLite state. While scanning, a spinner reports progress on stderr.

Secrets are shown by default so you can triage them. Pass --redact (-r) to mask them — recommended whenever output may be logged or shared, including CI.

Findings are grouped by secret: the same credential repeated across many sessions is shown once with an occurrence count and up to three locations. Use --all-occurrences to list every match individually.

Human output is a boxed report with a summary header and one panel per lead (severity, full secret, fingerprint/entropy, and source locations), colorized on a TTY. Long secrets wrap across lines so nothing is cut off. The scan always exits 0.

Supported harnesses

HarnessLeaks recognizes the on-disk transcript locations of the most widely used AI coding agents and labels every finding with the harness it came from. Detection is path-based, so it keeps working when a harness changes its internal schema.

Claude Code, OpenAI Codex CLI, GitHub Copilot, Cursor, Windsurf, Cline, Roo Code, Kilo Code, Continue, Aider, Gemini CLI, Qwen Code, OpenCode, Goose, Amazon Q Developer, Zed, Void, Sourcegraph Cody, Crush, Factory Droid, Amp, Kiro, and Trae.

Run harnessleaks --list-harnesses for the full list and their default locations. SQLite-backed harnesses (for example Cursor's state.vscdb) are scanned by recovering printable strings from the binary, so secrets stored in the database are still caught.

What it detects

The initial rules cover common AWS, GitHub, GitLab, npm, PyPI, Slack, Stripe, Google, OpenAI-style, Anthropic, Hugging Face, JWT, bearer-token, private-key, connection-string, and generic credential-assignment patterns.

The detection model borrows the useful architecture of Gitleaks: provider-specific regex rules, keyword prefilters, a secret capture group, Shannon entropy thresholds, and allowlisting. The JavaScript rules are implemented independently rather than copied verbatim because Gitleaks uses Go/RE2-style regular expressions while this package uses JavaScript RegExp.

CLI

--json, -j [path]   JSON report (stdout, or write to a file/directory)
--csv, -c [path]    CSV report (stdout, or write to a file/directory)
--redact, -r        Mask secrets in the report (recommended for CI/logs)
--all-files         Scan every file
--harness <id>      Force a harness label (and scan its locations if no paths)
--known, --all      Scan the default locations of every known harness
--list-harnesses    List supported harnesses and exit
--max-size MB       Per-file size limit (default 50 MB)
--no-progress       Disable the scanning spinner
--all-occurrences   List every match instead of unique secrets
--verbose           Show skipped files and other diagnostics

The scan always exits 0 whether or not leads are found.

Saving reports

-j and -c write to stdout by default, or to an optional path. The path can be a directory (default filename harnessleaks-report.<ext>) or a file; the extension is corrected to match the format. A path is only consumed as the output target when it starts with ~, ends with /, or ends in .json/.csv — so -j ./transcripts still scans.

harnessleaks codex -j                    # JSON to stdout
harnessleaks codex -c                    # CSV to stdout
harnessleaks codex -j ~/Desktop          # ~/Desktop/harnessleaks-report.json
harnessleaks codex -c ~/Desktop/scan.txt # ~/Desktop/scan.csv
harnessleaks codex -j report.json        # ./report.json

Local development

npm test
node bin/harnessleaks.js ./transcripts

Publishing

The package is ready to publish (files whitelist, bin, LICENSE, and a prepublishOnly test hook are configured). The name harnessleaks was available on npm at the time of writing.

npm login
npm publish          # access: public is set in publishConfig

Then verify:

npx harnessleaks --version
npx harnessleaks --help

To publish a new version later:

npm version patch    # or minor / major
npm publish