Sign In

sipcode

Package Overview
Dependencies
Maintainers
1
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sipcode

Sip your tokens. Don't gulp them. — Unified token optimization for AI coding agents.

Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
223
243.08%
Maintainers
1
Weekly downloads
 
Created
Source

Sipcode

Sip your tokens. Don't gulp them. Token optimization for Claude Code and other AI coding agents.

npm version License: MIT Status

An independent study of 38 Claude Code sessions found that only 0.6% of tokens were actual code output. The other 99.4% was exploration, re-reads, and repetition. — DEV Community, March 2026

Run this in any terminal — no install, no config, no signup:

npx sipcode why

You'll see exactly where your tokens went in your last Claude Code session: which files were re-read, which sat idle in context for hours, which tool calls cost the most. Sipcode runs entirely offline against the .jsonl transcripts Claude Code already writes to your machine.

What sipcode why actually shows

Real output from the session that built this very repo:

sipcode why · session 84bbf968 · 12h 15m · claude-opus-4-7
project: C--Projects-Sipcode

you burned 40,165,104 tokens. 369,465 were code output.
the other 39,795,639 were exploration, re-reads, and idle context.
output ratio: 0.9% of all tokens

if sipcode had been on, you could have saved ~1,229,837 tokens this session.
  · smart manifest (S001): 959,796 tokens
  · read-once cache (S030): 215,335 tokens
  · diff-output (S021):     54,706 tokens

top leaks (this session):
  1. idle context — 21,441,999 tokens (2 files held without re-reference)
  2. cache-creation overhead — 4,362,711 tokens (context written into cache)
  3. duplicate file reads — 215,335 tokens (1 files read more than once)

est. cost: $162.67 · 105 tool calls · 2 distinct files read

That's the demo. Run it yourself: npx sipcode why.

Generate a shareable receipt

npx sipcode receipt

Writes a standalone HTML file and a 1200×630 PNG to .sipcode/receipts/<id>/, prints a file:// link, copies the PNG to your system clipboard, and gives you a pre-filled tweet intent URL. Built for sharing — it's how Sipcode spreads.

The PNG ships with brand typography (Inter Tight + JetBrains Mono), a five-color palette, and zero external dependencies. Open it in your image viewer to see what gets shared.

