Agent skill
treesitter
Parse and extract code symbols using tree-sitter. Use when you need to extract functions, classes, or understand code structure from files or code blocks.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/data/treesitter
Metadata
Additional technical details for this skill
- short description
- Parse code with tree-sitter for symbol extraction
SKILL.md
Treesitter Skill
Parse code files or snippets using tree-sitter to extract symbols (functions, classes, methods).
Quick Start
# Extract symbols from a file
.agents/skills/treesitter/run.sh symbols /path/to/file.py --json
# Extract with full source code
.agents/skills/treesitter/run.sh symbols /path/to/file.py --content --json
# Scan a directory
.agents/skills/treesitter/run.sh scan /path/to/dir --json
# Parse a code snippet (writes to temp file)
.agents/skills/treesitter/run.sh parse --language python --code "def foo(): pass" --json
Commands
| Command | Description |
|---|---|
symbols <path> |
Extract functions/classes from a file |
scan <dir> |
Walk directory, summarize symbols per file |
parse --code "..." --language <lang> |
Parse a code snippet |
Options
| Option | Description |
|---|---|
--content, -c |
Include full source code of symbols |
--language |
Override auto-detected language |
--json |
Output JSON format |
--max-chunk-size |
Max chars for content chunks |
Auto-Install
This skill uses uvx to automatically install treesitter-tools from git.
No pre-installation required.
Integration with Distill
The distill skill can use treesitter to properly extract and parameterize code blocks from documents, storing them with their language and structure.
Supported Languages
Python, JavaScript, TypeScript, Go, Rust, Java, C, C++, Ruby, and more.
Language is auto-detected from file extension or can be specified with --language.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?