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

enthropeek

v0.1.0

Published

Run Claude Code interactive mode, capture one response, and exit.

Readme

clawp

Run Claude Code in interactive mode, capture a single assistant response, exit, and print that response as normal CLI output.

clawp intentionally does not use claude -p. It starts claude "<prompt>" with a real pseudo-terminal, waits for Claude Code to write the completed assistant turn to its session transcript, sends /exit, and prints only the assistant text.

Why

Claude Code's official non-interactive mode is claude -p, but sometimes you want the behavior of interactive Claude Code while still using it from scripts. clawp keeps the interactive startup path and turns the final assistant response into clean stdout.

Requirements

  • Node.js 20+
  • Claude Code CLI installed as claude
  • expect available on PATH

On macOS, expect is usually available by default. On Debian/Ubuntu:

sudo apt-get install expect

Install

npm install -g enthropeek

Or run from this repo:

npm install
npm run build
node dist/cli.js "Reply with exactly OK."

For local development:

npm link
clawp "Reply with exactly OK."

Usage

clawp [claude flags...] "<prompt>"

Examples:

clawp "Reply with exactly OK."
clawp --model sonnet "Summarize this repository."
clawp --permission-mode dontAsk --model opus "Review the current directory."

All flags are passed directly to claude, except -p and --print, which are rejected because clawp is specifically for interactive mode.

Permissions

Claude Code's default permission mode can show an interactive approval picker for tool calls:

Do you want to proceed?
1. Yes
2. Yes, allow ...
3. No

clawp normally hides Claude Code's UI so stdout stays clean. That means a hidden approval picker would look like a hang. To avoid that, clawp exits with a clear error when it detects a permission prompt.

Use one of these patterns for tool-using prompts:

clawp --permission-mode dontAsk "Can you read ~/Documents?"

Returns a normal Claude response, but denied tools stay denied.

clawp --clawp-auto-approve "Can you read ~/Documents?"

Presses Enter when Claude shows a permission prompt, choosing Claude's default Yes option.

clawp --dangerously-skip-permissions "Can you read ~/Documents?"

Passes Claude Code's full bypass flag through. Use only in environments where that is acceptable.

Environment

CLAWP_DEBUG=1 clawp "Reply with exactly OK."

Mirrors Claude Code's raw interactive UI to stderr while still printing the captured response to stdout.

CLAWP_TIMEOUT_MS=120000 clawp "Do a bounded task."

Overrides the default 10 minute timeout.

CLAWP_AUTO_TRUST=0 clawp "Reply with exactly OK."

Disables automatic confirmation of Claude Code's workspace trust prompt. By default, clawp confirms that prompt so one-shot CLI usage can continue.

CLAWP_AUTO_APPROVE=1 clawp "Can you read ~/Documents?"

Environment-variable equivalent of --clawp-auto-approve.

How It Works

  1. Generates a Claude session id.
  2. Starts claude --session-id <id> ... "<prompt>" through expect, giving Claude Code a real pseudo-terminal.
  3. Polls Claude Code's transcript at ~/.claude/projects/.../<session-id>.jsonl.
  4. Waits for the completed assistant turn.
  5. Sends /exit.
  6. Prints the captured assistant text to stdout.

Development

npm install
npm run build
npm pack --dry-run

License

MIT