AST-GREP llms.txt · AI Docs Browser · mdream

[llms.txt Tools](https://mdream.dev/llms-txt/ast-grep/llms-txt)

# AST-GREP llms.txt

Browse AST-GREP documentation as markdown. Click any page in the sidebar to view it, or copy the full llms.txt for your AI tools.

ast-grep.github.io/llms.txt

[Raw llms.txt](https://ast-grep.github.io/llms.txt) [Raw llms-full.txt](https://ast-grep.github.io/llms-full.txt)

Copy Markdown [](https://ast-grep.github.io/llms.txt)

llms.txt

Table of Contents

Quick Start

Pattern Syntax

Rule Essentials

Scan Your Project!

Rewrite Code

Command Line Tooling Overview

API Usage

Atomic Rule

Relational Rules

Composite Rule

Reusing Rule as Utility

Project Configuration

Lint Rule

Test Your Rule

Handle Error Reports

transform Code in Rewrite

Rewriter in Fix

Outline Code&#x20;

Editor Integration

JSON Mode

JavaScript API

Python API

Performance Tip for napi usage

C
Cpp

Go

HTML

Java

Kotlin

Python

Ruby

Rust

TypeScript

TSX

YAML

Rule Cheat Sheet

Config Cheat Sheet

Command Line Reference

sgconfig.yml Reference

Configuration Reference

Rule Object Reference

Outline Extraction Rules

API Reference

List of Languages with Built-in Support

ast-grep Playground Manual

ast-grep run

ast-grep scan

ast-grep test

ast-grep new

ast-grep outline

Fix

Transformation Object

Rewriter

ESQuery Style Kind

Outline Rule Fields Reference

Using ast-grep with AI Tools

Frequently Asked Questions

How ast-grep Works: A bird's-eye view

Custom Language Support

Search Multi-language Documents in ast-grep

Comparison With Other Frameworks

Core Concepts in ast-grep's Pattern

Deep Dive into ast-grep's Pattern Syntax

Deep Dive into ast-grep's Match Algorithm

Find & Patch: A Novel Functional Programming like Code Rewrite Scheme

Contributing

Development Guide

Add New Language to ast-grep

Playground

define a rewriter to remove the await keyword

efine test(x) (2*x)

ensure it only matches modal/tooltip but not tag

find the barrel import statement

find-all-imports-and-identifiers.yaml

or without fixer

Pattern 1: Rails.root.join with variable

rewrite Optional[T] to T | None

Should not be transformed

TODO:

Untitled

Untitled

Untitled

Untitled

Untitled

Untitled

Untitled

Untitled

Untitled

Untitled

Untitled

Untitled

Untitled

Untitled

Untitled

Untitled

Untitled

Untitled

Untitled

Untitled

Untitled

Untitled

Untitled

Untitled

Untitled

Untitled

Untitled

Untitled

Untitled

Untitled

Untitled

Untitled

Untitled

Untitled

Untitled

Untitled

Untitled

Untitled

Untitled

Untitled

Untitled

Untitled

## What is AST-GREP's llms.txt?

AST-GREP publishes an `/llms.txt` file that provides AI systems with a structured index of its documentation. It follows the [llms.txt specification](https://llmstxt.org), organizing links to guides, API references, and tutorials under section headings so that LLMs like ChatGPT, Claude, and Gemini can quickly understand what AST-GREP offers and where to find details.

Issues

Spec

1

Sections

121

Links

7.2 KB

Size

~1.8k

Tokens

Sections: Table of Contents

## Add AST-GREP Docs to Your AI Assistant

Select your tool to see how to add AST-GREP's llms.txt as a documentation source.

Cursor

 Windsurf

 Claude Code

 ChatGPT

 Zed

 Copilot

1. 1

   Open any chat or composer panel
2. 2

   Type @Docs and select "Add new doc"
3. 3

   Paste the URL: https://ast-grep.github.io/llms.txt
4. 4

   Wait for the green dot (indexing complete)
5. 5

   Reference @Docs in chat when asking about AST-GREP

Cursor crawls the URL and indexes all subpages. Add a trailing slash to index child pages too.

## Spec Compliance 18 errors

## Frequently Asked Questions

Where is AST-GREP's llms.txt file?

AST-GREP publishes its llms.txt at https://ast-grep.github.io/llms.txt. This file provides a structured, markdown-formatted index of AST-GREP's documentation that AI systems can consume to understand the project's APIs, guides, and references.

How do I use AST-GREP's llms.txt with AI coding assistants?

Copy the llms.txt content and paste it into your AI assistant (Cursor, Windsurf, Claude, ChatGPT) as context. This gives the AI an accurate map of AST-GREP's documentation so it can provide better code suggestions and answers about AST-GREP.

What does AST-GREP's llms.txt contain?

AST-GREP's llms.txt contains 1 sections and 121 documentation links in 7.2 KB (~1.8k tokens). Key sections include Table of Contents.

How many tokens does AST-GREP's llms.txt use?

The concise llms.txt index is approximately 1.8k tokens (7.2 KB). Most AI assistants can fit this within their context window. For the full expanded documentation, look for an llms-full.txt variant which embeds all content inline.

What is AST-GREP?

Find Code by Syntax. AST-GREP's llms.txt file helps AI systems understand this by providing a structured overview of its documentation, making it easier for developers to get accurate AI-assisted help when working with AST-GREP.

Can I generate an llms.txt for my own project?

Yes. Use the free llms.txt generator at mdream.dev/tools/llms-txt/generator to crawl your site and produce a spec-compliant llms.txt file. You can also validate existing files with the llms.txt validator.

## Browse More llms.txt Files

[XState State machines and statecharts for the modern web. XState is a JavaScript/TypeScript library for creating state machines, statecharts, and actors.](https://mdream.dev/llms-txt/ast-grep/llms-txt/xstate) [Convoy The Cloud Native Webhooks Gateway](https://mdream.dev/llms-txt/ast-grep/llms-txt/convoy) [Chainlit Build Conversational AI in minutes ⚡️](https://mdream.dev/llms-txt/ast-grep/llms-txt/chainlit) [Font Awesome Docs Official documentation for Font Awesome icons.](https://mdream.dev/llms-txt/ast-grep/llms-txt/font-awesome) [Finch](https://mdream.dev/llms-txt/ast-grep/llms-txt/finch) [Gogs: A painless self-hosted Git service Gogs is a painless self-hosted Git service](https://mdream.dev/llms-txt/ast-grep/llms-txt/gogs) [OpenClaw 从入门到精通 | OpenClaw Guide 最新Docker容器技术，从真实案例中学习最佳实践！| Learn and understand Docker&Container technologies, with real DevOps practice!](https://mdream.dev/llms-txt/ast-grep/llms-txt/docker-practice) [Elastic Documentation Elastic provides an open source search, analytics, and AI platform, and out-of-the-box solutions for observability and security. The Search AI platform combines the power of search and generative AI to provide near real-time search and analysis with relevance to reduce your time to value.](https://mdream.dev/llms-txt/ast-grep/llms-txt/elastic)

[View all 99 projects ](https://mdream.dev/llms-txt/ast-grep/llms-txt)

## Related Tools

[<h3>llms.txt Generator</h3>Generate an llms.txt for your own project.](https://mdream.dev/llms-txt/ast-grep/tools/llms-txt/generator) [<h3>llms.txt Validator</h3>Validate your llms.txt against the official spec.](https://mdream.dev/llms-txt/ast-grep/tools/llms-txt/validator)

© 2026 [Harlan Wilton](https://github.com/harlan-zw) · [MIT](https://github.com/harlan-zw/mdream/blob/main/license)

[GitHub](https://github.com/harlan-zw/mdream) [Discord](https://discord.com/invite/275MBUBvgP)