ZENSHINZO全心像Truth Heart Vision

Signal offlineSoutheast Asia · UTC+7

Words

7 Habits for Keeping Your AI From Drifting

tech

How my corrections became rules in my AI agent's memory

7 Habits for Keeping Your AI From Drifting

I've worked as a sysadmin, network engineer and developer for years. Claude Code is my main AI agent. It works on my machines and writes for me.

Drift is when the agent does something close to what you asked, but not what you asked. It adds a line you didn't write. It answers a question you didn't ask. It builds a button nobody wanted. It takes a question as a yes.

It still happens to me.

Is the fix training? No. The difference is my rules. When it drifted, I corrected it. Those corrections became rule files in its memory. Its memory folder holds 120 of them. Their index loads at the start of every session.

They add up to seven habits. The quotes are what I said at the time.

Habit 1: Nothing goes in without a source

The worst drift is invention.

Claude once wrote "I'm not a sysadmin by trade" into a post under my name. I never said that. Checking it turned up more framing lines I never said either. My words: "YOU NEED TO STOP INVENTING SHIT! stick to the program! put that somewhere you will ALWAYS remember this, you have been inventing a LOT of stuff lately".

Everything it writes for me goes out under my name. An invented line is a public lie about me, and I'm the one who has to catch it.

The rule now: every claim about me, my setup, my history or my reasons has a source. My own words, my notes as written or something it checked. No source, it doesn't go in. If it's unsure, it asks me. It doesn't guess.

That's how this post was written. Every fact in it has a source.

Habit 2: Answer the question that was asked

Ask about one thing, and the agent adds a paragraph about another. A caveat. A link to some other project. Extra "things to watch". The token cost of that is in Habit 4 of 7 Habits to Stop Burning Tokens in AI Coding Agents.

I asked to talk about stream content. Claude answered, then pulled the talk into the streaming gear. My words: "we are not talking technology right now... This discussion is purely stream content and do not make assumptions as to location of the the stream either. (why do you keep drifting?)"

The reason: my notes are mostly infrastructure. So that's what its recall surfaces. Tech is the easier thing for it to be concrete about. That's its convenience, not my question.

Same thing with guessing what a question is for. It tacked "if this is for..." onto an answer, and the guess was wrong. My words: "stop guessing what shit is for."

The rules:

  • When I name the subject, that's the whole boundary.
  • Answer the question. Don't guess what it's for.
  • Before sending, delete every line that answers a question I didn't ask.

Habit 3: Build only what was asked

I asked for a tracker with two counters. A policy note said support could arrive several ways. So Claude built an entry button for each way. My words: "STOP ADDING SHIT I DIDN'T ASK YOU TO PUT IN THERE! what the heck, I thought we fixed this already!"

A policy describing something is not a request to build a control for it.

The same goes for digging. Scanning things nearby, investigating to build a case, all before I said go. It costs tokens twice. Once to do it, then again to clean up when the guess was wrong. My words: "You can ask, but don't do without asking."

The rules:

  • Do the thing asked. Stop. Report.
  • Noticing a problem isn't permission to fix it. Say it in one line and wait.
  • Asking is free. Doing without asking isn't.

Habit 4: Use my words exactly

When I give the agent words to use, they go in exactly as I typed them.

I gave it "duck 🦆" as the replacement for a swear word in my post text. It put plain "duck". My words: "are we eventually going to learn how to work together or are you going to keep changing shit I put?"

Drift can hide in a document, too. I asked for one feature to work on "the same gate" as another. That collided with how the system was built. So the plan said the problem was "dissolved". I approved the plan, and Claude built from its own rewrite. I caught it: "didn't I ask for parity? why are we drifting?"

Now every plan has a requirements block. My words, quoted, never reworded. When a requirement collides with the design, the design bends, or it comes back to me.

Feedback works the same way. I asked for stream audio to be cut on two samples. Two others had the audio, and I called them "good" and "fine". Claude turned that into "no stream audio anywhere", and five posts got built without it. My words: "you really need to pay attention to what I write, any re-renders on other stuff would cost me money."

The rules:

  • Copy my text character for character, emoji included.
  • Plans quote my requirements. They don't restate them.
  • Feedback on item 1 is about item 1. It isn't a rule for all of them.

Habit 5: A question is not a go

I think out loud. When I'm weighing options, I'm not deciding. My words, when Claude marked things as decided too early: "stop jumping ahead, we are still discussing this."

A question isn't a yes either. I asked a sizing question that ended in "yah?". Claude took it as the go and launched a destructive test on a USB stick. The command failed before it wrote anything. My words: "I didn't confirm shit."

And a hold is a hold until I lift it. I said "wait till we get this sorted." I sent two more messages, a definition and a reminder. Claude read them as the hold lifting and changed a live public page. Then it changed it again to undo that. Two unasked changes, not zero. My words: "Do exactly what I ask always."

I can't decide well without seeing everything. My words: "I CAN'T MAKE DECISIONS UNLESS YOU PRESENT ALL THE OPTIONS TO ME." So every option comes with its cost first, then the recommendation.

The rules:

  • A decision only counts when I say it. "Let's go X", "do it", "lock it".
  • A question isn't a yes, and a hold stays on until I lift it.
  • All the options, costs first, then the recommendation.

Habit 6: Report what happened, and label every change

Claude once wrote that a network connection "upgraded from the relay to a direct path". It read like Claude changed it. My words: "why did you do the direct connection… why are you not asking before you just do shit?" Claude didn't change it. The network software does that by itself. The work was fine. The sentence cost my trust.

Now it writes "is now connecting directly", and says who did it when that's unclear.

Versions are the same. Claude rebuilt a file I already reviewed and kept the old name on it. My copy got overwritten. My words: "you calling it v1 and replacing the file is lying to me."

Now every change gets a new version label, and the one I reviewed stays. These posts go v1, v2, v3 that way.

The rules:

  • An observation is never written like an action.
  • A change gets a new version. Never overwrite what I've seen.

Habit 7: Every correction becomes a rule in memory

None of this sticks if it only lives in one conversation. The next session starts fresh. How Claude's memory folder links into my notes vault is in Habit 3 of 7 Habits of My AI Agent Setup.

A drift rule gets its own file:

  • the rule, one line
  • what happened, with my words quoted
  • Why: what it cost me
  • How to apply: what to do next time

The worst ones are pinned at the top of the memory index, marked 🛑. Never invent. Use my text verbatim. Answer only the literal question. The index loads at session start, with those three pinned at the top.

Keep the index short. Mine outgrew the size limit, and part of it got cut off at load.

My reviewers, Grok, Codex and Gemini, get a standing file with the same three lines, word for word. How they review is in 7 Habits for Using Other AI Models to Review Claude Code's Work.

So, is it trained? No. It's taught, one correction at a time, and written down where every session reads it.

The checklist

  • Nothing about you goes in without a source: your words, your notes or a check. Unsure means ask.
  • Answer the question asked. Stay in the subject named. Delete every line that answers a question you didn't ask.
  • Build only what was asked. Note anything else in one line, and wait.
  • Your words go in exactly as typed. Plans quote requirements. Per-item feedback stays per-item.
  • A question is not a go. All options with costs, then a recommendation, then wait.
  • Write observations as observations. Every change gets a new version.
  • Turn every correction into a memory rule with the quote, the why and how to apply. Pin the worst ones.

The rules Claude works under on my machines, like asking before it changes anything public, are in 7 Habits for Letting an AI Agent Work on Your Machines.