$ show Kuberwastaken/claurst
This repository is an open-source terminal-based AI coding assistant built in Rust, clean-room reimplementing Anthropic's Claude Code. It provides an interactive TUI (ratatui) for multi-provider LLM conversation (Anthropic, OpenAI, Google, and 30+ OpenAI-compatible) with a rich tool ecosystem for file editing, bash execution, MCP integration, code analysis, web fetching, and agent orchestration. The architecture is modular: a provider abstraction layer (`LlmProvider` trait), plugin system, slash commands, session management, and an Agent Client Protocol (ACP) for external IDE integration. The codebase is organized into 12+ workspace crates with clear separation of concerns, but many modules are still in active refactoring (issue #232) with stubs, TODOs, and incomplete feature gates (36 experimental features). The permission system, tool budget enforcement, and streaming decoders demonstrate strong engineering, while dual feature flag systems and global mutable state introduce maintenance risk. Overall, it is a feature-rich, well-architected application with some rough edges from ongoing migration.
The LLM identified 5 files worth highlighting for reuse:
A self-contained utility for detecting file line endings (LF, CRLF, mixed) and replacing line separators while preserving original EOL style. Used by file edit tools to avoid unnecessary changes to existing files. Exposes `LineEnding::detect()`, `replace_preserving_eol()`, and `standardize_eol()`. No internal dependencies beyond `std` and `once_cell::race::OnceBool`. Can be extracted as a standalone crate for any tool that needs line ending awareness.
A sans-IO streaming SSE parser (`SseByteDecoder`, `SseStreamParser`, `JsonLinesStreamParser`) that buffers partial UTF-8 codepoints across chunk boundaries, fixing an earlier bug (#228). `SseByteDecoder` is a state machine that yields complete lines from a byte stream without external dependencies beyond `std`. `JsonLinesStreamParser` accumulates newline-delimited JSON objects. Both parsers are testable without I/O and can be reused in any HTTP streaming client.
Defines `EffortLevel` enum (None, Low, Medium, High, Max, Ultracode) with derived `Ord`, `Display`, and serde aliases. Provides methods like `thinking_budget_tokens()`, `temperature()`, and `is_budget_available()`. The enum is used throughout the codebase for provider effort ladders and UI display. Self-contained with no internal imports beyond `std` and `serde`. The pattern of a well-typed, ordered enum with computed properties is reusable in any application requiring tiered configuration.
A generic virtual scrolling widget for ratatui (`VirtualList<T: VirtualItem>`) that efficiently renders large lists by computing visible indices based on cached item heights. Supports sticky headers, mouse hit-testing, smooth scrolling, and item height caching. The `VirtualItem` trait requires `height()` and `render_item()` methods. The widget is self-contained within the TUI crate and uses only ratatui and standard iterator patterns. It can be extracted into any ratatui project needing high-performance list rendering.
Implements `sanitize_history()` that enforces the `tool_use` ↔ `tool_result` pairing invariant in conversation history. It repairs dangling `tool_use` messages by inserting synthetic `tool_result` placeholders. Uses a stack-based algorithm to pair tool calls with results, handling nested tool use and out-of-order results. Pure function with no internal crate dependencies (only `claurst_core` types). Can be extracted as a standalone data validation utility for any system that processes structured AI conversation logs.