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

rhachet-brains-anthropic

v0.4.1

Published

rhachet brain.atom and brain.repl adapter for anthropic

Readme

rhachet-brains-anthropic

rhachet brain.atom and brain.repl adapter for anthropic

install

npm install rhachet-brains-anthropic

usage

import { genBrainAtom, genBrainRepl } from 'rhachet-brains-anthropic';
import { z } from 'zod';

// create a brain atom for direct model inference
const brainAtom = genBrainAtom({ slug: 'claude/sonnet' });

// simple string output
const { output: explanation } = await brainAtom.ask({
  role: { briefs: [] },
  prompt: 'explain this code',
  schema: { output: z.string() },
});

// structured object output
const { output: { summary, issues } } = await brainAtom.ask({
  role: { briefs: [] },
  prompt: 'analyze this code',
  schema: { output: z.object({ summary: z.string(), issues: z.array(z.string()) }) },
});

// create a brain repl for agentic tasks
const brainRepl = genBrainRepl({ slug: 'claude/code' });

// use ask() for read-only operations
const { output: { analysis } } = await brainRepl.ask({
  role: { briefs: [] },
  prompt: 'analyze this codebase',
  schema: { output: z.object({ analysis: z.string() }) },
});

// use act() for read+write operations
const { output: { proposal } } = await brainRepl.act({
  role: { briefs: [] },
  prompt: 'refactor this module',
  schema: { output: z.object({ proposal: z.string() }) },
});

available brains

atoms (via genBrainAtom)

stateless inference without tool use. uses anthropic messages api with structured outputs.

| slug | model | cost ($/MTok) | cutoff | description | | --- | --- | --- | --- | --- | | claude/haiku | claude-haiku-4-5-20251001 | $1 / $5 | 2025-04 | fastest and most cost-effective | | claude/haiku/v3.5 | claude-3-5-haiku-20241022 | $0.80 / $4 | 2024-04 | fast and cost-effective | | claude/haiku/v4.5 | claude-haiku-4-5-20251001 | $1 / $5 | 2025-04 | fastest and most cost-effective | | claude/sonnet | claude-sonnet-4-5-20250929 | $3 / $15 | 2025-04 | balanced performance and capability | | claude/sonnet/v4 | claude-sonnet-4-20250514 | $3 / $15 | 2025-04 | balanced performance and capability | | claude/sonnet/v4.5 | claude-sonnet-4-5-20250929 | $3 / $15 | 2025-04 | balanced performance and capability | | claude/opus | claude-opus-4-5-20251101 | $5 / $25 | 2025-05 | most capable for complex reasoning | | claude/opus/v4 | claude-opus-4-20250514 | $15 / $75 | 2025-04 | highly capable for complex reasoning | | claude/opus/v4.5 | claude-opus-4-5-20251101 | $5 / $25 | 2025-05 | most capable for complex reasoning |

repls (via genBrainRepl)

agentic code assistant with tool use via claude-agent-sdk. repl slugs map to atom configs.

| slug | atom | cost ($/MTok) | cutoff | description | | --- | --- | --- | --- | --- | | claude/code | claude/sonnet | $3 / $15 | 2025-04 | balanced agentic capability | | claude/code/haiku | claude/haiku | $1 / $5 | 2025-04 | fast and cost-effective agent | | claude/code/haiku/v4.5 | claude/haiku/v4.5 | $1 / $5 | 2025-04 | fast and cost-effective agent | | claude/code/sonnet | claude/sonnet | $3 / $15 | 2025-04 | balanced agentic capability | | claude/code/sonnet/v4 | claude/sonnet/v4 | $3 / $15 | 2025-04 | balanced agentic capability | | claude/code/sonnet/v4.5 | claude/sonnet/v4.5 | $3 / $15 | 2025-04 | balanced agentic capability | | claude/code/opus | claude/opus | $5 / $25 | 2025-05 | most capable agent | | claude/code/opus/v4.5 | claude/opus/v4.5 | $5 / $25 | 2025-05 | most capable agent |

episode continuation

rhachet supports multi-turn conversations via episode continuation. each brain output includes an episode that can be passed back to continue the conversation.

atoms (supported)

atoms support episode continuation for cross-supplier workflows. prior exchanges are injected as actual user/assistant messages.

const brainAtom = genBrainAtom({ slug: 'claude/sonnet' });

// first turn
const resultFirst = await brainAtom.ask({
  role: {},
  prompt: 'remember this code: MANGO77',
  schema: { output: z.object({ content: z.string() }) },
});

// continue the conversation
const resultSecond = await brainAtom.ask({
  on: { episode: resultFirst.episode },
  role: {},
  prompt: 'what was the code i told you to remember?',
  schema: { output: z.object({ content: z.string() }) },
});
// resultSecond.output.content contains "MANGO77"

limitations:

  • haiku does not support continuation with structured outputs (will throw BadRequestError)
  • use sonnet or opus for continuation workflows

repls (not supported)

repls do not support episode continuation due to claude-agent-sdk limitations:

  1. session resumption doesn't work with structured outputs (returns plain text)
  2. cross-supplier continuation requires message injection which the sdk doesn't support
const brainRepl = genBrainRepl({ slug: 'claude/code' });

// this will throw BadRequestError
await brainRepl.ask({
  on: { episode: someEpisode }, // ❌ not supported
  role: {},
  prompt: 'continue...',
  schema: { output: z.object({ content: z.string() }) },
});

repls still export episode/series data for tracking and audit purposes. the episode.exid contains session info in the format anthropic/claude-agent-sdk/{machineHash}/{sessionId}.

summary

| brain | continuation | notes | | --- | --- | --- | | atom (sonnet, opus) | ✅ supported | use on: { episode } to continue | | atom (haiku) | ❌ not supported | throws BadRequestError | | repl (all) | ❌ not supported | throws BadRequestError |

for workflows requiring continuation, use genBrainAtom with sonnet or opus.

sources