Who it is forA developer who wants a quick structural search that grep cannot do.
The problemPlain text search cannot match code by structure, such as the same expression on both sides of a comparison.
The outcomeA list of matches in your source folder for the pattern you wrote.
What you need first
- Python and pip, or pipx, uv, Homebrew or Docker
- A project directory to scan
- Optional free Semgrep account for extra rules
Steps
- Install with
pipx install semgrep - Run
semgrep -e '$X == $X' --lang=py path/to/src, using your own source path - Read each match, which is a Python comparison with identical sides and a possible bug
- Change the pattern and rerun to look for other shapes
Prompt for your agent
Using semgrep/semgrep, install it with `pipx install semgrep` and run `semgrep -e '$X == $X' --lang=py path/to/src` on my code. Summarise each match and say which look like real bugs.
Caveat. This card is written from the semgrep/semgrep README, not from a test run by Deduped. Before you start, make sure you have Python and pip, or pipx, uv, Homebrew or Docker. Check the repo for newer instructions before you rely on these steps.
Use this in your AI agent
Ask your agent
Using the Deduped MCP, get the setup steps for semgrep/semgrep and "Search your code for a bug pattern in one command"
Add Deduped to Claude Code once
claude mcp add --transport http deduped https://dedupedai.com/mcp
Every Monday: the 5 hottest repos and exactly how to use them. Free, one email a week, unsubscribe anytime.
Get them freeShare: X LinkedIn Hacker News Email Copy link
Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer