Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 33 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,31 @@
# SlimClaw 🦞

Token optimization plugin for OpenClaw. Tracks cache hits, measures savings, and provides real-time metrics.
[![npm version](https://img.shields.io/npm/v/slimclaw)](https://www.npmjs.com/package/slimclaw)
[![CI](https://github.com/evansantos/slimclaw/actions/workflows/ci.yml/badge.svg)](https://github.com/evansantos/slimclaw/actions/workflows/ci.yml)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

Token optimization plugin for OpenClaw. Tracks cache hits, measures savings, provides real-time metrics, and integrates intelligent model routing via [ClawRouter](https://github.com/BlockRunAI/clawrouter).

**422 tests passing** · **0 vulnerabilities** · **Node 22+**
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Warning

The line **422 tests passing** is a hardcoded value. This can quickly become outdated as tests are added, removed, or fail, leading to an inaccurate representation of the project's test status.

Fix: Replace the hardcoded test count with a dynamic badge that reflects the current test status from the CI pipeline. This ensures the README always displays accurate and up-to-date information.

Suggested change
**422 tests passing** · **0 vulnerabilities** · **Node 22+**
![Tests](https://github.com/evansantos/slimclaw/actions/workflows/ci.yml/badge.svg?branch=main) <!-- Or a more specific test badge if available --> · **0 vulnerabilities** · **Node 22+**


## Features

- **Metrics Tracking** — Input/output tokens, cache reads/writes, estimated savings
- **Cache Breakpoint Injection** — Optimizes Anthropic's prompt caching
- **Intelligent Model Routing** — Hybrid ClawRouter + heuristic classification for cost optimization
- **Dashboard** — Dark theme web UI at `http://localhost:3333`
- **Shadow Mode** — Measures without modifying requests (safe to run)

## Installation

### From npm

```bash
npm install slimclaw
```

### From source

```bash
git clone https://github.com/evansantos/slimclaw ~/.openclaw/plugins/slimclaw
cd ~/.openclaw/plugins/slimclaw
Expand Down Expand Up @@ -164,9 +179,24 @@ Override default model pricing in `slimclaw.config.json` to keep costs accurate

> **Note:** `@blockrun/clawrouter` pulls `viem` as a transitive dependency (~50 packages). This doesn't affect functionality but adds to `node_modules` size. See [BlockRunAI/clawrouter#1](https://github.com/BlockRunAI/clawrouter/issues/1) for tracking.

## Coming Soon
## Status

- **Active Mode** — Actually apply optimizations (pending OpenClaw hook mutation support)
- **v0.1.0** published on [npm](https://www.npmjs.com/package/slimclaw)
- **Observation mode** — routing classifies and logs recommendations without mutating model selection
- **Active mode blocked** — waiting for OpenClaw `historyMessages` mutation support ([#20416](https://github.com/openclaw/openclaw/issues/20416))
- **9 open issues** — see [issues](https://github.com/evansantos/slimclaw/issues)
- **8 PRs merged** — including ClawRouter integration, routing classification, GitSniff fixes

## Contributing

PRs welcome! The project uses branch protection — all changes go through PR with CI + [GitSniff](https://gitsniff.ai) review.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ Info

The mention of 'GitSniff review' is ambiguous. While it accurately describes the current review process, it might not be clear to external contributors what GitSniff is or how it functions within the PR workflow. This could lead to confusion about the review expectations.

Fix: Consider briefly explaining GitSniff's role (e.g., 'automated AI code review') or linking to its documentation if available. This provides clarity for new contributors and maintains transparency in the review process.

Suggested change
PRs welcome! The project uses branch protection — all changes go through PR with CI + [GitSniff](https://gitsniff.ai) review.
PRs welcome! The project uses branch protection — all changes go through PR with CI + automated AI code review by [GitSniff](https://gitsniff.ai).


```bash
git clone https://github.com/evansantos/slimclaw
cd slimclaw
npm install
npm test
```

## License

Expand Down