ast-grep vs searchcode
ast-grep
ast-grep.github.iosearchcode
searchcode.comSide by side
| Figure | ast-grep | searchcode |
|---|---|---|
| Price from | Free | Free |
| Free plan | Yes | Yes |
| Free trial | — | — |
| Open source | — | — |
| Web | Yes | Yes |
| Windows | Yes | — |
| macOS | Yes | — |
| Linux | Yes | — |
| API | Yes | Yes |
| Self-hosted | — | Yes |
| Plans published | 1 | 1 |
| Spec score · Code Search Tools | 9.1 (#1) | 7.7 (#17) |
| Integrations | The documentation describes editor integrations, including a VS Code extension and language server support for editors such as Vim and Neovim. | Setup instructions are provided for Claude Code, Claude Desktop, Cursor, VS Code/Copilot, Gemini CLI, Amp, OpenCode, Crush, Codex and LM Studio. |
| Purpose | ast-grep is a fast, polyglot tool for structural code search, linting, and rewriting at scale. | Searchcode provides code intelligence dossiers for public GitHub repositories, including languages, complexity, tech stack and code quality. |
| Support | The project directs users with questions or issues to GitHub or Discord and also points to Stack Overflow and Reddit. | Support is available by email at [email protected]. |
Plans
In their own words
ast-grep
ast-grep is a free, open-source tool for structural code search, linting, and rewriting. It matches patterns against syntax-tree nodes, helping developers locate and change code across a codebase rather than searching plain text. Its CLI can preview and apply rewrites interactively, and scan configurable YAML rules with error, warning, info, or hint severity. Rules can combine pattern, kind, regex, relational, and composite conditions, and CLI commands help create and snapshot-test them. The project says it supports more than 20 languages and can load custom languages. JavaScript and WebAssembly APIs allow programmatic syntax-tree work; a browser playground offers a way to try patterns without local installation. Editor options include a VS Code extension and language-server setups, including for Vim and Neovim. The tool is free, has a web interface, and is distributed through package managers or built from source. Its FAQ notes that some advanced static-analysis information is unsupported, and one rule cannot target multiple languages at once.
searchcode
searchcode provides code-intelligence dossiers for public GitHub repositories, covering languages, complexity, technology stacks, code quality, and secrets. Its MCP server exposes six tools for AI assistants, and each tool is also available as JSON over HTTP through the REST API. Analysis reports language breakdowns, complexity metrics, detected technologies, quality findings, and credentials such as API keys, tokens, and private keys with file, line, and confidence details. Search supports full text, boolean logic, regular expressions, and structural filters for declarations, usages, strings, and comments. File retrieval can return complete files, line ranges, or named symbols with nearby declarations; batch retrieval handles up to 10 files. The free beta plan covers public GitHub repositories without signup, an API key, or installation. Enterprise deployment runs on customer infrastructure as a Docker image with a Kubernetes Helm chart. Private repositories can authenticate with SSH keys or HTTPS tokens.