# 🦞 SharpClaw

> Lightweight personal AI assistant CLI — OpenClaw fork optimized for Korean and single-user setups

[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
[![Based on OpenClaw](https://img.shields.io/badge/fork-openclaw%2Fopenclaw-orange)](https://github.com/openclaw/openclaw)

---

## What is SharpClaw?

SharpClaw is a **personal fork** of [OpenClaw](https://github.com/openclaw/openclaw) — a multi-channel AI gateway. This fork strips down the original to a single-user CLI assistant optimized for:

- **Korean-first** interactions (한국어 경어체)
- **Claude CLI backend** (reuses local `claude -p` session — no extra API keys)
- **Minimal footprint** — 40 channels/media extensions removed, build time −27%
- **Faster token usage** — system prompt compressed, tool schema pruned 90%, C2 cache hit 99.8%
- **Session search** — search past sessions by keyword (metadata + transcript content)

## Key differences from OpenClaw

| Feature           | OpenClaw                  | SharpClaw                        |
| ----------------- | ------------------------- | -------------------------------- |
| Target audience   | Multi-user, multi-channel | Single user (personal assistant) |
| Channels included | 60+                       | Core only (Telegram kept)        |
| Primary language  | English                   | Korean (한국어)                  |
| Backend           | Multiple providers        | claude-cli (`claude -p`)         |
| Build time        | ~112s                     | ~82s (−27%)                      |
| System prompt     | 25,857 chars              | Compressed                       |
| Token cache hit   | Varies                    | 99.8% on warmup                  |
| Session search    | Metadata only             | Metadata + transcript content    |

## Installation

> **Prerequisite:** [Claude Code CLI](https://claude.ai/code) installed and authenticated.

```bash
# Clone
git clone https://github.com/rsb1813/SharpClaw.git
cd SharpClaw

# Install dependencies
npm install -g pnpm@11
pnpm install

# Build
pnpm build
```

## Usage

```bash
# Single-turn (local mode, no server)
node openclaw.mjs agent \
  --message "안녕하세요" \
  --model claude-cli/claude-sonnet-4-6 \
  --local

# With specific agent
node openclaw.mjs agent --agent main --message "..." --local

# As JSON (for scripting)
node openclaw.mjs agent --message "..." --local --json
```

## Architecture

SharpClaw inherits OpenClaw's core architecture:

```
openclaw.mjs          ← CLI entry point
src/
  agents/             ← Agent runtime, tool catalog, system prompt
  gateway/            ← MCP HTTP gateway, session management
  config/             ← Configuration, session store
  routing/            ← Session key routing
extensions/           ← Channel integrations (pruned)
```

### Custom additions

- `src/agents/tools/sessions-search-tool.ts` — keyword search across past sessions (metadata → transcript 2-phase)
- Workspace files in `~/.openclaw/workspace/` — Korean persona, skills, memory

## Configuration

SharpClaw reads `~/.openclaw/openclaw.json`:

```json
{
  "gateway": { "mode": "local", "bind": "loopback" },
  "agents": {
    "list": [
      {
        "id": "main",
        "workspace": "~/.openclaw/workspace",
        "identity": { "name": "비서", "theme": "personal assistant", "emoji": "🦞" }
      }
    ]
  },
  "memory": { "citations": "auto" }
}
```

## Contributing

This is a personal-use fork. For contributions to the upstream project, see [openclaw/openclaw](https://github.com/openclaw/openclaw).

Issues and PRs welcome for SharpClaw-specific features.

## License

MIT — same as OpenClaw.

OpenClaw is developed by the OpenClaw team. SharpClaw is an independent fork and is not affiliated with the OpenClaw project.

See [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md) for third-party attributions.
