Ast Outline banner
dim-s dim-s

Ast Outline

AI community

Description

ast-outline lets AI coding agents pull exactly the code context they need — a repo skeleton, a file outline, or one symbol — instead of reading whole files. A stateless, tree-sitter-based CLI.

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

README

ast-outline

**English** · [Русский](./README.ru.md) · [简体中文](./README.zh-CN.md)

Your AI coding agent reads whole files to understand code. **`ast-outline` lets it pull exactly what it needs** — a whole-repo skeleton, a single file's outline, or one symbol's body — instead of reading files in full. One stateless, tree-sitter-based CLI: map a repo, outline a file, show a symbol, structural-grep for usages, trace imports. Cheaper, faster agent runs that don't drown in large codebases.

[![tests](https://github.com/ast-outline/ast-outline/actions/workflows/tests.yml/badge.svg)](https://github.com/ast-outline/ast-outline/actions/workflows/tests.yml) [![Code: Apache 2.0](https://img.shields.io/badge/code-Apache%202.0-blue.svg)](./LICENSE) [![Docs: CC BY 4.0](https://img.shields.io/badge/docs-CC%20BY%204.0-lightgrey.svg)](./LICENSE-DOCS) [![PyPI](https://img.shields.io/pypi/v/ast-outline.svg)](https://pypi.org/project/ast-outline/) ![Python: 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)

📖 **Full documentation:**


Why

LLM coding agents (Claude Code, Cursor agent mode, Aider, Codex CLI, Gemini CLI, Copilot Chat) explore codebases by **reading files directly**. Reliable, but wasteful in two ways: a 1200-line file costs 1200 lines of context just to answer *"what methods are in here?"* — and once the noise is in context, the agent has to wade through it to find the part that actually matters. Token cost goes up, comprehension goes down.

`ast-outline` is a pre-reading layer. The agent calls it first, gets the file's shape in 60–100 lines, and only opens the bodies it actually needs. The win is double: **fewer tokens** in context, and **sharper comprehension** — less noise to filter through means the agent locks onto the relevant code faster and answers with less drift.

**Before:**

Agent: Read Player.cs              # 1200 lines, just to see what's here
Agent: Read Enemy.cs               #  800 lines