DEV Community

QuoLu
QuoLu

Posted on

Stop Telling Claude to 'Be Careful': Reinforcing It from the Outside with 3 Tools

Over the past month or so, I have released three reinforcement tools for Claude Code on npm.

  • Throughline — Offloads bloated context.
  • Caveat — Surfaces past notes so you don't step into the same trap twice.
  • Spotter — A separate Claude audits missed tool calls.

Each solves a different problem, but the root cause is the same: all the problems that could be fixed by telling Claude to "be careful" had already been fixed. What remained were issues that could not be fixed structurally.

The period of constant "be careful" warnings

In the beginning, I also wrote plenty of "be careful" instructions in CLAUDE.md and my prompts.

"Do not guess files, always read them before answering."

"If the context becomes bloated, run /compact."

"Read the traps I've fallen into in the past, which are written in CLAUDE.md."

But the more I wrote, the more bloated CLAUDE.md became. A bloated CLAUDE.md just gets skimmed by Claude. Even though it's written there, it isn't followed.

I thought maybe my writing style was poor, so I changed the phrasing. Still, it didn't work. I realized there is a certain number of problems that simply don't go away no matter how many times you change the way you phrase them.

Problems that can be fixed vs. problems that cannot

One day, I drew a line in the sand.

Problems that can be fixed by writing "be careful" and those that cannot are fundamentally different types of issues.

Problems that can be fixed by writing instructions occur because Claude simply "forgot." If it sees the instructions, it remembers. This can be handled by improving the prompts.

Problems that cannot be fixed occur because Claude cannot recognize its own limitations.

  • It cannot notice that the context is bloated (it's decided at the moment the request is sent, so it can't see its own size).
  • It doesn't remember traps encountered in past sessions (sessions are independent, and adding to CLAUDE.md makes it heavy).
  • It doesn't notice when it forgets to call a tool (it doesn't know what it doesn't know, so it can't go get it).

Asking Claude to "be careful" about these things doesn't work. It's because these are problems Claude itself cannot fix.

Giving up and reinforcing from the outside

So, I stopped asking Claude and started intervening from the outside.

Claude Code has a hook mechanism. You can insert hooks before sending prompts, after a tool runs, or when a session ends. Even if Claude itself doesn't notice, you can observe the state from the outside and inject the necessary processing.

Since realizing this, I have created three reinforcement tools.

Throughline (Subtraction)

To address the issue of context bloating, it offloads tool inputs and outputs to SQLite and removes them from the context.

The contents of read files, grep results, and Bash outputs—once the AI has used them to make a decision and moved on, their purpose is fulfilled. Yet, they remain until the end, consuming tokens. I use hooks to offload these to SQLite. If Claude needs them, it can retrieve them itself.

I have completely removed the burden of "noticing the bloating" from Claude.

Caveat (Accumulation)

To address the issue of falling into the same trap twice, it automatically surfaces trap notes written in the past during similar situations.

When I fall into a trap, I write it down in Markdown. The next time I send a similar prompt, receive a similar tool error, or when a "struggle signal" is observed at the end of a session, the relevant past notes are injected into Claude's context via hooks.

I have removed the burden of "remembering past traps" from Claude.

Spotter (Addition)

To address the issue of forgetting to call tools, I run another Claude side-by-side that has a perfect grasp of the tool catalog and points it out if a call is forgotten.

The main Claude works as usual. Another Claude (Haiku 4.5) resides alongside it, watching the user's input and final response. If it notices, "You could have answered this by using web_search," it sends a pointer to the main Claude via a hook.

I have removed the impossible burden of "realizing what you forgot to call" from Claude.

Common patterns

What these three have in common is a design that expects nothing from Claude itself.

Throughline Caveat Spotter
What is not asked of Claude Context management Past memories Detection of missed steps
Who does it instead hook & SQLite hook & past notes hook & separate Claude
Changes needed for Claude None None None

The fact that "changes needed for Claude" is zero is important. You can just write what you want to write in prompts and CLAUDE.md as usual. You don't increase the number of "be careful" warnings.

Structural problems not yet reinforced

It's not that I'm satisfied because I made three. There are still structural problems I want to fix.

  • Long-term role drift: The problem where Claude's persona drifts during long sessions. Even if I write "You are a strict reviewer" in the prompt, it becomes soft after 20 turns.
  • Context loss through sub-agents: Sub-agents spawned by the Task tool do not have the implicit context of the parent session. It is quietly painful to pass the same explanation to the child every time.
  • Tool selection accuracy: The judgment of "which tool to use" among multiple options is sometimes sloppy. Spotter detects missed calls, but it doesn't detect wrong tool selection.

Conclusion

I have already fixed all the problems that can be solved by telling Claude to "be careful." The remaining problems are of a type that Claude itself cannot fix.

That's why I reinforce from the outside. Just insert it with hooks. Claude itself doesn't need to know anything.

Having created three of these in a month, I feel I've seen the pattern for reinforcement. All three are on npm under MIT, so if you are troubled by the same structural problems, please take a look if you feel like it.

Top comments (0)