npx claudepluginhub joshuarweaver/cascade-ai-ml-agents-misc-1 --plugin aradotso-trending-skills-37This skill uses the workspace's default tool permissions.
```markdown
Guides Next.js Cache Components and Partial Prerendering (PPR) with cacheComponents enabled. Implements 'use cache', cacheLife(), cacheTag(), revalidateTag(), static/dynamic optimization, and cache debugging.
Guides building MCP servers enabling LLMs to interact with external services via tools. Covers best practices, TypeScript/Node (MCP SDK), Python (FastMCP).
Generates original PNG/PDF visual art via design philosophy manifestos for posters, graphics, and static designs on user request.
---
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
cargo install --path src-rust/crates/cli
claurst --help
# 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 is resolved in this order (later entries override earlier):
~/.claurst/config.toml — global user config.claurst.toml in the project root — project-level config~/.claurst/config.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"
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
The main loop in crates/assistant/ runs a read-eval-act cycle:
Tools implement the Tool trait:
// 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,
}
// 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));
| 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) |
The dream system consolidates conversation memory in the background.
All three conditions must be true before a dream runs:
// 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
}
Defined in crates/query/src/compact.rs:
ls memory dir, read MEMORY.md, skim topic files~/.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
claurst --dream-now
Build with --features buddy to enable.
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.
// 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_add(t)) ^ t;
((t ^ (t >> 14)) as f64) / 4294967296.0
}
}
| Rarity | Chance | Species |
|---|---|---|
| Common | 60% | Pebblecrab, Dustbunny, Mossfrog, Twigling, Dewdrop, Puddlefish |
| Uncommon | 25% | Cloudferret, Gustowl, Bramblebear, Thornfox |
| Rare | 10% | Crystaldrake, Deepstag, Lavapup |
| Epic | 4% | Stormwyrm, Voidcat, Aetherling |
| Legendary | 1% | Cosmoshale, Nebulynx |
Shiny chance: independent 1%. Shiny Legendary = 0.01%.
For complex architectural tasks, ULTRAPLAN offloads planning to a remote Cloud Container Runtime (CCR) session:
claurst --ultraplan "Design a horizontally scalable job queue with exactly-once delivery"
Flow:
tengu_ultraplan_model (Opus 4.6)__ULTRAPLAN_TELEPORT_LOCAL__ sentinel returns result to terminalConfigure timeout and poll interval in config.toml:
[ultraplan]
poll_interval_secs = 3
max_duration_secs = 1800
Build with --features proactive:
cargo build --release --features proactive
claurst --kairos
KAIROS maintains append-only daily logs and receives <tick> prompts on an interval to decide whether to act proactively. Actions taking >15 seconds are deferred.
[kairos]
enabled = true
tick_interval_secs = 60
blocking_budget_secs = 15
Spawn subagents from within a tool or agent context:
use claurst_assistant::{Agent, AgentConfig, Message};
let subagent = Agent::new(AgentConfig {
model: "claude-sonnet-4-5".into(),
system_prompt: "You are a focused code reviewer.".into(),
tools: vec!["read_file", "grep"],
max_tokens: 2048,
..Default::default()
});
let result = subagent
.run(vec![Message::user("Review src/lib.rs for unsafe blocks")])
.await?;
println!("{}", result.final_response());
#!/usr/bin/env bash
# Run claurst headlessly in CI
export ANTHROPIC_API_KEY="$ANTHROPIC_API_KEY"
claurst -p "Run the test suite and summarize failures" \
--no-interactive \
--output-format json \
> results.json
# Feed file contents as context
cat src/main.rs | claurst -p "Explain this code and suggest improvements"
# Pipe git diff for review
git diff HEAD~1 | claurst -p "Review this diff for bugs"
claurst --system "You are an expert in embedded Rust. Always prefer no_std solutions." \
-p "Implement a ring buffer for a bare-metal target"
Error: ANTHROPIC_API_KEY not set
export ANTHROPIC_API_KEY="sk-ant-..."
# Or add to ~/.claurst/config.toml under [api]
ToolError: bash execution exceeded 30s timeout
Increase timeout:
[tools]
bash_timeout_secs = 120
Or per-invocation:
claurst --bash-timeout 120 -p "Run the full integration test suite"
Check that all three gates are satisfied:
~/.claurst/memory/.dream.lock)Force a dream manually:
claurst --dream-now
rm ~/.claurst/memory/.dream.lock # If lock is stale
error[E0432]: unresolved import `claurst_buddy`
Feature flags must be passed consistently:
cargo build --features buddy,proactive
# Not just: cargo build
# Inspect memory directory size
du -sh ~/.claurst/memory/
# Manually compact (triggers dream immediately)
claurst --dream-now --verbose
To contribute or extend claurst, follow the two-phase clean-room process:
spec/): Write behavioral specifications — inputs, outputs, tool contracts, data flows. No implementation details.src-rust/): Implement from spec alone. Never reference external proprietary source.This mirrors the Phoenix Technologies v. IBM (1984) clean-room BIOS precedent.
spec/ — full behavioral specifications