Hey everyone, new here but been lurking while we trial Claude Code for our team. I'm hitting a wall and hoping someone's cracked this.
We have an internal React framework that's... let's say *opinionated*. It has a specific pattern for data fetching and state management that's not like TanStack Query or Redux Toolkit. When I ask Claude Code to add a new feature or refactor something, it keeps suggesting patterns from common public libraries instead of following our internal conventions. For example, it'll try to use `useQuery` when our pattern is `useFetchResource()` with a specific configuration object shape.
I've tried:
- Adding a detailed comment at the top of the file explaining our pattern.
- Feeding it a few example files in the same chat for context.
- Being super explicit in my prompt: "using our framework's pattern where we..."
It gets it right maybe 60% of the time, but the other 40% it reverts to generic React patterns. It's frustrating because the whole point is to speed up development *within* our ecosystem.
Is there a more reliable way to "train" it on our custom patterns? Do I need to create some kind of pseudo-documentation file and always include it? Or is this just a current limitation with the context window? Curious how other teams with proprietary frameworks are handling this.