The best local models are literally right behind Claude/Gemini/Codex. Check the benchmarks.
That said, Claude Code is designed to work with Anthropic's models. Agents have a buttload of custom work going on in the background to massage specific models to do things well.