Anthropic Tokenizer TypeScript — AI skill for Claude Code
NPM version.
How to install Anthropic Tokenizer TypeScript
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open anthropics/anthropic-tokenizer-typescript and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
What Anthropic Tokenizer TypeScript does
NPM version.
Alternatives in AI
- Openskills — Universal skills loader for AI coding agents - npm i -g openskills 9.8k ★
- Open Multi Agent — TypeScript multi-agent orchestration engine — one runTeam() call from goal to result 5.8k ★
- Anthropic SDK TypeScript — Access to Anthropic's safety-first language model APIs in TypeScript 2.1k ★
README
Anthropic TypeScript Tokenizer
[](https://npmjs.org/package/@anthropic-ai/tokenizer)
⚠️ This package can be used to count tokens for Anthropic's older models. As of the Claude 3 models, this algorithm is no longer accurate, but can be used as a very rough approximation. We suggest that you rely on `usage` in the response body wherever possible.
Installation
npm install --save @anthropic-ai/tokenizer
# or
yarn add @anthropic-ai/tokenizer
Usage
import { countTokens } from '@anthropic-ai/tokenizer';
function main() {
const text = 'hello world!';
const tokens = countTokens(text);
console.log(`'${text}' is ${tokens} tokens`);
}
main();
Status
This package is in beta. Its internals and interfaces are not stable and subject to change without a major semver bump; please reach out if you rely on any undocumented behavior.
We are keen for your feedback; please email us at [support@anthropic.com](mailto:support@anthropic.com) or open an issue with questions, bugs, or suggestions.
Requirements
The following runtimes are supported:
- Node.js version 12 or higher.
- Deno v1.28.0 or higher (experimental).
Use
import { countTokens } from "npm:@anthropic-ai/tokenizer".
If you are interested in other runtime environments, please open or upvote an issue on GitHub.
Related Skills
Claude Code 2.1.88
Source code of @anthropic-ai/claude-code v2.1.88, extracted from the npm package's source map (cli.js.map). 1,
Agent Fix
Universal repair skill & CLI for AI coding agents (Claude Code, Codex, OpenCode, Hermes) — npm postinstall, GU
Agent Primary TS Starters
Agent-primary TypeScript + npm skills. Defaults tuned for LLM-agent machine-verifiability and machine-explorab
Claude Code Prompts
System prompts and tool definitions from each version of @anthropic-ai/claude-code
Claude Code V2.1.88 — 源码分析
免责声明: 本仓库中所有源码版权归 Anthropic 和 Claude 所有。本仓库仅用于技术研究和科研爱好者交流学习参考,严禁任何个人、机构及组织将其用于商业用途、盈利性活动、非法用途及其他未经授权的场景。 若内容涉
Engram
The context spine that 10x's every AI coding session. Live in 8 IDEs (Claude Code, Cursor, Cline, Continue, Ai
Related Agents
npm Release Engineer
Automated NPM release and package publishing protocol for @onlytests/eitr. Enforces pre-release quality checks
Dependency Vetter
Supply-chain security audit of a third-party package (npm today) at ONE exact resolved version, run BEFORE it
Nodejs Expert
Use this agent for Node.js ES module patterns, TypeScript configuration and build tooling, monorepo NPM packag