hex-summarize

Generate token-efficient AST summaries of source code using Tree-sitter.

4|Updated Mar 16, 2026
One-click install
npx skills add https://github.com/gaberger/hex --skill hex-summarize
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: hex-summarize
Source: https://github.com/gaberger/hex/tree/main/.claude/skills/hex-summarize
Command: npx skills add https://github.com/gaberger/hex --skill hex-summarize

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Generate token-efficient AST summaries of source files to keep AI context manageable during coding, review, and navigation of large codebases.

Core Features & Use Cases

  • Tree-sitter based AST summaries at configurable detail levels (L0-L3)
  • Supports target path, format: text/json/markdown, and token budget management
  • Use cases: reduce context size for code generation, quick code exploration, and documentation

Quick Start

Summarize the target path to generate a token-efficient AST overview for all source files.

Frequently Asked Questions about hex-summarize

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I reduce source code context size for LLM code generation?

To reduce source code context size for LLMs, generate token-efficient AST summaries using Tree-sitter. This extracts structural code information at configurable detail levels, keeping context manageable for large codebases.

What is a Tree-sitter AST summary and how does it help with code exploration?

A Tree-sitter AST summary is a condensed, token-efficient representation of source code structure. It helps code exploration by providing configurable detail levels (L0-L3) that allow quick navigation of large codebases without loading full file contents.

How do I summarize a large codebase for incremental documentation?

Summarize a large codebase for incremental documentation by targeting a specific file path and generating AST summaries. Configure output formats like text, markdown, or json, and set a token budget to manage documentation scope.

Can I set a token budget for code summaries to fit within LLM context windows?

Yes, you can set a token budget to ensure code summaries fit within LLM context limits. The summarization process respects your specified budget while applying filters to generate token-efficient AST overviews of target source paths.

Does Tree-sitter parsing support different output formats for code context provisioning?

Tree-sitter parsing supports different output formats for code context provisioning, including text, json, and markdown. You can specify the desired format alongside target path and filters to generate AST summaries tailored to your workflow.

When should I not use AST summaries for AI-assisted coding?

You should not use AST summaries for AI-assisted coding when the LLM requires exact line-level syntax or raw character data, as summarization abstracts structural details to achieve token efficiency rather than preserving full source fidelity.