From all possible concerns, "giving access to anthropic/openai" to your "secret sauce" is the least important one for 99% of the companies out there.
No, is not way better to simply write the code yourself. Most of the code is written faster and better with Claude Code or equivalent. Very niche code is better written by hand. Even then, you're probably better off nudging something like Claude Code in the direction you need it to go. There's nothing interesting about writing it yourself unless you're still learning to code (in which case is a learning exercise for you, not only about the outcome).