Introducing The Sweep: OX’s New Live Security Research Series
Register Now
Breaking: The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Read the Report
Are you exposed? Connect your apps in minutes.
Scan your apps free

pi-claude-relay

Latest version: v0.3.0

Overview

Last scanned
23 Nov 2026
Published
23 Nov 2026
npm package Publisher: jals1212
0 Stars
0 Forks
10 Versions
993 Downloads
TypeScript Repo language

Scan summary

pi-claude-relay was last scanned on 23 Nov 2026 at version 0.3.0. Risk score 0 of 100. No malicious behavior was detected.

  • Releases: 10 versions; the latest 5 were published within 2 days (22 and 23 Nov 2026).
  • Findings: No rules fired in version 0.3.0.
  • Downloads: 993 downloads.

Versions

10 versions published
Versions and the rules that fired in each
VersionPublishedStatus
0.3.0 LATEST 23 Nov 2026 No rules fired
0.2.1 23 Nov 2026 No rules fired
0.2.0 23 Nov 2026 No rules fired
0.1.5 23 Nov 2026 Not shown
0.1.4 22 Nov 2026 Not shown

No rules fired in 0.3.0

Findings

Findings for v0.3.0. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.

The score describes 0.3.0; other versions have their own rules, not their own score.

README

The publisher’s own README, as collected from the registry.

⎍ pi-claude-relay

A Pi (@earendil-works/pi-coding-agent) extension that relays Pi's built-in anthropic provider through the official Claude Code CLI (claude -p, stream-json). Every model request is made by the claude binary itself, with the Anthropic login of the Pi space it runs in; Pi's tools are served to Claude over a private, per-session local MCP server.

You keep choosing models exactly as before: claude-opus-5-5, anthropic/claude-sonnet-5-5, no relay prefix.

Why

Pi's direct OAuth path to Anthropic can fail intermittently with:

Error: 429 {"type":"error","error":{"type":"rate_limit_error","message":"Error"}, ...}

while claude -p on the same account keeps working. The relay routes Pi's Anthropic traffic through the official client instead of imitating it: it never copies Claude Code headers or identity into Pi's own HTTP calls.

Account notice. With a subscription login, the relay hands the Pi space's Anthropic OAuth token to the claude CLI so that a third-party harness (Pi) drives it. Anthropic's terms may restrict using a Claude subscription outside Claude Code and Claude.ai. Read them and decide for yourself; an API-key login is not affected.

Requirements

  • Node.js 22.18 or later.
  • Pi (@earendil-works/pi-coding-agent).
  • The claude CLI (Claude Code 2.1.330 or later) on PATH. You do not need to log in to it: the relay never uses ~/.claude or its login.
  • Each Pi space signed in to Anthropic with its own login (/login → Anthropic in that space). That login is the credential claude uses, so every space can use a different account. A space without an Anthropic login fails with a message telling you to run /login.

No environment variables are needed.

Install

pi install npm:pi-claude-relay           # from npm
pi install /path/to/pi-claude-relay      # local checkout
pi -e /path/to/pi-claude-relay/extensions/claude-relay.ts   # one run only

Install it in every Pi space that should use it.

Usage

pi --model claude-sonnet-5-5
pi --model anthropic/claude-opus-5-5:high

Thinking levels map to claude --effort, and Claude's thinking reaches Pi as summarized thinking blocks (--thinking-display summarized; claude streams them without text otherwise); tool calls, aborts, multi-turn sessions, and several Pi sessions at once work as with the direct provider. What does not carry over is listed under Limitations.

Configuration

Variable Effect
PI_CLAUDE_RELAY=off (or 0, false) Disable the relay; Pi streams Anthropic directly again.
PI_CLAUDE_RELAY_CLAUDE_BIN Path to the claude binary (default: claude on PATH).
PI_CLAUDE_RELAY_DEBUG_LOG File to append one JSON line per settled turn to (see Prompt-cache stats).

All are optional. Which login is used is never configured: it is the Anthropic login of the Pi space.

Settings menu

/claude-relay with no arguments opens a settings menu in the style of Pi's /settings (Enter or Space toggles, Esc closes; the mouse wheel scrolls and a click selects, as in /settings). Each change is saved at once, per Pi space, exactly like the text commands below:

  • Usage warning pop-up and Usage limit pop-up (see Notifications),
  • Usage in status bar, Reset time in status bar, Reset time format and Status bar label (see Usage in the status bar),
  • Latency timing (see Latency timing; its description shows the log file),
  • read-only views of the Prompt-cache stats and of the Latency summary.

