AST Context Engine
Deep repository comprehension without token bloat. Kernax maps your codebase locally using Tree-sitter Abstract Syntax Trees.
Tree-sitter AST Knowledge Graph
Legacy AI coding tools treat codebases as unstructured plain text files, exhausting context windows and hallucinating syntax errors. Kernax approaches code representation through compiler theory.
Our local engine utilizes Tree-sitter to parse TypeScript, JavaScript, Python, Go, Rust, C++, PHP, and SQL into concrete syntax trees:
- Structural Node Slicing: Instead of transmitting a 2,000-line file, Kernax extracts only the exact class, function node, or interface contract pertinent to the active prompt.
- Dependency Call Graphs: The engine indexes callers, callees, and imported type definitions across files to provide comprehensive cross-file context.
- Deterministic Boundary Mapping: Indentation shifts and curly bracket mismatches are eradicated because code edits are anchored to AST syntax nodes, not raw line numbers.
@ Context Directives & Popovers
Directly inject relevant codebase context into the agent prompt using interactive @ prefix triggers:
| Mention Directive | Target & Behavior | Example Usage |
|---|---|---|
@Files |
Fuzzy-search and attach specific project files as structured context pills. | @src/controllers/auth.ts Review password hashing |
@Codebase |
Initiates a semantic vector + AST graph search across the entire repository. | @Codebase How is billing tiered for enterprise seats? |
@Git |
Attaches current branch name, uncommitted diffs, and staged changes. | @Git Generate conventional commit message |
@Terminal |
Injects the last 200 lines of terminal stdout/stderr for rapid debugging. | @Terminal Resolve this TypeScript compilation failure |
@Docs |
References pre-indexed framework documentation (e.g. Next.js, FastAPI, Prisma). | @Docs Next.js 15 Server Actions best practices |
@Web |
Authorizes the agent to query real-time documentation and release notes. | @Web OpenAI Responses API documentation |
Drag & Drop Context Pills
You don't need to manually type long file paths. Simply drag any file or directory tab directly from the Kernax File Explorer (or your operating system desktop) and drop it into the Timeline Chat composer.
Kernax automatically transforms the dropped element into a scoped AST context pill, displaying its line count, exported symbols, and file size.
Ignored Paths & Secret Exclusion
The AST indexing engine automatically detects and hard-blocks the following paths from all agent contexts:
.env,.env.local,.env.production, and all key/certificate files (*.pem,*.key,id_rsa).- Dependency directories:
node_modules/,vendor/,target/,venv/. - Custom exclusions defined in your project's
.gitignoreor.kernaxignorefile.
Adaptive Context Compaction & /summarize
During long-running agent refactoring sessions spanning dozens of turns, conversation logs can expand to hundreds of thousands of tokens, degrading model attention and increasing inference costs.
Kernax incorporates an intelligent 2-pass architectural compaction engine:
/summarize
Typing /summarize compresses intermediate discussion logs while strictly preserving:
- The list of modified and newly created files.
- Key architectural decisions and schema invariants.
- Remaining unresolved items in
tasks.md.
This compaction reduces token overhead by up to 70% while maintaining absolute contextual continuity for subsequent turns.