logoalt Hacker News

FooBarWidgetyesterday at 6:25 AM3 repliesview on HN

Does anyone have any suggestions on making Claude prefer to use project internal abstractions and utility functions? My C++ project has a lot of them. If I just say something like "for I/O and networking code, check IOUtils.h for helpers" then it often doesn't do that. But mentioning all helper functions and classes in the context also seems like a bad idea. What's the best way? Are the new Skills a solution?


Replies

chickensongyesterday at 10:14 PM

Skills seem like the way forward, but Claude still needs to be convinced to activate the skill. If that's not happening reliably, hooks should be able to help.

A sibling comment on hooks mentions some approaches. You could also try leveraging the UserPromptSubmit hook to do some prompt analysis and force relevant skill activation.

cannonpalmsyesterday at 7:12 PM

I wonder how well a sentence or two in CLAUDE.md, saying to search the local project for examples of similar use cases or use of internal libraries, would work.

sshh12yesterday at 6:34 AM

Hooks can also be useful for this. If it's using the wrong APIs then can hint on write or block on commit with some lint function that checks for this.