Skip to content

Commit b0587f3

Browse files
committed
docs: fix proxy chain order — contextspectre first, pastewatch as upstream
1 parent ed111c0 commit b0587f3

3 files changed

Lines changed: 15 additions & 4 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ A single long session can cost hundreds of dollars. Most of that is cache reads
2828
ContextSpectre is a reasoning hygiene layer for Claude Code. It operates in two modes: **post-hoc** (reads JSONL session files, diagnoses problems, cleans and repairs) and **inline** (API proxy that strips noise before it hits the API, preventing junk tokens from being billed). Works with both Claude Code CLI and Claude for Mac.
2929

3030
```
31-
Claude Code → contextspectre proxy → (optional: pastewatch) → Anthropic API
31+
Claude Code → contextspectre proxy (strip noise) → pastewatch (strip secrets) → Anthropic API
3232
```
3333

34-
The proxy removes thinking blocks, duplicate system reminders, and oversized content blocks from every API request. Combined with [pastewatch](https://github.com/ppiankov/pastewatch) for secret protection, it forms a two-layer control plane for agent traffic.
34+
The proxy removes thinking blocks, duplicate system reminders, and oversized content blocks from every API request — preventing junk tokens from being billed. Combined with [pastewatch](https://github.com/ppiankov/pastewatch) for secret protection, it forms a two-layer control plane for agent traffic.
3535

3636
**Visibility**
3737
- Context meter with compaction history and turn estimates

docs/howto.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,10 @@ contextspectre proxy --port 9120
179179
# Then set ANTHROPIC_BASE_URL=http://127.0.0.1:9120 in your shell
180180

181181
# Chain with pastewatch for secret + noise protection
182-
pastewatch-cli launch --forward-proxy http://localhost:9120 -- claude
182+
# Order: claude → contextspectre (strip noise) → pastewatch (strip secrets) → API
183+
pastewatch-cli proxy # Terminal 1: :8443
184+
contextspectre proxy --port 9120 --upstream http://localhost:8443 # Terminal 2: :9120
185+
ANTHROPIC_BASE_URL=http://localhost:9120 claude -r # Terminal 3
183186

184187
# Corporate proxy: route through your org's proxy after filtering
185188
contextspectre proxy --port 9120 --forward-proxy http://proxy.corp:8080

docs/workflow.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,15 @@ contextspectre proxy --port 9120 --forward-proxy http://proxy.corp:8080
151151

152152
The proxy chains transparently: Claude → contextspectre (strip noise) → corporate proxy → Anthropic API.
153153

154-
**Two layers of protection.** With pastewatch chained, the pipeline becomes: Claude → pastewatch (strip secrets) → contextspectre (strip noise) → API. Data hygiene and context hygiene in one pipe.
154+
**Two layers of protection.** With [pastewatch](https://github.com/ppiankov/pastewatch) chained, contextspectre forwards to pastewatch as its upstream:
155+
156+
```bash
157+
pastewatch-cli proxy # Terminal 1: :8443
158+
contextspectre proxy --port 9120 --upstream http://localhost:8443 # Terminal 2: :9120
159+
ANTHROPIC_BASE_URL=http://localhost:9120 claude -r # Terminal 3
160+
```
161+
162+
Pipeline: Claude → contextspectre (:9120, strip noise) → pastewatch (:8443, strip secrets) → Anthropic API. Data hygiene and context hygiene in one pipe.
155163

156164
## Recommended: continuous cleanup in a side terminal
157165

0 commit comments

Comments
 (0)