How jq recurse Works for Tree Traversal: Implementation Guide

The jq recurse filter performs depth-first tree traversal by defining a self-referential helper function that yields the current node then recursively descends through user-specified children, implemented entirely in jq's own scripting language within src/builtin.jq.

The recurse filter is one of jq's most powerful built-ins for navigating nested JSON structures. Unlike many core functions implemented in C, recurse lives as a native jq definition in the jqlang/jq repository, demonstrating the language's ability to express complex recursive algorithms using closures and self

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →