treesitter

Parse source files to extract functions, classes, and symbols into structured JSON.

1|Updated Nov 12, 2025
One-click install
npx skills add https://github.com/grahama1970/fetcher --skill treesitter
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: treesitter
Source: https://github.com/grahama1970/fetcher/tree/main/.agents/skills/treesitter
Command: npx skills add https://github.com/grahama1970/fetcher --skill treesitter

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Developers need a reliable method to discover functions, classes, and other code symbols across files and projects to understand structure and navigate large codebases.

Core Features & Use Cases

  • Symbol extraction: identify functions, classes, methods from single files or directories.
  • Language-agnostic: automatically detects languages and can output symbol metadata for downstream tooling.
  • Integration-ready: works well with editors and Distill workflows for parameterizing code blocks.

Quick Start

Run the run.sh symbols on a target file or scan a directory to export symbols in JSON.

Frequently Asked Questions about treesitter

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

FAQPage Schema
How do I extract functions and classes from source code files?

You can extract functions and classes from source code files by parsing them with tree-sitter to map symbol hierarchies. This process identifies code structures across single files, directories, or snippets and outputs structured JSON metadata for downstream tooling.

What is the best way to parse code structure across multiple programming languages?

Parsing code structure across multiple programming languages is best handled by tree-sitter, which automatically detects languages and extracts symbol metadata. It provides a language-agnostic method to map functions and classes from diverse source files into structured JSON.

Can I extract code symbols from an entire project directory?

Yes, you can extract code symbols from an entire project directory by running the symbol extraction script on the target folder. It scans the directory to map symbol hierarchies and outputs structured JSON containing the discovered functions, classes, and methods.

Does tree-sitter symbol extraction require language-specific configuration?

No, tree-sitter symbol extraction does not require language-specific configuration because it automatically detects the language. It can operate on individual files, folders, or code snippets to map symbol hierarchies without manual setup for each programming language.

How do I get structured JSON output from parsed code symbols?

To get structured JSON output from parsed code symbols, run the extraction script on your target files or directories. The parsing process identifies functions, classes, and methods, then formats these symbol hierarchies into structured JSON ready for downstream tooling.

When do I need to map code symbol hierarchies for downstream tooling?

You need to map code symbol hierarchies for downstream tooling when integrating code structure analysis into editors or Distill workflows. Extracting symbols into structured JSON allows other tools to navigate large codebases and parameterize code blocks effectively.