jsongrep: A DFA-Based JSON Query Tool That Outperforms jq in Benchmarks

What jsongrep Does
jsongrep (jg binary) takes a query and a JSON input and prints every value whose path through the document matches the query. It treats JSON documents as trees where objects and arrays branch, scalars are leaves, and keys and indices label the edges. The query language is a regular language over the alphabet of keys and indices.
Query Language Features
Dot paths select nested fields by name: jg 'roommates[0].name' returns roommates.[0].name: "Alice".
Wildcards match any single key (*) or any array index ([*]): jg 'favorite_drinks[*]' returns all array elements.
Alternation (|) matches either branch: jg 'name | roommates' returns both fields.
Recursive descent uses * and [*] inside a Kleene star to walk arbitrarily deep: jg '(* | [*])*.name' finds every name field at any depth. The -F flag provides shorthand: jg -F name does the same.
Optional (?) matches zero or one occurrence: jg 'roommates[0].favorite_food?' returns both the parent object and the field value.
Technical Approach
jsongrep compiles queries into deterministic finite automata (DFA) using a pipeline that includes: parsing the query, treating JSON as a tree, constructing an NFA using Glushkov's algorithm, determinizing via subset construction, and searching using DFS with DFA transitions. This allows processing in a single pass with O(1) work per input symbol, avoiding backtracking, recursion stacks, and exponential blowup on pathological queries.
The author notes this differs fundamentally from tools like jq, jmespath, or jsonpath-rust, which interpret path expressions, evaluate queries at each node, check predicates, and recursively descend—potentially revisiting subtrees or maintaining worklists with recursive descent queries.
Installation and Availability
Install from crates.io: cargo install jsongrep. Like ripgrep (which inspired the project), jsongrep is cross-platform with binaries available and written in Rust.
The tool detects if output is piped to commands like less or sort and omits JSON paths by default (override with --with-path option).
📖 Read the full source: HN LLM Tools
👀 See Also

MTPLX: 2.24x Faster Tokens on Apple Silicon Using Native MTP Heads
MTPLX achieves 63 tok/s on Qwen3.6-27B on M5 Max (up from 28 tok/s) using built-in MTP heads, with exact temperature sampling and no external drafter.

OpenClaw Skill Reduces Accessibility Tree Tokens from 600K to 1.3K
A developer built an OpenClaw skill that uses ML-based element ranking to prune accessibility trees, cutting slickdeals.com from ~598K tokens to ~1.3K tokens by keeping only the top ~50 actionable elements.

Claude Code Container Provides Zero-Config Docker Isolation for Claude Code
Claude Code Container (ccc) is a free, open-source tool that automatically creates per-project Docker containers for Claude Code with full isolation and zero configuration. It forwards host environment variables, mounts SSH keys, provides transparent localhost proxy, and includes Chromium with chrome-devtools MCP pre-configured.

Hyper iOS App: Voice Recorder with Real-Time Transcription and Action Extraction
Hyper is an iOS voice recorder app that transcribes conversations in real-time, provides summaries and action items, and allows mid-conversation queries via wakeword detection. It's designed for unstructured meetings like 1:1s, coffee chats, and standups.