I don't remember the last time Claude Code hallucinated some library, as it will check the packages, verify with the linter, run a test import and so on.
Are you talking about punching something into some LLM web chat that's disconnected from your actual codebase and has tooling like web search disabled? If so, that's not really the state of the art of AI assisted coding, just so you know.