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

is-agent-output

v0.3.0

Published

From inside a process, reports whether stdout is going unmediated to an AI agent harness.

Readme

is-agent-output

From inside a process, reports whether stdout is going unmediated to an AI agent harness.

Install

npm install is-agent-output

Usage

import { detectAgentOutput } from "is-agent-output";

const detection = detectAgentOutput();

if (detection.isAgentOutput) {
	// stdout is the harness capture; transform is safe
}
interface Detection {
	readonly isAgentOutput: boolean;
	readonly consumer?: { readonly pid: number; readonly name: string; readonly label?: string };
	readonly reason: string;
}

isAgentOutput is true when both hold:

  1. the first non-relay ancestor matches a known harness, or a pattern you passed in
  2. no pipe or redirect sits between this process and the harness, only known relays, which pass output straight through

Following these rules ensures any other consumers, such as piping or file writes, are not taken as agent output. It defaults to false in unclear or mixed scenarios.

One exception to that default. When your output goes to a terminal on Windows, nothing tells the package which terminal it is, so it reads the surrounding commands instead. A redirect written in a form it does not recognise answers true there.

Harnesses

A harness is in the table when the command's output reaches a model, and reaches nothing that a change in the output would break.

| Harness | Harness | Harness | | ----------------- | ------------------ | ---------------- | | Aider ¹ | Every Code | Mistral Vibe | | Amp | Factory Droid | Nanocoder | | Auggie | Forge | oh-my-pi | | Claude Code | Freebuff | opencode | | Claude Desktop | Gemini CLI | opencode desktop | | Cline | GitHub Copilot CLI | Open Interpreter | | Codex | goose | OpenHands | | Codex desktop app | goose desktop | Pi | | CodeWhale | gptme | Qoder | | Continue | Grok CLI | Qwen Code | | Crush | Kilo Code | Reasonix | | Cursor CLI | Kimchi | Reasonix desktop | | DeepSeek dsh | Kimi CLI | senpi | | Docker Agent | Letta Code | SWE-agent ² | | Docker Desktop | mini-swe-agent | Warp |

¹ Aider is recognised where its own installer puts it. Some Python installations put it somewhere the package cannot recognise, and it answers false there.

² SWE-agent is recognised when it runs your command on the same machine. Its default mode runs commands inside a container, where nothing identifies SWE-agent as the caller.

Agents running inside an editor are not covered: Cline, Continue, Copilot and Gemini Code Assist in VS Code, and the Cursor, Zed, Windsurf, Trae, Kiro, Devin and Junie agents. The editor launches everything you run in it, your linters and formatters included, so nothing tells a command its agent ran from one an extension ran.

Relays

The walk skips relays and takes the first ancestor that is not one as the consumer.

| passes output through | recognised as | | --------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | | shells | bash, sh, dash, zsh, ash, ksh, mksh, fish, elvish, cmd, powershell, pwsh | | launchers | env, nice, nohup, timeout, stdbuf, chroot, ionice, chrt, taskset | | sandbox wrappers | bwrap, apply-seccomp, sandbox-exec, and the wrappers Claude Code, Cursor, Gemini CLI, Codex, and VS Code ship | | package runners | npm run, npx, pnpm, yarn, node --run, bun run, deno task, uv, uvx, pipx, poetry, pdm, cargo, go, dotnet, tsx, ts-node, direnv |

Extra harnesses and relays

detectAgentOutput({
	agents: [{ label: "my-harness", name: /my-harness/, commandLine: /optional/ }],
	relays: [{ name: /my-runner/, commandLine: /optional/, attests: false }],
});

License

MIT