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

@grackle-ai/runtime-claude-code

v0.118.0

Published

Grackle Claude Code runtime implementation

Readme

@grackle-ai/runtime-claude-code

Grackle runtime that drives Anthropic's Claude Code agent via the Claude Agent SDK.

Overview

This package implements the @grackle-ai/runtime-sdk AgentRuntime interface for Claude Code. It exports ClaudeCodeRuntime, which extends BaseAgentRuntime and is registered with the PowerLine process under the runtime name claude-code. When a session is spawned, the runtime drives a Claude Code conversation through the @anthropic-ai/claude-agent-sdk query() API, maps the SDK's streaming messages onto Grackle AgentEvents (text, tool use, tool results, system, errors, usage), and reports token/cost usage back to the server.

The Claude Agent SDK is not a direct dependency. It is installed lazily at spawn time into an isolated per-runtime directory and imported dynamically (falling back to the legacy @anthropic-ai/claude-code package if present), so the package stays lightweight until a Claude Code session actually runs.

Models

The model is chosen per session — Grackle passes the model selected for the task (via the spawn request) straight through to the SDK as the model option. This package does not hardcode or restrict the model list; any model the installed Claude Agent SDK accepts can be used.

Credentials

The runtime authenticates using whatever credentials the Claude Agent SDK finds in its environment. Either path works:

| Credential | How it's provided | Notes | |------------|-------------------|-------| | Anthropic API key | ANTHROPIC_API_KEY environment variable | Console / pay-per-use access | | Claude subscription | ~/.claude/.credentials.json (OAuth file) | Generated by signing in with the Claude Code CLI |

Grackle delivers the credential to the PowerLine at task start, so nothing needs to be baked into the environment ahead of time. If ~/.claude is read-only (common with bind-mounted host config in Docker), the runtime redirects session storage to a writable fallback directory and copies the credential/settings files so multi-turn conversations can still resume.

Behavior

  • Persistent process mode — keeps a single query() alive across turns using the SDK's async-iterable prompt mode, falling back to resume-per-input when persistence is unavailable.
  • Tools — enables Claude Code's built-in tools (Bash, Read, Write, Edit, Glob, Grep, WebSearch, WebFetch, Task, Agent, NotebookEdit) and any MCP servers configured for the session, including the injected Grackle MCP server.
  • Usage tracking — converts the SDK's cumulative token and cost totals into per-turn deltas before reporting them.
  • System context — injected via the SDK-native systemPrompt (appended to Claude Code's built-in prompt), and caller-supplied hooks (e.g. Stop hooks) are passed through unchanged.

Requirements

  • Node.js >= 22
  • @anthropic-ai/claude-agent-sdk (installed automatically at spawn time)
  • An Anthropic API key (ANTHROPIC_API_KEY) or Claude subscription credentials (~/.claude/.credentials.json)

License

MIT