Codemod grep: Structural code search across public GitHub repos

✍️ OpenClawRadar📅 Published: August 23, 2026🔗 Source
Ad

Codemod grep is a new code search engine that works on structure rather than plain text. It uses ast-grep pattern syntax to match code by its syntax tree shape, so you can find patterns across public GitHub repositories that regex or text search would miss.

What makes it different

Instead of searching for exact strings or fuzzy regex matches, you write patterns that represent code structure. For example, the pattern console.log($MSG) will match any console.log call with any argument. Similarly, $A.$B($C) matches any method call on any object with a single argument, and await $EXPR finds any awaited expression.

The tool also supports structural search for HTML patterns, like finding <img> tags without an alt attribute — something that's tricky with regex but trivial with structural matching.

Ad

How to use it

The interface is simple: you enter an ast-grep pattern in the search box, optionally switch to YAML rule mode for more complex conditions, and hit search. There's also a regex mode for traditional string matching, and an "Ask AI" feature for natural language queries.

Under the hood, it leverages the exact same pattern syntax used by ast-grep's CLI, so if you already know how to write ast-grep rules, you can reuse those skills here. For a quick start, the homepage offers example patterns like console.log($MSG), $A.$B($C), and await $EXPR.

Who this is for

This will appeal to developers who work on large codebases, perform cross-repository refactoring, or need to audit code patterns across the open-source ecosystem. It's also a great way to discover how certain APIs are used in practice.

Head over to grep.codemod.com to try it out with your own patterns.

📖 Read the full source: HN AI Agents

Ad

👀 See Also