The AI workflow nobody shows you: structure, memory, and real trade-offs
There’s a difference between using AI and using AI well. The second requires you to think about what you’re doing — not just in the prompt you write, but in the structure you build around the tool.
I’ve been developing this practice over the past few months, both at work and in personal projects. What I’ve learned isn’t about which model is best or which tool has the most features. It’s about how to organize context so that AI is consistently useful — not just in the first session, but in the tenth.
The problem nobody talks about: context that disappears
Language models have no persistent memory by default. Every session starts from scratch. That means the AI that helped you make an architectural decision last week knows nothing about it today.
At first, I solved this by pasting context at the beginning of each conversation. It worked, but it was manual, tedious, and inconsistent — sometimes I forgot to include something relevant and the response felt disconnected from the actual project.
The turning point was understanding that the context problem has two dimensions:
- Static context — what the project is, how it’s structured, what the conventions are
- Dynamic context — what happened in previous sessions, decisions made, feedback given
Each requires a different solution.
CLAUDE.md: static context as code
Every project I work on with AI has a CLAUDE.md at the root. It’s a markdown file that describes the project in plain language — directory structure, how to run it locally, how to deploy, code conventions, what not to do.
When I open a session in any project, this file is loaded automatically. The AI knows what the project is without me having to explain.
This isn’t documentation for humans (that’s what the README is for). It’s context for the tool. The distinction is subtle but important: CLAUDE.md is written with the questions the AI will need to answer in mind — “where are the configuration files?”, “how does this deployment work?”, “what is this .k8s/ directory?”.
In practice, a well-written CLAUDE.md eliminates most of the orientation questions I’d otherwise need to ask at the beginning of every session.
MemPalace: dynamic context and memory between sessions
The dynamic context problem is harder. I solved it with MemPalace — a local-first memory system integrated with Claude Code via MCP (Model Context Protocol, an open standard that lets AI tools connect to external services and data sources).
The idea is simple: during a session, the AI can save memories to structured files. In the next session, those memories are available as context.
What I find most valuable:
Feedback that doesn’t get lost. When I correct the AI’s behavior (“don’t do it that way, do it this way”), that gets saved. In the next session, it already knows. I don’t need to repeat the same correction.
Project decisions. “We use Recreate instead of RollingUpdate because of SQLite” — that kind of contextual decision, which isn’t obvious from the code, gets stored as a project memory.
Work preferences. Things like “always create a branch before making changes”, “prefers small, descriptive commits”, “opens a PR for non-trivial changes” — these become default behavior, not instructions I need to repeat.
The structure MemPalace uses is hierarchical: wings (projects), rooms (topics), drawers (individual memories). It’s indexed with semantic search. In practice, it works like an externalization of working memory — not mine, the AI’s.
Prompt structure: what I’ve learned
Good results with AI depend more on prompt structure than on the model.
Some patterns that consistently work:
Context before the request. “I’m in a Hugo project with the hugo-trainsh theme, the current branch is feat/X, the relevant file is Y. I want to do Z.” Works better than just “do Z” because it eliminates ambiguity about what the AI can assume.
Atomic requests with clear intent. Instead of “improve this code”, I prefer “this snippet does X, but has problem Y, I want you to solve Z while keeping W”. The specificity of the intent filters out irrelevant suggestions.
Branch per feature. It’s not just git discipline — it’s also a signal to the AI. When I say “create a branch for this”, I’m scoping the work. The work from that session stays contained. It’s easier to review, revert, or discard.
Short iteration. I prefer to ask for small changes and review before asking for the next one, rather than sending one giant prompt with ten things to do at once. The AI is more accurate in smaller steps — and I understand what was done better.
Three workflows worth building: integrated agents
The synchronous loop — ask, AI does, review, repeat — works, but it has a ceiling. The next level is autonomous agents: flows where the AI takes a series of actions without needing your input at each step. These are three concrete workflows worth building if you work with code regularly:
Automated code review agent. For each PR opened in Gitea, an agent reads the diff, does a review focused on real problems (not style), and comments directly on the PR. Not as a replacement for human review — as a first pass that catches the obvious before I need to look.
Documentation agent. When a service changes its API, an agent detects the changes in the code and updates the corresponding documentation. The most annoying thing to keep current day-to-day.
Assisted content generation pipeline. I have an idea for a flow where external events trigger an agent that collects data, structures a draft, and publishes it for human review before it goes live. A variant of what I do manually today, but automated.
The current blocker isn’t technical — MCP and Claude’s agent APIs already support this. It’s time, and needing a use case urgent enough to be worth implementing.
What’s still a promise
Being honest about what doesn’t work well yet:
Very long context. When a session accumulates a lot of back-and-forth — many files read, many edits — response quality starts to drop. The model “forgets” the beginning. The current workaround is splitting long sessions into shorter, more focused ones, but it’s not elegant.
Judgment about what not to do. AI is good at doing what you ask. It’s less good at saying “what you’re asking for is a bad idea because of X”. Sometimes it accepts the wrong premise and perfectly executes a solution to the wrong problem. This still requires constant human supervision.
Impact estimation. “Does this change affect other parts of the system?” — still a question I need to ask explicitly, and the answer depends on how much context was loaded. It’s not automatic.
What actually changed
I don’t use AI to write code for me. I use it to speed up parts of the work that aren’t where my value lies — boilerplate, scaffolding, translations, formatting, searching through files I don’t know well.
The work that matters — understanding the problem, making architectural decisions, reviewing what was generated — still belongs to me. But I do more in less time because the mechanical part is delegated.
The insight that stuck most: AI is only as good as the context you give it. Investing in well-written CLAUDE.md files, structured memories, clear prompts — that’s not overhead. That’s the work that makes the tool consistently useful, instead of impressive the first time and frustrating the tenth.
Most people are still using AI like a search engine: one question, one answer, no continuity. The gap between that and a structured workflow isn’t technical. It’s just practice — and it compounds.