Without an interactive terminal UI (print, JSON or RPC mode) /claude-relay with no arguments prints the usage line instead. The text subcommands (notify, stats, timing, status, reset, label) work everywhere and never open the menu. The menu loads @earendil-works/pi-tui from Pi at the moment it opens; if that fails the text behavior is used.

Settings file

The menu and the text subcommands save to one file per Pi space, <agent home>/claude-relay-settings.json (written atomically with mode 0600; a symlinked file is never written through). With every switch at its default it would read:

{
  "notify": { "warning": true, "limit": true },
  "status": { "usage": true, "resetWhen": "always", "resetFormat": "full", "label": "claude" },
  "timing": false
}
Key Default Set with Effect
notify.warning true /claude-relay notify warning on\|off Pop-up when you approach a usage limit
notify.limit true /claude-relay notify limit on\|off Pop-up when a usage limit is reached
status.usage true /claude-relay status on\|off Usage in the footer status; off shows the login line
status.resetWhen "always" /claude-relay reset when always\|near\|never When the footer shows each usage window's reset time
status.resetFormat "full" /claude-relay reset format full\|compact How the footer shows each usage window's reset time
status.label "claude" /claude-relay label claude\|relay\|spark Prefix of the footer usage line: Claude, ⎍ or ✻
timing false /claude-relay timing on\|off Latency timing log (claude-relay-timing.jsonl)

The file is created on the first change; a missing file, an unreadable one, or a missing or invalid key means the default. Each change re-reads the file and writes only its own key, so other keys (and changes another Pi process made) are kept. Editing the file by hand works too; the relay reads it when Pi starts.

Notifications

The relay shows two pop-ups when Claude's quota changes: a warning when you approach a limit (Claude usage warning…) and an error when the limit is reached (Claude usage limit reached…). Each can be switched off on its own with the /claude-relay command in Pi (both are on by default):

/claude-relay notify                 # show the current state
/claude-relay notify warning off     # mute the approaching-limit warning
/claude-relay notify limit off       # mute the limit-reached error
/claude-relay notify warning on      # turn it back on

The state is saved per Pi space in <agent home>/claude-relay-settings.json ({ "notify": { "warning": true, "limit": true } }); a missing or unreadable file means both on. Only the pop-ups are affected: the footer status and Pi's automatic retries stay the same.

Usage in the status bar

After each response the footer shows your Claude usage and when each window resets (Claude 5h 48% (resets in 52m) · 7d 73% (resets in 8h 12m)). To hide it, turn off Usage in status bar in the /claude-relay menu or use the text command (on by default):

/claude-relay status         # show the current state
/claude-relay status off     # hide the usage; the footer shows the login line instead (✓ Claude relay · subscription)
/claude-relay status on      # show it again (the last usage seen at once, otherwise after the next response)

The change applies immediately, without restarting Pi. It is saved per Pi space in <agent home>/claude-relay-settings.json ({ "status": { "usage": false } }); a missing or unreadable file or field means on, and notify, timing and unknown keys are kept. Only the footer is affected: the usage warning and limit pop-ups (see Notifications) and Pi's automatic retries stay the same.

Two settings shape each window's reset time: Reset time in status bar chooses when it shows, Reset time format how:

/claude-relay reset                  # show both (always, full)
/claude-relay reset when always      # Claude 5h 48% (resets in 52m) · 7d 73% (resets in 8h 12m)   (default)
/claude-relay reset when near        # Claude 5h 48% · 7d 73%, and near a limit: Claude 5h 91% (resets in 40m) · 7d 73%
/claude-relay reset when never       # Claude 5h 48% · 7d 73%, even near a limit
/claude-relay reset format full      # (resets in 52m)   (default)
/claude-relay reset format compact   # ↻52m

"Near a limit" is Claude's warning state (allowed_warning), the one that also brings the usage warning pop-up; with near only the window near its own limit shows its reset time (every window when Claude does not report a per-window status). Both apply at once and are saved as { "status": { "resetWhen": "near", "resetFormat": "compact" } }; a missing or unknown value means the default. The reset times count from the last response and are recomputed whenever the footer is repainted (after a response or a settings change). A window without a reset time shows only its utilization. Near a limit the reset part is colored warning; when no window reports its own reset time, the overall one is shown instead (Claude 5h 91% · resets in 40m). A reached limit always reads Claude limit reached · resets in …, whatever these settings say. With Usage in status bar off they have no effect.

