get_project_context_tree
Scans a project directory and builds a hierarchical AST context tree, reducing prompt tokens by loading architecture and signatures at session start or before refactors.
Instructions
Scans the target project directory and builds an enterprise-grade multi-tier T-Zero hierarchical context tree (T-1 Master Architecture, T-2 Module References, T-3 AST Signatures, T-4 Agent Boundary Rules).
Behavior:
Read-only: Performs static AST analysis without modifying any files on disk.
Idempotent: Deterministic output for identical repository states.
100% Offline: Executes locally without network calls, external embeddings, or LLM billing.
Usage Guidelines:
When to use: Ingest repository architecture and signatures into prompt context at the start of a coding session or before large refactors (80-95% token savings).
Sibling Routing: For a fast single-page class/method symbol index, use 'generate_repo_map'. For full implementation of an active file with 1st-degree caller/callee skeletons, use 'get_smart_skeleton_context'. For arbitrary in-memory snippets, use 'prune_code_snippet'.
Returns: Structured Markdown containing directory tree, module outlines, and AST signatures up to max_tokens.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| max_tokens | No | Upper token budget threshold for returned context. When exceeded, PageRank & Git recency prioritizes critical architectural files. | |
| project_root | No | Target repository root path to scan (default: current working directory). | . |
| reduction_mode | No | AST reduction level: 'ultra' for signatures & docstrings (80-95% reduction), 'balanced' for signatures + control headers, 'none' for verbatim source. | ultra |
| include_file_contents | No | When True, includes AST-reduced file bodies; when False, emits only the directory hierarchy and high-level architectural outline. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |