ModLens Code Intelligence & AST Semantic Grepper

ModLens Code Intelligence & AST Semantic Grepper

@liustack/modlens·v1.4.2·tools

An advanced AST-powered code intelligence suite for DeepSeek Harness. Delivers lightning-fast symbol resolution, deep call graph tracing, static anti-pattern audits, and clean refactoring patches.

Code-Intelligence · AST · Refactoring · Tree-sitter

GitHubNPM
Installation & Integration
bash
manager:
$ pnpm add @liustack/modlens

Architecture

ModLens gives DeepSeek Harness agents the surgical precision of a modern language server. Raw text-based regex search floods LLM contexts with comments and unrelated string matches, wasting tokens and confusing reasoning. By packaging Tree-sitter parsers and LSP interfaces directly into Cordis, ModLens enables agents to query code as strongly typed semantic trees. Agents can locate interface definitions, trace call graphs across microservices, and produce minimal, conflict-free AST diffs effortlessly.

Core Features

01

Tree-sitter Native Multilingual Engine: Millisecond AST parsing for TS, Go, Rust, Python, and Java

02

Symbol-Accurate Navigation: Eliminates false-positive matches from comments and log messages

03

Semantic Context Slicing: Extracts only target functions and direct signatures, slashing tokens by 80%

04

Syntax Integrity Verification: Automatically audits edited patches to prevent broken braces or lints

Core Workflow

01

AST Ingestion & Indexing

Parses multi-language source trees with Tree-sitter, building fast symbol indexes.

02

Symbol & Call Traversal

Resolves definitions and usages across modules, mapping bidirectional call chains.

03

Semantic Context Slicing

Prunes unrelated code, synthesizing a minimal context containing only relevant logic.

04

Structured Patch Generation

Outputs unified diffs and AST edits that preserve formatting and prevent syntax errors.

Configuration Parameters Reference (YAML / JSON)

ParameterTypeDefaultDescription
maxSliceTokensnumber4096Maximum token cap for a single code slice
resolveExternalLibsbooleanfalseTraverse third-party vendor modules
enableLSPbooleantrueEnable lightweight LSP for precise type resolution