Smart Tree 10.0.0

repository·main·Indexed 42 days ago

https://github.com/8b-is/smart-tree

A 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.

Tokens
138.8K
Snippets
484
Records
670
Agent score
54%

What's inside Smart Tree

  1. Overview of the Aye & Hue Tool Collection

    main
    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.
  2. Overview of the Smart Tree MCP Edit Tool

    main
    The 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.
  3. Overview of 8-O~~ Mode Vision

    main
    8-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.
  4. What is the Quantum Context Protocol (QCP)?

    main
    QCP (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.
  5. How Security Vigilance features work

    main

    Smart Tree's Security Vigilance mode utilizes four core mechanisms to detect threats:

    1. 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.
    2. 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.
    3. Protected Path Monitoring: Increased vigilance is applied to directories that typically remain static, such as node_modules/, .git/, /usr/bin/, and System32/.
    4. 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).
  6. How MCP Update Checking and Analytics work

    main

    Smart 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 serverInfo object. 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!"
        }
      }
    }
  7. How to use memory tools to build persistent intelligence

    main

    Smart Tree allows you to proactively store and retrieve insights to maintain context across sessions.

    Storing Information

    Use anchor_collaborative_memory whenever you discover important patterns, decisions, or user preferences. Use the following type values:

    • 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_memories with relevant keywords to 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"
    }
  8. Leverage Smart Tree token efficiency and compression

    main

    Smart Tree is optimized for AI interactions through two primary mechanisms designed to reduce token usage and costs:

    1. Smart Edits: Reduces token usage by 90-95% during editing tasks.
    2. Quantum Compression: Achieves up to 99% reduction in size while preserving essential meaning, specifically designed for AI-optimized output formats.
  9. Understand the Smart Tree Client/Daemon Architecture

    main

    Smart 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.

  10. How Human User Experience (HUE) features work

    main

    The HueInterface is designed to improve human-AI collaboration by analyzing human input for emotional and directional cues.

    • Worry Detection: Uses a WorryDetector to identify if a user is concerned about the current direction. If detected, it returns a HumanIntent::NeedsReassurance with a suggested response.
    • Direction Tracking: Uses a DirectionTracker to detect if the user is changing the goal or focus. If detected, it returns HumanIntent::DirectionChange.
    • Goal: To handle natural interruptions and provide reassurance or clarification gracefully.
  11. Manage the ST Daemon (std)

    main

    Smart Tree operates as a two-product system: st (the CLI) and std (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: Runs st in standalone mode without the daemon.
    • st --recall "<query>": Search saved context (JSON).
    std start
    std stop
    std status
    st . --no-daemon
  12. Implement Conditional Summaries for Directory Traversal

    main

    To 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.