Install (when you're ready to optimize, not just audit)

# Run once, save forever — no signup
npm install -g sipcode
sipcode init                        # interactive, three prompts max

sipcode init scans your repo with tree-sitter + git, infers conventions, and writes a .sipcode/manifest.md (under 2,000 tokens for a 500-file repo) plus a sipcode block in your CLAUDE.md. Your AI agent stops blindly exploring on every prompt.

Or non-interactive:

sipcode manifest --tighten          # regenerate manifest, drop low-signal sections
sipcode why --here                  # audit only sessions from this directory
sipcode receipt --html-only         # skip PNG, faster

What you get

FeatureWhat it doesShipped?
Privacy guaranteeLocal-first, zero-telemetry, asserted by a test that fails CI if a network module is ever imported in a core path. Full audit: PRIVACY.md.✅ v0.3.0
Cost framing"How much does this actually save you?" — specific dollar comparisons from the 62.6% median savings number.✅ v0.3.0
sipcode whyForensic audit of any past Claude Code session — no install required✅ v0.1.0-alpha
sipcode manifestStatic-analysis project map injected into CLAUDE.md — zero LLM calls✅ v0.1.0-alpha
sipcode receiptHTML + PNG receipt + system clipboard + tweet intent URL✅ v0.1.0-alpha
sipcode initInteractive setup (three prompts max) — runs manifest + injects CLAUDE.md✅ v0.1.0-alpha
sipcode rulesOutput Compression (S020) — diff edits + no-preamble rules in CLAUDE.md, three modes (default/strict/verbose)✅ v0.2.0
sipcode hygieneSession Hygiene (S030/S031/S032) — read-once rule pack in CLAUDE.md + PreToolUse pressure-band hook (50/70/90%) + PostToolUse smart-/compact breakpoint hook✅ v0.3.0
sipcode estimate "<task>"Predicts session cost per model (opus / sonnet / haiku) before you run — heuristic + historical anchors, zero LLM calls✅ v0.2.0
sipcode scoreStatic-analysis audit of any repo for "agent-friendliness" — 24 checks, 5 categories, shields.io badge, GitHub Action included✅ v0.2.0
Hardest Tasks BenchmarkCanonical 10-task waste-maximizing subset of the benchmark corpus (BT011-BT020). MIT, version-locked, available via sipcode benchmark --hardest. Run by any agent for cross-tool comparison.✅ v0.3.0
sipcode benchmarkReproducible benchmark suite (S110/S080) — median 62.6% savings, published methodology · 20-task corpus including the canonical Hardest Tasks subset (BT011-BT020) for industry citation✅ v0.3.0
Multi-agent (Cursor)sipcode init --agent cursor writes .cursor/rules/sipcode.mdc — same wedge, now in Cursor. Codex / Gemini / Aider planned.✅ v0.2.0 (cursor; rules + manifest only — transcript parsing is claude-code-only for now)

Honest claims, no inflated numbers

Other tools quote 65–90% savings by only counting output tokens — but output is 20–30% of your bill. Sipcode targets input (file reads, idle context, repetition), which is 70–80% of the spend.

Realistic stack savings (measured, not asserted): 62.6% median token reduction across a locked 20-task corpus. Range: 37.4% (pure docs) to 80.6% (codebase onboarding). The corpus is split into two clusters: 10 representative everyday Claude Code workflows (BT001-BT010) and 10 canonical Hardest Tasks (BT011-BT020) — categories specifically chosen to maximize token waste, with a 64.1% median for the subset. Reproducible — run it yourself:

npx sipcode benchmark            # full 20-task corpus
npx sipcode benchmark --hardest  # the 10-task Hardest Tasks subset (cross-tool citation set)

Methodology, corpus, and aggregation formula are published in benchmark/METHODOLOGY.md — including a section on how to challenge a number, and an invitation for other agents (Cursor, Codex, Aider) to publish their numbers against the same Hardest Tasks corpus. Per-module attribution from the latest run: S001 manifest 30.2% · S021 output compression 34.1% · S030 read-once cache 35.6%.

Source data for the claims above:

How much does this actually save you?

Anthropic's enterprise benchmark is $13/dev/active day on Claude Code. For a 5-person engineering team, that's ~$16,250/year in token spend.

At Sipcode's measured 62.6% median savings (over the full 20-task corpus; 64.1% on the Hardest Tasks subset), that team recovers ~$10,180/year without changing how they work. The $20/month Claude Pro plan (the one Anthropic removed Claude Code from) is now effectively a $5–7/month plan in token economy terms.

More specifically:

  • A typical solo dev burning $5/day on Opus (~80k tokens × $15/Mtok input + $75/Mtok output) saves ~$3/day → $1,000/year back in their pocket.
  • A 10-person team at the $13/day benchmark saves ~$30,000/year. Sipcode is MIT — that's $30,000/year for the cost of npm install.
  • The 0.6% study finding gets concrete here: of every $100 you spend on Claude Code, only 60¢ is actual code output. Sipcode targets the other $99.40.

Run npx sipcode benchmark to verify the 62.6% number against the locked 20-task corpus, or npx sipcode benchmark --hardest for the 64.1% number against the canonical Hardest Tasks subset. Run npx sipcode why against your own session to see what YOUR ratio is — and how much money your specific workflow is leaving on the table.

How Sipcode differs from neighbors

ToolSolvesMisses
Caveman (59k★)Output compression via promptingInput tokens, file reads, measurement
Graphify (47k★)Knowledge graph from code (LLM-extracted)Token cost to build the graph, staleness
ccusageMeasures total token spendDoesn't show where the spend went
RTKCLI output filteringDoesn't touch file reads or output
context-modeSandboxes large tool outputsDoesn't manage manifest or measure
SipcodeWhere it went, why it cost that much, how to save next time — in one offline CLI

Privacy

Sipcode is local-first, zero-telemetry by default. Nothing leaves your machine. No analytics, no signup, no account, no signed-in mode. The receipt PNG and HTML are generated locally and stay on disk until you share them yourself.

Not a promise — an asserted property. tests/privacy/no-network.test.ts statically scans every file under src/ and fails CI if any v1.0 core path ever imports a network module. Full audit, allowlist, and future-telemetry policy: PRIVACY.md.

Get the badge

run sipcode score --badge to emit a shields.io-compatible badge.json at .sipcode/badge.json. commit it (or upload as an artifact via the composite action), then pin:

![sipcode score](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/<your-org>/<your-repo>/main/.sipcode/badge.json)

Project status

v1.0.0 — all twelve features in the v1.0 scope shipped:

  • sipcode why — install-free Claude Code session auditor
  • sipcode manifest — static-analysis project map
  • sipcode receipt — HTML + 1200×630 PNG with clipboard + tweet intent
  • sipcode rules — Output Compression (S020/S021/S022), three modes
  • sipcode estimate "<task>" — cost predictor across models (S050), zero LLM calls
  • ✅ Multi-agent: Cursor (S043) — sipcode init --agent cursor writes .cursor/rules/sipcode.mdc. Rules + manifest cross-agent; transcript parsing for Cursor lands later.
  • sipcode stats — Analytics Dashboard (S040) — cross-session totals, daily-spend sparkline, top-N expensive sessions, per-project breakdown, optional standalone HTML at .sipcode/stats.html.
  • sipcode score — Sipcode Score (S060) — 24-check static audit of any repo for agent-friendliness across 5 categories (manifest, shape, naming, docs, predictability), tier badge, shields.io endpoint json, composite GitHub Action.
  • sipcode benchmark — Reproducible Benchmark Suite (S110) — 20-task locked corpus, median 62.6% savings, published methodology, --quick/--task/--html/--json/--list/--hardest.
  • ✅ Hardest Tasks Benchmark (S080) — canonical 10-task waste-maximizing subset (BT011-BT020): exploration, dependency-trace, api-discovery, test-failure-triage, config-archaeology, type-inference, rename-everything, dead-code, security-review, dependency-update. Median 64.1% savings. Available via sipcode benchmark --hardest. MIT, version-locked — the industry-citation set.
  • sipcode hygiene — Session Hygiene (S030/S031/S032) — read-once rule pack in CLAUDE.md + PreToolUse pressure-band hook (50/70/90%) + PostToolUse breakpoint hook (smart /compact suggestions after tests, commits, test-file writes). Honest limit: hooks warn, the model decides — no forced compaction.
  • ✅ Privacy guarantee (S090) — local-first, zero-telemetry, asserted by tests/privacy/no-network.test.ts. Fails CI if a network module is ever imported in a core path. Full audit: PRIVACY.md.
  • ✅ Cost framing (S100) — README's "How much does this actually save you?" turns the 62.6% number into a $1k/year solo / $10k/year team / $30k/year ten-person dollar comparison.

Active development. 787 tests passing. Solo dev, MIT, free forever.

See docs/ROADMAP.md for milestones. Star the repo, watch releases, open an issue if a specific optimization should be prioritized.

Session hygiene

sipcode hygiene --install does three things:

  • Writes a named sub-block to CLAUDE.md with read-once discipline rules (under 400 tokens — load-bearing in every prompt forever).
  • Generates a ~/.claude/hooks/sipcode-pressure.mjs and registers it as a PreToolUse hook in ~/.claude/settings.json. Before each tool call, it samples the latest transcript and emits one stderr line if utilization is past 50% / 70% / 90%.
  • Generates a ~/.claude/hooks/sipcode-breakpoint.mjs and registers it as a PostToolUse hook. After a successful npm test / pytest / git commit / test-file write, it suggests /compact on stderr.

Honest limit: hooks emit text on stderr. The model decides whether to act. We cannot force a compaction, intercept Read content, or guarantee any agent behavior. The rules + the warnings together are the discipline. --uninstall reverses everything; settings.json is byte-identical to its pre-install state modulo the sipcode entries themselves.

Built by

Anuj Ojha — also author of Answerable, the SEO optimization CLI for Next.js.

Sipcode exists because I burn through my Claude Code Max allocation in two hours. If you do too, this is for you.

License

MIT

Keywords

claude-code

FAQs

Package last updated on 20 May 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts