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

@martin-christensen/costra

v1.1.2

Published

Run multiple Claude Code and Codex CLI accounts side by side, each behind its own pxpipe proxy, with automatic port allocation.

Downloads

825

Readme

costra

Run multiple Claude Code and Codex accounts side by side — each behind its own pxpipe proxy to save costs, with automatic port allocation and isolated config directories.

npm version npm downloads Release CI node license: MIT

🎬 Demo

costra demo — registering accounts and launching Claude Code behind a pxpipe proxy

✨ Features

  • 🔀 Multiple accounts, zero collisions — every account gets its own isolated config directory, so logins never clash
  • 🔌 Stable, automatic port allocation — ports are assigned once from a configurable range and persisted per account
  • 💸 Cost savings via pxpipe — each account runs behind its own pxpipe proxy; open its dashboard in the browser any time
  • 🤖 Anthropic & OpenAI support — works with both Claude Code (claude) and Codex (codex)
  • 🪶 Lightweight — plain Node.js, no runtime dependencies, script-friendly

📦 Install

npm install -g @martin-christensen/costra

Requires Node 20+ and the CLI you want to run (claude and/or codex) on your PATH.

🚀 Quick start

# Register accounts (stored in ~/.costra.json)
costra add work --provider anthropic --model claude-fable-5
costra add personal --provider anthropic
costra add oai --provider openai

# Launch — starts a pxpipe proxy in the background if needed (printing its
# URL), then launches the CLI
costra work
costra oai

# Open an account's pxpipe URL in the default browser
costra proxy open work

# Skip the pxpipe proxy entirely
costra work --no-proxy

# Pass extra arguments to the underlying CLI after --
costra work -- --resume

⚙️ How it works

For each account, costra:

  1. Assigns a stable port from a configurable range (default 47800–47899), persisted in the account's config directory, skipping ports assigned to other accounts.
  2. Ensures a pxpipe proxy is listening on that port (spawned detached, logs to pxpipe.log in the account's config dir) and prints its URL — open it in your browser any time with costra proxy open <account>.
  3. Launches the provider's CLI with the right environment:

| Provider | CLI | Base URL env | Config dir env | Default config dir | | ----------- | -------- | -------------------- | ------------------- | ------------------------- | | anthropic | claude | ANTHROPIC_BASE_URL | CLAUDE_CONFIG_DIR | ~/.config-claude-<name> | | openai | codex | OPENAI_BASE_URL | CODEX_HOME | ~/.config-codex-<name> |

Because each account gets its own config directory, logins never collide — run as many accounts simultaneously as you like.

🧰 Commands

costra <account> [--no-proxy] [-- <cli args...>]
                                      Start proxy (if needed) and launch the CLI
costra add <account> [options]        Register an account
costra remove <account>               Unregister an account (config dir is kept)
costra list                           List configured accounts
costra status                         Show ports and proxy state per account
costra stop <account>                 Stop the account's background proxy
costra proxy <account>                Run the proxy in the foreground (debugging)
costra proxy open <account>           Open the account's pxpipe URL in the browser
costra version                        Show version and check npm for a newer one

costra --version / -v prints the bare version with no network access (script-friendly).

Launch options

| Option | Description | | ------------ | ----------------------------------------------- | | --no-proxy | Launch the CLI directly, without a pxpipe proxy |

add options

| Option | Description | | --------------------- | -------------------------------------------------- | | --provider <p> | anthropic (default) or openai | | --model <m> | Passed to the CLI as --model <m> | | --cli <binary> | Override the CLI binary | | --config-dir <path> | Override the account's config directory |

Update checks

Costra checks npm for a newer version at most once a day. The check runs in a detached background process, so commands are never delayed — when an update is found, a one-line notice is printed to stderr on the next run:

costra: update available 1.0.0 → 1.1.0 — run: npm install -g @martin-christensen/costra

The result is cached in ~/.costra-update.json (override with the COSTRA_UPDATE_CACHE env var). Set COSTRA_NO_UPDATE_CHECK=1 to disable update checks entirely.

🔧 Configuration

~/.costra.json (override the location with the COSTRA_CONFIG env var):

{
  "portRange": [47800, 47899],
  "accounts": {
    "work": { "provider": "anthropic", "model": "claude-fable-5" },
    "oai": { "provider": "openai" }
  }
}

🤝 Contributing

Contributions are welcome! Feel free to:

  • 🐛 Open an issue for bugs or feature requests
  • 🔀 Submit a pull request — run npm test before pushing
  • 💡 Share ideas for new providers or workflows

🙏 Acknowledgments

costra stands on the shoulders of some great tools:

  • Anthropic — for Claude Code, the agentic coding CLI this tool was born to multiplex
  • OpenAI — for Codex, the second CLI citizen of costra
  • pxpipe — for the proxy layer that makes the cost savings and traffic insight possible

📄 License

MIT © Martin Christensen