SuperAPI AI Directory

sipcode

Context hygiene for Claude Code. Caps verbose tool output and dedupes same-session re-reads so the model sees signal, no…

Open website

About this tool

Purpose

Sipcode is a free command-line tool that sits between the user and Claude Code to keep Claude Code's context window clean, resulting in more accurate answers and lower usage costs. It can also read OpenAI Codex CLI session logs to provide usage analysis.

Main Capabilities

  • Monitors Claude Code's context window and warns when the context starts to bloat (known as context rot).
  • Intercepts repeated file reads and other waste before they reach Claude, reducing the paid cost of identical answers.
  • Provides measurable savings data, displayed in the terminal.
  • Includes drift detection, re-read deduplication, integrity scoring, AST-aware reading, and 15 MCP tools.
  • Open source, under the MIT license, with zero network calls during normal use, and data never leaves the local machine.
  • Complements memory tools that persist context across sessions. Sipcode keeps each individual session tidy.

How to Use

Installation

Requires Node.js 20 or higher. Supports Mac, Linux, and Windows.

  1. If Node.js is not yet installed: on Mac you can use brew install node; on Linux you can choose the LTS version, Linux, and nvm from nodejs.org/en/download and run the commands as prompted; on Windows you can download it from nodejs.org.
  2. Install Sipcode globally:
npm i -g sipcode

After installation, the next Claude Code session will automatically use Sipcode.

Common Commands

  • sipcode drift: Checks whether the current Claude Code session deviates from normal usage patterns, flagging context bloat, repeated reads, and stale signals. By default it checks the most recent session (covering both Claude Code and Codex). You can use --session <id> to specify a session,--here to limit to sessions in the current folder,--agent claude-code or --agent codex to choose the tool.
  • sipcode proxy --stats: Displays what Sipcode intercepted in the current session, categorized by rewriter.
  • sipcode benchmark: Runs a locked 20-task corpus to produce reproducible savings numbers. The corpus is scripted transcript pairs (Claude Code sessions with and without Sipcode), showing what Sipcode's mechanisms remove from simulated sessions, rather than live session records.
  • sipcode today: Daily spending summary, including the number of tokens used, number of sessions, output ratio, and comparison with the 30-day median.
  • sipcode forecast: End-of-month spending forecast based on the most recent 14 days.

Updates

Because of zero network calls, Sipcode will not prompt for updates. It is recommended to run sipcode update or npm i -g sipcode@latest weekly to get the latest fixes.

Codex Support

Sipcode can read OpenAI Codex CLI session logs (~/.codex/sessions and ~/.codex/archived_sessions, or the folder pointed to by CODEX_HOME ). For Codex, it provides spending analysis and usage limit reports, but does not change Codex's behavior. Related commands include stats、today、forecast、trend、impact、why、receipt、drift、regress、limits, as well as the session tools in the MCP server (the optional agent input is "claude-code" or "codex") and get_codex_limits。

  • --agent codex to show only Codex,--agent claude-code to show only Claude Code.
  • When --agent is not specified and both tools are installed,stats、today、forecast、trend and impact will print one section for each tool and end with a single combined line.
  • --here also applies to Codex, matching the working folder of each session recorded by Codex.
  • --json covers one tool per call; if not specified, --agent It covers Claude Code and prints a hint to stderr when Codex logs are present.

Codex token counting

Sipcode reads Codex's per-request usage records, or the change in the running total after each request in older Codex logs. Cached input is counted toward Codex's input count, so Sipcode does not double-charge cached tokens. Requests copied into resumed or forked session files are counted only once.

Pricing

Codex model pricing comes from OpenAI's API price list (as of 2026-10-09), including long-context rates above 272,000 input tokens. Models with unknown pricing are shown as unpriced; their tokens are still counted, a note below the cost states how many were excluded, and they are never shown as $0.

Codex limits

Codex writes plan usage limit readings to its own logs after each request.sipcode limits reads this data, makes zero network calls, and answers three questions: when the limit will be reached, what consumed the limit, and whether the limit is shrinking. It supports 5-hour, weekly, and 30-day windows, showing percentage used, reset time, and when it will run out at the current rate. It also shows the top 5 sessions and projects of the current period (folder names only), plus Codex's automatic review. Options include --json、--since <window>(default 90d),--here(shrinks only the "what used it" list).

MCP

get_codex_limits(optional argument since) returns the same JSON as sipcode limits --json .

Regression detection

sipcode regress checks the user's own Claude Code and Codex logs for regressions introduced with updates, and points out the version that introduced each regression. Each version is compared with the user's other versions, with no external baseline needed, and data never leaves the machine.--bug-report adds a block that can be pasted into a GitHub issue (only token counts, versions, dates, and short session IDs); check it before posting.--json for scripts,--agent claude-code or --agent codex to choose the tool,--min-n <n> to set the minimum number of requests required for each version check (default 20).

Using Sipcode inside Codex

The Sipcode plugin allows asking about your own usage in natural language in the ChatGPT desktop app or Codex CLI. Every answer comes from the sipcode command on the local machine, reading local logs.

  1. Install Sipcode first (Node.js 20 or higher). The plugin uses the installed sipcode, not npx, because Codex's sandbox usually blocks downloads.
  2. Add the plugin:
    • If using Codex only in the ChatGPT desktop app: run npx -y @openai/codex plugin marketplace add Anuj7411/sipcode and npx -y @openai/codex plugin add sipcode@sipcodein the terminal, then fully quit and reopen the ChatGPT desktop app, confirm in Plugins that Sipcode is present and installed, and start a new chat.
    • If you have Codex CLI: run codex plugin marketplace add Anuj7411/sipcode, then run codex plugin add sipcode@sipcode, or open /plugins to select the sipcode marketplace and install. Start a new Codex session.
    • If Codex's sandbox blocks ~/.codex or ~/.claude, the plugin will request to run the command with read permissions.
    • Amounts are shown at API pricing; on a ChatGPT plan you are not charged per token.
    • The plugin is instructions only (four skills): no hooks, no MCP server, no network calls.
    • To update the plugin: run npx -y @openai/codex plugin marketplace upgrade sipcode(or codex plugin marketplace upgrade sipcode), then restart the desktop app. To update the sipcode command itself:npm i -g sipcode@latest。

Use cases

  • Use Claude Code for long sessions, where the context rapidly inflates, costs rise, and answer quality declines.
  • Need to distinguish redundant from effective signals in the context.
  • Need to quantify savings, monitor daily spending, and forecast monthly spending.
  • Use the OpenAI Codex CLI and want to analyze usage, track limits, and detect version regressions.

Limitations

  • Unsupported Codex features: writing rules to AGENTS.md (rules and init rules step), registering MCP servers, proxies, and hooks in Codex (proxy、hygiene)、estimate and benchmark。rules --agent codex and estimate --agent codex will stop with error E009. Compressed Codex logs (.jsonl.zst) are skipped and the count is noted.
  • Claude Code logs do not record limits, so limits --agent claude-code stops with error E009.
  • Subagents and Agent SDK requests are excluded because their caching policies differ.
  • If the logs cannot be read, it prints "Nothing to analyse ... This is NOT a clean result." and exits with code 2; when there is too little data, it prompts "Not enough data to compare versions yet".
  • 62.6% is the median reduction on a locked 20-task corpus, which is a scripted set of transcription pairs showing what the Sipcode mechanism removes from simulated sessions; actual savings depend on the user's workload.