Simple Control Flow for Automatically Steering Agents
4 points by MrFantastik
4 points by MrFantastik
One of these control flows in Claude Code, is that the program (cc) will prohibit the model from editing a file if it did not read it yet. My guess is that this improves the quality of the output by a "ton".
One of the flows I want, is to be able to "remind" the AI about something. For example, I use "yarn compile:lib" and "yarn compile:binary" to compile my Rust code. After working for a while, claude will bounce back to using "cargo check ..." as it forgets/neglects previous context.
So the flow will be -> detect "cargo check" usage -> message: no, you should use "yarn compile:lib"
would you put it into System Prompt or "Custom Instructions." Then it is fed to the model with every new message, constantly "reminding" it.
That's not a scale-able approach. What if you have ~500 or so of these conditions? Now you are polluting your system prompt.
Have you taken a look at hooks? You could have one that runs on cargo, preventing it from running that command and returning a message to use yarn.
Last time I tried to customize them, they were quite buggy and hard to program. I'll give it another shot as Claude Code has gotten several updates since then.
I’ve found them imperfect but have a few to ensure no cding happens, files are linted and meet standards, etc and they do provide some value