claurst-claude-code-rust
```markdown
What this skill does
```markdown
---
name: claurst-claude-code-rust
description: Clean-room Rust reimplementation of Claude Code CLI with multi-agent orchestration, tool system, and memory consolidation
triggers:
- "use claurst"
- "build with claurst"
- "claude code rust implementation"
- "set up claurst CLI"
- "claurst tool system"
- "claurst agent orchestration"
- "implement claurst memory"
- "claurst bash tool"
---
# Claurst — Claude Code in Rust
> Skill by [ara.so](https://ara.so) — Daily 2026 Skills collection.
Claurst is a clean-room Rust reimplementation of Claude Code's behavior, derived from exhaustive behavioral specifications (not the original TypeScript source). It reproduces the full Claude Code CLI feature set — multi-agent orchestration, 40+ tools, background memory consolidation ("dream"), KAIROS proactive mode, ULTRAPLAN remote planning, and the BUDDY companion system — in idiomatic Rust.
---
## Project Structure
```
claurst/
├── spec/ # Behavioral specifications (AI-generated from analysis)
├── src-rust/
│ └── crates/
│ ├── cli/ # Entry point (main.rs)
│ ├── assistant/ # Core agent loop, KAIROS proactive mode
│ ├── tools/ # All tool implementations (bash, fs, search, etc.)
│ ├── query/ # Memory compaction (autoDream / consolidationPrompt)
│ ├── buddy/ # Tamagotchi companion (feature-flagged)
│ └── ...
```
---
## Installation
### Prerequisites
- Rust toolchain (stable, 1.75+): https://rustup.rs
- An Anthropic API key set as `ANTHROPIC_API_KEY`
### Build from Source
```bash
git clone https://github.com/Kuberwastaken/claurst
cd claurst/src-rust
# Default build
cargo build --release
# With optional features
cargo build --release --features buddy,proactive
# Run directly
cargo run --release -- --help
```
### Install Binary
```bash
cargo install --path src-rust/crates/cli
claurst --help
```
---
## Key CLI Commands
```bash
# Start interactive session
claurst
# Run a single prompt non-interactively
claurst -p "Refactor src/lib.rs to use async/await"
# Specify model
claurst --model claude-opus-4-6
# Enable verbose tool output
claurst --verbose
# Use a specific working directory
claurst --cwd /path/to/project
# Trigger ULTRAPLAN mode for complex tasks
claurst --ultraplan "Design the full architecture for a distributed cache"
# Show version
claurst --version
```
---
## Configuration
Configuration is resolved in this order (later entries override earlier):
1. `~/.claurst/config.toml` — global user config
2. `.claurst.toml` in the project root — project-level config
3. Environment variables — highest priority
### `~/.claurst/config.toml`
```toml
[api]
# Key is read from ANTHROPIC_API_KEY env var by default
model = "claude-opus-4-6"
max_tokens = 8192
[memory]
memory_dir = "~/.claurst/memory"
auto_dream = true
dream_interval_hours = 24
dream_session_threshold = 5
[tools]
allowed = ["bash", "read_file", "write_file", "search", "grep"]
bash_timeout_secs = 30
[kairos]
enabled = false # Requires PROACTIVE feature flag at compile time
tick_interval_secs = 60
blocking_budget_secs = 15
[ultraplan]
enabled = true
poll_interval_secs = 3
max_duration_secs = 1800 # 30 minutes
model = "claude-opus-4-6"
```
### Environment Variables
```bash
export ANTHROPIC_API_KEY="sk-ant-..." # Required
export CLAURST_MODEL="claude-sonnet-4-5" # Override model
export CLAURST_MEMORY_DIR="$HOME/.claurst/mem" # Memory storage path
export CLAURST_LOG_LEVEL="debug" # trace|debug|info|warn|error
export CLAURST_MAX_TOKENS="4096" # Token budget
export CLAURST_BASH_TIMEOUT="60" # Bash tool timeout
```
---
## Core Concepts
### Agent Loop
The main loop in `crates/assistant/` runs a read-eval-act cycle:
1. Receive user message
2. Build context (memory, tool results, conversation history)
3. Call Anthropic API
4. Parse tool calls from response
5. Execute tools, append results
6. Continue until no more tool calls or stop condition
### Tool System
Tools implement the `Tool` trait:
```rust
// crates/tools/src/lib.rs
use async_trait::async_trait;
use serde_json::Value;
#[async_trait]
pub trait Tool: Send + Sync {
fn name(&self) -> &'static str;
fn description(&self) -> &'static str;
fn input_schema(&self) -> Value;
async fn execute(&self, input: Value) -> ToolResult;
}
#[derive(Debug)]
pub struct ToolResult {
pub output: String,
pub is_error: bool,
}
```
### Registering a Custom Tool
```rust
// crates/tools/src/custom_tool.rs
use async_trait::async_trait;
use serde_json::{json, Value};
use crate::{Tool, ToolResult};
pub struct MyCustomTool;
#[async_trait]
impl Tool for MyCustomTool {
fn name(&self) -> &'static str { "my_custom_tool" }
fn description(&self) -> &'static str {
"Does something useful for the agent"
}
fn input_schema(&self) -> Value {
json!({
"type": "object",
"properties": {
"target": {
"type": "string",
"description": "The target to operate on"
}
},
"required": ["target"]
})
}
async fn execute(&self, input: Value) -> ToolResult {
let target = input["target"].as_str().unwrap_or("");
ToolResult {
output: format!("Processed: {}", target),
is_error: false,
}
}
}
// Register in tool registry (crates/cli/src/main.rs)
registry.register(Box::new(MyCustomTool));
```
---
## Built-in Tools Reference
| Tool | Description |
|------|-------------|
| `bash` | Execute shell commands with timeout |
| `read_file` | Read file contents |
| `write_file` | Write or overwrite a file |
| `edit_file` | Apply targeted edits to a file |
| `list_dir` | List directory contents |
| `search_files` | Glob-based file search |
| `grep` | Regex search across files |
| `web_fetch` | Fetch a URL |
| `send_user_file` | Push file to user (KAIROS only) |
| `subscribe_pr` | Monitor pull request (KAIROS only) |
---
## Memory System (autoDream)
The dream system consolidates conversation memory in the background.
### Three-Gate Trigger
All three conditions must be true before a dream runs:
```rust
// Pseudo-representation of gate logic
fn should_dream(state: &DreamState) -> bool {
let hours_since = state.last_dream.elapsed().as_secs() / 3600;
let sessions_since = state.sessions_since_last_dream;
let lock_available = state.consolidation_lock.try_acquire().is_ok();
hours_since >= 24 && sessions_since >= 5 && lock_available
}
```
### Four Dream Phases
Defined in `crates/query/src/compact.rs`:
1. **Orient** — `ls` memory dir, read `MEMORY.md`, skim topic files
2. **Gather** — Pull recent session logs, extract key facts and decisions
3. **Synthesize** — Merge into structured topic files, resolve contradictions
4. **Commit** — Write updated files, release lock, record timestamp
### Memory Directory Layout
```
~/.claurst/memory/
├── MEMORY.md # Top-level summary, always read first
├── topics/
│ ├── architecture.md
│ ├── preferences.md
│ └── projects.md
└── sessions/
├── 2026-03-31.log
└── 2026-04-01.log
```
### Manually Trigger a Dream
```bash
claurst --dream-now
```
---
## BUDDY — Tamagotchi Companion (Feature Flag)
Build with `--features buddy` to enable.
```bash
cargo build --release --features buddy
```
Species is deterministically assigned per user via Mulberry32 PRNG seeded from `userId` hash + salt `friend-2026-401`. Same user always gets the same species.
```rust
// Mulberry32 PRNG (ported to Rust in crates/buddy/src/rng.rs)
fn mulberry32(seed: u32) -> impl FnMut() -> f64 {
let mut s = seed;
move || {
s = s.wrapping_add(0x6D2B79F5);
let mut t = (s ^ (s >> 15)).wrapping_mul(1u32.wrapping_add(s));
t = (t ^ (t >> 7)).wrapping_mul(61u32.wrapping_adRelated in Backend & APIs
jfrog
IncludedInteract with the JFrog Platform via the JFrog CLI and REST/GraphQL APIs. Use this skill when the user wants to manage Artifactory repositories, upload or download artifacts, manage builds, configure permissions, manage users and groups, work with access tokens, configure JFrog CLI servers, search artifacts, manage properties, set up replication, manage JFrog Projects, run security audits or scans, look up CVE details, query exposures scan results from JFrog Advanced Security, manage release bundles and lifecycle operations, aggregate or export platform data, or perform any JFrog Platform administration task. Also use when the user mentions jf, jfrog, artifactory, xray, distribution, evidence, apptrust, onemodel, graphql, workers, mission control, curation, advanced security, exposures, or any JFrog product name.
cupynumeric-migration-readiness
IncludedPre-migration readiness assessor for porting NumPy to cuPyNumeric. Use BEFORE substantial porting work begins when the user asks whether code will scale on GPU, whether they should migrate to cuPyNumeric, which NumPy patterns transfer cleanly, what must be refactored before porting, or mentions pre-port assessment, scaling analysis, or refactor planning. Inspect the user's source code, look up NumPy usage, cross-reference the cuPyNumeric API support manifest, and distinguish distributed-scaling-friendly patterns from blockers such as unsupported APIs, scalar synchronization, host round-trips, Python/object-heavy control flow, shape/data-dependent branching, and in-place mutation hazards. Produce a verdict of READY, LIGHT REFACTOR, SIGNIFICANT REFACTOR, or NOT RECOMMENDED, with concrete refactor pointers.
alibabacloud-data-agent-skill
IncludedInvoke Alibaba Cloud Apsara Data Agent for Analytics via CLI to perform natural language-driven data analysis on enterprise databases. Data Agent for Analytics is an intelligent data analysis agent developed by Alibaba Cloud Database team for enterprise users. It automatically completes requirement analysis, data understanding, analysis insights, and report generation based on natural language descriptions. This tool supports: discovering data resources (instances/databases/tables) managed in DMS, initiating query or deep analysis sessions, real-time progress tracking, and retrieving analysis conclusions and generated reports. Use this Skill when users need to query databases, analyze data trends, generate data reports, ask questions in natural language, or mention "Data Agent", "data analysis", "database query", "SQL analysis", "data insights".
token-optimizer
IncludedReduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking, and native 2026.2.15 features (session pruning, bootstrap size limits, cache TTL alignment). Use when token costs are high, API rate limits are being hit, or hosting multiple agents at scale. The 4 executable scripts (context_optimizer, model_router, heartbeat_optimizer, token_tracker) are local-only — no network requests, no subprocess calls, no system modifications. Reference files (PROVIDERS.md, config-patches.json) document optional multi-provider strategies that require external API keys and network access if you choose to use them. See SECURITY.md for full breakdown.
resend-cli
IncludedUse this skill when the task is specifically about operating Resend from an AI agent, terminal session, or CI job via the official resend CLI: installing/authenticating the CLI, sending/listing/updating/cancelling emails, batch sends, domains and DNS, webhooks and local listeners, inbound receiving, contacts, topics, segments, broadcasts, templates, API keys, profiles, or debugging Resend CLI/API failures. Trigger on mentions of Resend CLI, `resend`, `resend doctor`, `resend emails send`, `resend domains`, `resend webhooks listen`, `resend emails receiving`, or agent-friendly terminal automation.
alibabacloud-odps-maxframe-coding
IncludedUse this skill for MaxFrame SDK development and documentation navigation on Alibaba Cloud MaxCompute (ODPS). Helps answer MaxFrame API, concept, official example, and supported pandas API questions; create data processing programs; read/write MaxCompute tables; debug jobs (remote or local); and build custom DPE runtime images. Trigger when users mention MaxFrame, MaxCompute with MaxFrame, ODPS table processing, DPE runtime, MaxFrame docs/examples, DataFrame/Tensor operations, or GPU runtime setup. Works for both English and Chinese queries about Alibaba Cloud data processing with MaxFrame.