What it is
Why it exists
What's good about it
- No dependencies at all, and it runs anywhere: Node, Deno, Bun, edge runtimes
- You set priorities, and it keeps the important things first
- Bring your own tokeniser, or use the built-in approximation
- It keeps paired items together, so a tool_use and its tool_result always travel as one
- Whatever survives comes back in the original order
Ts
The little family around it
- snug-tiktoken, wired up with accurate OpenAI and Anthropic token counting
- snug-openai, which takes OpenAI SDK message arrays directly
- snug-anthropic, which handles Anthropic messages and keeps tool calls paired up



