The Looping Habitat
How your AI gets smarter every session
This is Article 6 of 6 of “The Habitat Hypothesis,” a six-part series on building environments where AI actually produces great work. Article 1: environment determines output quality. Article 2: context engineering. Article 3: constraints. Article 4: entropy. Article 5: agent orchestration. This is the finale. The piece that was missing from all of them.
You fixed this already.
Last Thursday. The AI generated a service class that swallowed exceptions silently — caught them, logged nothing, returned null. You caught it in review. You explained the pattern. You showed it your team’s error handling convention. It produced correct code for the rest of the session.
Monday morning. New session. The AI generates a service class that swallows exceptions silently.
Not irritation. Something worse: resignation.
You’ve been here before. Not just with error handling. With naming conventions. With test structure. With that one architectural boundary the agent keeps crossing. Every session, you teach the same lessons. Every session, the AI has forgotten them. You are Bill Murray in Groundhog Day, except the alarm clock is a code review full of the same mistakes you corrected yesterday.
This is the Groundhog Day problem. And if you’ve been following this series, you already have most of the solution.
Where we’ve been
Series recap:
Article 1: The environment, not the model, determines AI output quality. Article 2: Context engineering gives the AI the knowledge your senior developers carry in their heads.
Article 3: Constraints enforce standards at three maturity levels -- declared, agent-backed, and deterministic.
Article 4: Entropy is the natural tendency of codebases toward disorder. You fight it with garbage collection.
Article 5: Agent orchestration lets specialised AI agents collaborate through a structured pipeline.
Everything we’ve built so far is static. You set up context files. You define constraints. You deploy agents. It works dramatically better than the bare-repo, hope-for-the-best approach most teams use.
But none of it learns.
Your context files contain what you knew when you wrote them. Your constraints cover violations you’ve already seen. Your GC rules target entropy patterns you’ve already noticed. The system is exactly as smart as you were on the day you configured it.
That’s the ceiling. Unless you build the mechanism that raises it.
The Raw Material Is Already There
Think about what happens during an agentic coding session. Not the code it produces, the corrections you make. Every time you say “no, not like that, like this,” you’re generating a signal. Every AI surprise, good or bad, is data. Every edge case you discover is knowledge that didn’t exist before the session started.
Right now, all of that evaporates. Session ends. Corrections disappear. Edge cases live only in your memory, and your memory is not as good as you think it is.
Reflections change this. A reflection is a brief note captured after a piece of work. Three sentences, not an essay:
What was surprising? Edge cases you didn’t anticipate. Assumptions that broke.
What should future sessions know? A gotcha, a “don’t do it this way because...” warning.
What could improve? A missing convention, a constraint that’s too loose, a gap in context.
There’s one more piece: what kind of signal is this? Each reflection classifies itself as one of four types, a taxonomy borrowed from Birgitta Boeckeler’s Feedback Flywheel:
Context — a gap in the priming document. A missing convention, an outdated version, incomplete domain knowledge.
Instruction — a prompt or command that produced notably better or worse results.
Workflow — a process pattern that reliably succeeded or failed.
Failure — a preventable error. A check that should have run, a tool that was misconfigured.
The classification takes five seconds and answers the question curation always asks: where should this go? Context signals route to your conventions file. Instruction signals improve your prompts. Workflow signals become team playbook entries. Failure signals become constraints. The signal type is the routing label that turns raw ore into something a curator can act on without re-reading every entry.
Two minutes at the end of a session. Maybe less.
The Sceptic: “So you’re asking me to write a diary entry after every coding session. I became a developer to avoid paperwork.”
The Pragmatist: “You’re already noticing the problems. This just asks you to write them down before you forget. Two sentences. Less time than the Slack message you were about to send complaining about the AI.”
These reflections are not documentation. They are raw material. Ore, not steel. The valuable step comes next.
The Curation Step
Raw reflections are noisy. Sometimes the AI got confused because you wrote a bad prompt, not because there’s a missing convention. Sometimes the edge case was genuinely rare. Sometimes you were just having a bad day.
So you don’t promote everything. You curate.
Weekly — fortnightly if you’re busy — scan your reflections and ask one question: does this keep happening?
A gotcha that showed up once is an anecdote. A gotcha that showed up three times is a convention waiting to be written. A violation the AI keeps repeating despite clear instructions is a constraint that needs promotion — from declared to agent-backed, or from agent-backed to deterministic.
Brain Power: Think of the last three times you corrected your AI assistant. Was there a pattern? If you spotted one just now, congratulations! You’ve identified your first candidate for promotion. If you can’t remember the corrections... well, that’s exactly the problem reflections solve.
This is where human judgement meets AI volume. The AI generates code at a pace you can’t match. You generate insight at a pace it can’t match. The learning loop combines both.
A Fireside Chat About Promotion
Reflection: I’ve been sitting in this log file for two weeks. The developer noticed that the AI keeps putting database queries directly in the route handlers instead of using the repository pattern. She wrote me down: “AI ignores repository layer, puts queries in handlers. Third time this sprint.”
Convention: I remember when I was like you. Just a frustrated note in a log. Then one day, the developer read through her reflections and noticed that three of them were basically saying the same thing. She promoted me. Wrote me up properly: “All database access MUST go through the repository layer. Route handlers call repository methods, never query builders or ORMs directly.” Gave me examples. Put me in the context file where the AI reads me at the start of every session.
Reflection: And the AI stopped doing it?
Convention: Not overnight. But within a couple of sessions, the violations dropped from every PR to maybe one a week. Then she promoted me again and turned me into an agent-backed constraint. Now an AI reviewer checks every PR for direct database access in handlers. Last month? Zero violations.
Reflection: So I could become... you?
Convention: If you earn it. If the pattern you’ve spotted is real, is recurring, and is worth codifying. Not every reflection deserves promotion. Some of you are noise. That’s OK. That’s what curation is for.
Compound Learning
Here’s where this gets interesting, in the way compound interest is interesting once you understand it and uncomfortable once you realise you’ve been ignoring it.
Each promoted reflection makes the environment better. A new convention means the AI gets something right that it used to get wrong. A tighter constraint catches a class of violation before it reaches a PR. An improved GC rule cleans up entropy that used to accumulate silently.
Better environment, better output, fewer corrections. But here’s the part most people miss: the nature of your reflections changes. You stop writing “the AI got the basics wrong again” and start writing “discovered a subtle interaction between the caching layer and the event system that neither of us had considered.”
The quality of the learnings improves as the baseline improves.
The flywheel is hard to push at first. You’re writing reflections, curating, promoting conventions and it feels like overhead for modest gains. Then the gains compound. You spend less time on basic corrections and more time on genuine discoveries.
Your brain just filed that under “nice idea, probably doesn’t work in practice.” It does. It’s the same mechanism that makes experienced teams fast: accumulated decisions, conventions, institutional knowledge. The learning loop makes it explicit and transferable instead of locked in people’s heads.
The Veteran: “We did this. After three months, new hires were productive in two weeks instead of two months. Not because we wrote better docs but because the docs were written by the problems we actually hit, not the problems we imagined we might hit.”
The Self-Improving Harness
The harness from earlier in this series — context, constraints, garbage collection — was presented as something you build. It’s not. It’s something that grows.
Reflections suggest new conventions -- context improves
Repeated violations suggest new constraints -- enforcement improves
Recurring drift suggests new GC rules -- entropy-fighting improves
The harness improves the harness. The gap between “what the AI knows” and “what the team knows” shrinks session by session.
Three Loops, One System
Step back. The whole series is one system. Three concentric loops, three timescales.
The inner loop — edit time. The AI reads conventions at session start. It follows the guidelines. Not perfectly, but far better than without them. When it drifts, you correct it in real time.
The middle loop — merge time. Agent reviewers enforce constraints. Specialised agents verify architecture, security, testing. Human gates make the final call. Nothing merges that hasn’t passed the gauntlet.
The outer loop — periodic. Garbage collection sweeps for entropy. Audits check for drift. And this is the new piece, reflections get curated and promoted. The outer loop is where the one-off correction becomes the permanent convention. Where the recurring violation becomes the automated constraint.
The loops feed each other. Inner loop corrections become reflections that feed the outer loop. Outer loop constraints improve middle loop enforcement. Middle loop catches become tomorrow’s inner loop context.
Most teams using AI coding tools haven’t considered any of this. Not because it’s complicated but because nobody told them the environment was the thing worth investing in. You know now. The question is whether you’ll do something about it.
Where This Leads
Right now, you’re setting up context and constraints by hand. Promoting reflections through human curation. Spotting patterns through your own review.
Follow the trajectory.
Next month, the system proposes its own constraints. “The last seven reflections mention inconsistent date formatting. Draft a convention?” You review, approve, live.
The month after, it spots architectural drift before you do. “The payments module has accumulated direct dependencies on the user module. This matches a pattern from three months ago that led to a circular dependency incident.”
The month after that, a new developer joins. Instead of weeks absorbing tribal knowledge through osmosis, they work inside an environment that already contains what the team knows. Conventions, constraints, hard-won lessons from hundreds of sessions. Encoded, active, learning.
This isn’t speculation. It’s the natural endpoint of one idea: the habitat makes the difference.
Summary fir the Humans in the House
The Groundhog Day problem: without a learning mechanism, every AI session starts from scratch
Reflections: brief post-session notes -- what surprised you, what future sessions need, what could improve
Curation: the human step -- promoting recurring patterns into conventions, constraints, or GC rules
Compound learning: each improvement raises the baseline, which raises the quality of future learnings
The harness is alive: it evolves through the learning loop -- the harness improves the harness
Three loops (edit time, merge time, periodic) feed learnings into each other
Your Move
Six articles. One idea: the Habitat Hypothesis.
Here’s your closing exercise. Not a thought experiment. An action.
Brain Power, the final one: What is the ONE thing your AI keeps getting wrong? The correction you’ve made so many times you could type it in your sleep? Write it down. Right now. Be specific — not “better error handling” but “catch exceptions in service methods, wrap them in AppError with a code and message, and let the controller handle the HTTP response.”
Now put it where your AI can read it. A
CONVENTIONS.mdfile. ACLAUDE.mdfile. A system prompt. Whatever your tool uses.That’s your first reflection promoted to a convention. Your first learning loop, running.
One convention. One fewer correction tomorrow. Then another.
The flywheel doesn’t ask permission to start turning.
From Hypothesis to Harness
If you have read this series and thought, fine, but what do I actually put in the repository? — that is exactly where the AI Superpowers plugin comes in.
The six articles in The Habitat Hypothesis have argued one thing from six different angles: AI quality is not primarily a model problem. It is an environment problem. Better context produces better judgement. Better constraints produce safer behaviour. Better review structures produce more trustworthy output. Better learning loops turn repeated corrections into durable capability.
The plugin is an attempt to make that concrete.
Not as magic. Not as a silver bullet. Not as “just install this and your AI becomes senior.” Quite the opposite. It is a practical expression of the same argument this series has been making all along: if you want better work from AI, you have to build a better habitat around it.
That is what the plugin is for.
It gives shape to the things this series has described in principle. The context engineering of Article 2 becomes reusable project scaffolding. The constraints of Article 3 become executable checks and guided discipline rather than good intentions in a wiki. The anti-entropy work of Article 4 becomes something you can operationalise instead of merely admire. The orchestration patterns of Article 5 become closer to a working team of specialised agents than a lone autocomplete with delusions of grandeur. And the learning loop in this article — reflections, curation, promotion — becomes the missing mechanism that stops your environment from freezing at the moment you first configured it.
In that sense, the plugin is not separate from the series. It is the series, translated into repository form. Or, perhaps better, the articles are the theory, and the plugin is an early piece of practice.
It exists to help teams move from saying “we should probably give the AI better guidance” to actually creating an environment where guidance is present, persistent, inspectable, and capable of improvement over time. It is a way to turn habitat thinking from a good metaphor into a set of repeatable moves.
You do not need the plugin to apply the ideas in this series. A thoughtful team with a conventions file, a review discipline, and the habit of promoting reflections can start tomorrow. But the plugin is there for teams who want a starting point — a way to bootstrap the habitat rather than rebuild it from first principles every time.
That matters because the real challenge with AI-assisted development is not generating code. It is institutionalising judgement. It is capturing what your team learns, expressing it clearly, and embedding it into the environment so that tomorrow’s session does not begin in the same ignorance as today’s.
That has been the real subject of all six articles.
The model matters, yes. But the habitat decides whether the model becomes a liability, a parlour trick, or a genuine collaborator.
The plugin simply takes that claim seriously enough to ship some of it.
Have fun!
Russ


