Hacker News new | ask | show | jobs
by kmac_ 422 days ago
I'm using AI for grepping, analyzing flow, finding cross-project dependencies, etc. It provides a significant speedup. But the generated code is mediocre at best. Changes look like patches on fabric, not woven threads. AI generates too much redundant code.
2 comments

One other use-case I've found effective for it is assisting with API development and defining API specs. For example, I've uploaded API definitions in YAML and previously provided instructions about the API standards I want to impose and to ensure consistency as I build new things, this saves some degree of effort between writing -> linting -> fixing -> linting again if I have it just validate and fix any minor inconsistencies.
How do you use AI to grep?
Grepping is an oversimplification: I ask for specific use cases, for listing all code paths that perform some action, etc. It works really well.
How though? Do you setup RAG for this? Large context window? What do you use?
I started with Repomix as an MCP server plus system prompt to reduce the scope to single packages. However, it still consumed too many tokens (and polluted the context with useless information). I used Gemini, context size wasn't an issue, but it was too expensive. Now I just use Cursor, it has built-in indexing with embeddings (I assume).
Try Claude Code. It’s perfect for this type of use case.
Maybe for translating a natural language query into a regular expression that can be ingested by grep.
Oh god no. Then you have three problems: ai, regular expressions, and your original problem.