Status bar label in the menu (or /claude-relay label) chooses the prefix of the usage line:

/claude-relay label            # show the current choice
/claude-relay label claude     # Claude 5h 48% ↻52m · 7d 73% ↻8h 12m   (default)
/claude-relay label relay      # ⎍ 5h 48% ↻52m · 7d 73% ↻8h 12m   (the relay symbol)
/claude-relay label spark      # ✻ 5h 48% ↻52m · 7d 73% ↻8h 12m

It applies to every state of the usage line (⎍ limit reached · resets in … too), at once, and is saved as { "status": { "label": "relay" } }; a missing or unknown value means claude. The login line and the pop-ups keep saying Claude.

Prompt-cache stats

/claude-relay stats shows how well the relay keeps Anthropic's prompt cache warm in this Pi process (counters start at zero when Pi starts):

Claude relay stats: 12 turns · cache hit 91%
process starts: 1 · restarts: 2 (abort 1, model 1) · resumed: 2
cache warm requests answered locally: 3 · one-off requests: 1
  • cache hit = cache-read tokens ÷ (input + cache-read + cache-write tokens), over the turns of your Pi sessions.
  • process starts are first claude processes of a Pi session; restarts replaced a process that held a warm cache, with the reason: model, system-prompt, tools, effort, credential, history (compaction, branch switch, edited history), missing-tool-call, other, or a process lost outside the planner: abort, error, exit.
  • resumed (shown only when above zero) counts the restarts that continued claude's own session with --resume instead of replaying a flattened transcript (see How it works); it is a subset of the restarts.
  • cache warm requests are Pi's idle cache-warming requests, answered locally without reaching claude; one-off requests are turns of throwaway sessions (compaction and summaries), which are kept out of the other figures.

Set PI_CLAUDE_RELAY_DEBUG_LOG=/path/to/file to also append one JSON line per settled turn (t, session = first 8 hex of the sha256 of the Pi session id, plan, reason, stopReason, usage, systemPromptHash, toolsHash, messages). The file is created with mode 0600 and never contains prompt text, tool arguments, credentials or the MCP URL; write errors are ignored.

Latency timing

Pi's session log records only the total duration of a request. To see where the time goes (starting claude, time to the first token), switch on timing; it is off by default:

/claude-relay timing          # state, log file and a summary of this process's requests
/claude-relay timing on       # start recording
/claude-relay timing off      # stop

The switch is saved per Pi space in <agent home>/claude-relay-settings.json ({ "timing": true }; a missing or unreadable file or field means off, and notify is kept). While it is on, each settled request appends one JSON line to <agent home>/claude-relay-timing.jsonl (created with mode 0600). Marks are milliseconds since the request started, taken with a monotonic clock:

Field Meaning
spawn a claude process was started or restarted for this request (absent when the live one was reused); plan and reason say which, with the same restart reasons as stats
firstLine first line claude wrote for the request
messageStart the response started (message_start)
firstThinking, firstText, firstTool first thinking delta, first text delta, first tool call
stop, settle the message ended; the request was finished

plus t (wall-clock ms), session (first 8 hex of the sha256 of the Pi session id), model, stopReason and output (output tokens); throwaway marks one-off requests (compaction, summaries). The file never contains prompt text, tool names or arguments, credentials, URLs or paths.

/claude-relay timing also summarizes the last 500 requests of this Pi process (normal turns that finished without an error): count, median and p90 of the first line, first thinking, first text or tool call, and the total.

There is no measurable cost: when it is off, a request pays one boolean check and nothing per streamed event. When it is on, the marks live in memory and the line is written after the request settled, with an asynchronous append that the turn never waits for; write errors are ignored.

How it works

OX Radar and Response Center

Find threats in your stack.

OX Radar can check high-priority threats, like critical package CVEs, against your context.

Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.

Where it’s listed

The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).

  • npm pi-claude-relay

References

The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.

Scan your whole stack

Group 1261154050 1
Group 1261154050
 

From OX Research Newsroom

Critical Apache HTTP Server Flaw Exposes Web Servers to RCE (1)
CVE

CVE-2026-119618: Critical Apache HTTP Server Flaw Exposes Web Servers to Remote Code Execution

Copy of Template Design OX Blog (2)
Research

NGINX2Root: Five Critical NGINX Flaws Expose Web Servers to Remote Code Execution

Ethersphere Hijacked With Crypto Stealing Malware (1)
npm

Ethersphere Hijacked With Crypto Stealing Malware Via Github & npm

Frame 2085668439 (1)
Group 1261154229