Smart Tree 10.0.0
repository·main·Indexed 42 days ago
https://github.com/8b-is/smart-treeA high-performance, Rust-based directory visualization tool designed for humans and AI agents. It features AI-optimized compression (up to 99% reduction), Model Context Protocol (MCP) support for Claude Desktop, and 25+ output formats. Part of the Aye & Hue Tool Collection, it provides utilities for semantic analysis, directory evolution tracking, and quantum compression via the `st` CLI.
What's inside Smart Tree
- The Aye & Hue Tool Collection is a curated suite of tools developed through human-AI partnership (Hue and Aye). The collection focuses on high-context, efficient, and intelligent utilities for developers, including directory visualization, semantic search, partnership memory, smart editing, and quantum compression. The tools are designed around principles of context awareness, elegant efficiency, and joyful user experience.
Overview of the Smart Tree MCP Edit Tool
mainThe Smart Tree MCP Edit tool provides AST-aware (Abstract Syntax Tree) code editing. Unlike traditional diff-based methods that require sending entire files or large diff blocks, this tool allows you to describe structural changes (like adding or removing functions). This approach achieves approximately 90% token reduction, making it highly efficient for LLM-based agents.Overview of 8-O~~ Mode Vision
main8-O~~ Mode is a conceptual live code visualization experience designed to transform coding into a cinematic, real-time visual event. It visualizes code structure, AST (Abstract Syntax Tree) growth, and performance metrics through 3D rendering and animations. The mode is intended to be streamable via Google Cast or Airplay for pair programming, presentations, or remote collaboration.What is the Quantum Context Protocol (QCP)?
mainQCP (Quantum Context Protocol) is a protocol designed to treat context as dynamic probability waves rather than static data structures. Unlike traditional protocols (like OpenAPI or GraphQL) that describe fixed structures, QCP describes possibilities, relationships (entanglements), and temporal states (past, present, and future) using a wave-based model.How Security Vigilance features work
mainSmart Tree's Security Vigilance mode utilizes four core mechanisms to detect threats:
- Last 5 Writes Tracking: In AI modes, the tool highlights the most recently modified files in every directory, helping identify unexpected changes in stable environments.
- Random Content Sampling: The tool takes random samples (defaulting to 1KB) from files to detect hardcoded credentials, dynamic code execution (
eval,exec), suspicious network calls, or cryptocurrency addresses. - Protected Path Monitoring: Increased vigilance is applied to directories that typically remain static, such as
node_modules/,.git/,/usr/bin/, andSystem32/. - Anomaly Detection: The system flags suspicious filenames (e.g.,
backdoor.php,shell.aspx,id_rsa) and suspicious code patterns (e.g., obfuscated code or remote execution attempts).
How MCP Update Checking and Analytics work
mainSmart Tree's MCP server includes an intelligent update checking mechanism that triggers when an AI assistant connects to the server. This mechanism provides the assistant with information about new features and available updates via the
serverInfoobject. It also collects minimal, anonymous platform analytics (OS, Architecture, and Version) to help prioritize development efforts like platform-specific optimizations.Key characteristics:
- Non-blocking: Uses a 2-second timeout to ensure MCP initialization is not delayed.
- Privacy-focused: Does not collect usernames, file paths, or project information.
- Cached: Responses are cached to minimize network load.
{ "serverInfo": { "name": "smart-tree", "version": "5.2.0", "update_info": { "available": true, "latest_version": "5.3.0", "new_features": [ "New 'quantum-search' tool for massive codebases", "Improved Windows ARM performance", "Enhanced context absorption" ], "message": "Update available with exciting new features!" } } }How to use memory tools to build persistent intelligence
mainSmart Tree allows you to proactively store and retrieve insights to maintain context across sessions.
Storing Information
Use
anchor_collaborative_memorywhenever you discover important patterns, decisions, or user preferences. Use the followingtypevalues:insight: Important discoveries or user preferences.decision: Choices made during development.pattern: Recurring code patterns.gotcha: Bugs, traps, or unexpected behaviors.todo: Future work items.
Retrieving Information
Use
find_collaborative_memorieswith relevantkeywordsto recall past learnings at the start of a session or when investigating a specific topic.// Proactively anchoring a discovery anchor_collaborative_memory { type: "insight", keywords: ["auth", "jwt", "cookies"], context: "Project uses JWT authentication stored in httpOnly cookies for security" }Leverage Smart Tree token efficiency and compression
mainSmart Tree is optimized for AI interactions through two primary mechanisms designed to reduce token usage and costs:
- Smart Edits: Reduces token usage by 90-95% during editing tasks.
- Quantum Compression: Achieves up to 99% reduction in size while preserving essential meaning, specifically designed for AI-optimized output formats.
Understand the Smart Tree Client/Daemon Architecture
mainSmart Tree uses a split architecture consisting of a persistent daemon (
std) and a thin client (st).std(Daemon): Runs persistently on a workstation or server. It provides the core services: MCP API, M8 Memory, Security enforcement, and the Web Dashboard. It manages context, filesystem watching, and security levels.st(Client): A lightweight CLI tool used to communicate with local or remote daemons. It acts as the universal interface for triggering operations like scanning, searching, and memory management.
This architecture allows you to manage a fleet of servers or workstations from a single client, providing a unified way to interact with remote context and memory.
How Human User Experience (HUE) features work
mainThe
HueInterfaceis designed to improve human-AI collaboration by analyzing human input for emotional and directional cues.- Worry Detection: Uses a
WorryDetectorto identify if a user is concerned about the current direction. If detected, it returns aHumanIntent::NeedsReassurancewith a suggested response. - Direction Tracking: Uses a
DirectionTrackerto detect if the user is changing the goal or focus. If detected, it returnsHumanIntent::DirectionChange. - Goal: To handle natural interruptions and provide reassurance or clarification gracefully.
- Worry Detection: Uses a
Manage the ST Daemon (std)
mainSmart Tree operates as a two-product system:
st(the CLI) andstd(the always-on daemon). The daemon provides shared memory, a fast binary protocol, and SSE/HTTP endpoints for AI assistants.Daemon Control:
std start: Start the daemon.std stop: Stop the daemon.std status: Check daemon status.
CLI Integration:
st .: Auto-starts the daemon if it is not running.st . --no-daemon: Runsstin standalone mode without the daemon.st --recall "<query>": Search saved context (JSON).
std start std stop std status st . --no-daemonImplement Conditional Summaries for Directory Traversal
mainTo optimize the size of directory traversal outputs, use a conditional summary approach rather than including metadata for every directory. This prevents the output from bloating unnecessarily while providing critical context for complex structures.
When to include summaries:
- Large directories: More than 10 files.
- Permission issues: When access is denied to certain files.
- Hidden files: When files starting with
.are present. - Exceptional cases: Extremely large files or error states.
- End of major branches: At the conclusion of significant directory sub-trees.
When to skip summaries:
- Small directories: Fewer than 5 files.
- Standard conditions: Normal permissions and visible files only.
- Leaf directories: Directories containing no subdirectories.