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

@ruvnet/open-claude-code

v2.1.0

Published

Open source Claude Code CLI — based on ruDevolution decompilation of v2.1.91

Downloads

657

Readme

open-claude-code v2 — Technical Guide

Quick Start

export ANTHROPIC_API_KEY=sk-ant-...
node src/index.mjs "hello"          # one-shot
node src/index.mjs                   # interactive REPL
node src/index.mjs -m claude-opus-4-6 -p "explain this"  # print mode

Architecture

v2/src/
├── core/                    # Core engine
│   ├── agent-loop.mjs       # Async generator (13 event types, recursive)
│   ├── streaming.mjs        # SSE handler (all event types)
│   ├── context-manager.mjs  # Token tracking + compaction
│   ├── system-prompt.mjs    # CLAUDE.md loading + cache boundary
│   ├── session.mjs          # Save/resume/teleport
│   ├── checkpoints.mjs      # File checkpointing + undo
│   ├── cache.mjs            # Prompt caching
│   ├── rate-limiter.mjs     # 429/529 handling + backoff
│   ├── providers.mjs        # 5 AI providers
│   └── scheduler.mjs        # Cron task scheduling
├── tools/                   # 25 tools
│   ├── registry.mjs         # validateInput/call interface
│   ├── bash.mjs             # Shell (sandboxed, timeout, background)
│   ├── read.mjs             # File read (PDF, binary detect, line nums)
│   ├── edit.mjs             # Edit (replace_all, uniqueness check)
│   ├── write.mjs            # Write (mkdir, overwrite protection)
│   ├── glob.mjs             # Glob (proper matching, mtime sort)
│   ├── grep.mjs             # Grep (-i/-n/-A/-B/-C, ripgrep)
│   ├── agent.mjs            # Subagent (worktree, background, model)
│   ├── web-fetch.mjs        # URL fetch
│   ├── web-search.mjs       # Web search
│   ├── todo-write.mjs       # Task management
│   ├── notebook-edit.mjs    # Jupyter notebooks
│   ├── multi-edit.mjs       # Atomic multi-file edits
│   ├── ls.mjs               # Directory listing
│   ├── tool-search.mjs      # Deferred tool discovery
│   ├── ask-user.mjs         # User prompts
│   ├── skill.mjs            # Skill invocation
│   ├── send-message.mjs     # Agent team messaging
│   ├── cron-create.mjs      # Scheduled tasks
│   ├── cron-delete.mjs
│   ├── cron-list.mjs
│   ├── enter-worktree.mjs   # Git worktree
│   ├── exit-worktree.mjs
│   ├── remote-trigger.mjs   # Remote execution
│   ├── lsp.mjs              # Language server
│   └── read-mcp-resource.mjs
├── mcp/                     # MCP protocol
│   ├── client.mjs           # JSON-RPC client
│   ├── transport-sse.mjs    # SSE transport
│   ├── transport-shttp.mjs  # Streamable HTTP
│   └── transport-ws.mjs     # WebSocket
├── permissions/              # Security
│   ├── checker.mjs          # 6 modes + interactive prompts
│   ├── sandbox.mjs          # bubblewrap/seatbelt
│   ├── injection-check.mjs  # Command injection detection
│   ├── path-check.mjs       # File path validation
│   └── prompt.mjs           # Permission prompting
├── hooks/
│   └── engine.mjs           # PreToolUse/PostToolUse/Stop/Notification
├── agents/
│   ├── loader.mjs           # Agent definition loader
│   ├── parser.mjs           # JSON/MD frontmatter parser
│   └── teams.mjs            # Multi-agent teams
├── skills/
│   ├── loader.mjs           # Skill discovery
│   └── runner.mjs           # Skill execution
├── plugins/
│   └── loader.mjs           # Plugin discovery + git clone
├── auth/
│   └── oauth.mjs            # PKCE OAuth flow
├── config/
│   ├── settings.mjs         # 4-source deep merge
│   ├── cli-args.mjs         # All CLI flags
│   └── env.mjs              # 104 env vars
├── ui/
│   ├── repl.mjs             # Interactive REPL
│   ├── ink-app.mjs          # Rich terminal output
│   └── commands.mjs         # 40 slash commands
├── telemetry/
│   └── index.mjs            # Telemetry stub
└── index.mjs                # Entry point

test/
└── test.mjs                 # 1,581 tests

Stats

| Metric | Value | |--------|:-----:| | Source files | 61 | | Lines of code | 8,314 | | Tests | 1,581 (0 failures) | | Tools | 25 | | Slash commands | 40 | | MCP transports | 4 | | AI providers | 5 | | Env vars | 104 | | Permission modes | 6 |

Tests

node test/test.mjs
# Tests: 1581 total, 1581 passed, 0 failed