How to Search Hacker News from Codex CLI
Codex CLI is great at reasoning about code, but it can’t tell you what developers actually think about a library, framework, or tool. Hacker News is one of the best sources for unfiltered developer opinion — and with AgentPatch connected, Codex can search it directly.
The hackernews-search tool queries HN stories and comments via Algolia. You can filter by type (stories, comments, or both), sort by relevance or date, and scope results to a specific time range. Codex gets structured results back and can reason over them in context.
Why This Matters
Stack Overflow tells you how to use something. Hacker News tells you whether you should. When you’re evaluating a new database, picking between ORMs, or deciding if a framework is production-ready, the most useful signal often comes from developers who’ve already tried it and are talking about their experience.
That information exists on HN, but searching manually and reading through threads takes time. Codex can do the search, pull the relevant threads, and summarize the consensus — all while you stay in the terminal working on your project.
Setup
The AgentPatch CLI is designed for AI agents to use via shell access. Install it, and your agent can discover and invoke any tool on the marketplace.
Install (zero dependencies, Python 3.10+):
pip install agentpatch
Set your API key:
export AGENTPATCH_API_KEY=your_api_key
Example commands your agent will use:
ap search "web search"
ap run google-search --input '{"query": "test"}'
Get your API key from the AgentPatch dashboard.
Add AgentPatch to ~/.codex/config.toml:
[mcp_servers.agentpatch]
url = "https://agentpatch.ai/mcp"
bearer_token_env_var = "AGENTPATCH_API_KEY"
Then set your API key:
export AGENTPATCH_API_KEY=your_api_key
Replace your_api_key with your actual key from the AgentPatch dashboard. Codex discovers all AgentPatch tools automatically on next start.
Example
You’re considering switching from Prisma to Drizzle ORM and want to know what developers are saying about the migration:
“Search Hacker News for discussions about switching from Prisma to Drizzle ORM. Focus on stories from the past year, sorted by relevance.”
Codex calls the hackernews-search tool and comes back with a summary:
Found 12 relevant HN stories about Prisma vs Drizzle.
Key themes from the discussions:
1. Performance: Multiple commenters report significant query performance
improvements after switching to Drizzle, especially for complex joins.
2. Type safety: Both are well-regarded, but Drizzle's approach maps closer
to raw SQL, which experienced developers seem to prefer.
3. Migration path: Several threads mention that the migration is
straightforward for simple schemas but gets tricky with Prisma's
relation syntax. One commenter shared a migration script.
4. Ecosystem: Prisma still has better documentation and more middleware
options. Drizzle's ecosystem is growing fast but thinner.
Want me to dig into any of these threads for more detail?
You follow up:
“Find recent comments specifically about Drizzle’s performance with PostgreSQL. Sort by date so I get the latest takes.”
Codex searches again, this time filtering to comments and sorting by date, and gives you the freshest developer experiences. You’re making a more informed decision without opening a browser.
Wrapping Up
With AgentPatch connected, Codex can tap into Hacker News alongside every other tool on the marketplace — web search, news, email, and more. One connection, full access. Check out what’s available at agentpatch.ai.