Agents All the Way Down: How AI Coding Agents Changed How I Write Django with Josh Thomas
Transcript
By Josh Thomas. From DjangoCon US 2026. Published October 26, 2026.
Watch the video Markdown version 4,160 words · auto-generated · en
Transcript
Automatically transcribed, so expect mistakes in names and technical terms. Filler words are removed.
All right, thank you, everyone. Earlier this year, I was at Disney World on vacation with my family. I don't remember whether we were walking around Magic Kingdom or already in line for Tiana's Bayou Adventure when a message from work showed up on my phone. But I know it was on vacation, and I was nowhere near my laptop. At work, our lease managers use one of our applications to send hunting club lease contracts to an outside contract service. Someone from our team messaged me because one of those contracts had failed twice. The application said it couldn't find one of the maps it needed to build the contract. That error usually means what it says. Our land information services team generates the maps and puts them on the network.
And I have a cron job that runs every 30 minutes and copies them up to S3. That's where our lease application can read them from. Some of our lease managers, I'll admit, are a little trigger-happy. They'll create a tract and immediately put it on a lease, then try to send the contract before any of that has run. I had seen that plenty of times before, and so that was kind of my first guess. I checked the audit log on my phone, and the timing suggested the map should have already made it into the application. So my obvious explanation didn't fit, and I didn't really have a better one yet. At Westervelt, we're a two-person development team. Unfortunately, the other developer was unavailable that day, so it was on me.
We work with contractors too, but getting them into a production bug like this is not immediate, so it wouldn't have fixed the issue. Before I left for vacation, I had actually set up Codex in remote mode on a new Mac Mini, but I hadn't really used it yet, and certainly not on a real bug. So I figured, why the hell not? I pasted in the team's thread, the error, what I'd found in the audit log, and my basic idea of what might be happening. Then I asked it to investigate on a new branch and see if it could come to a small fix. It went off and churned for a few minutes, then came back with two changes and some tests. One looked like a useful fix around the map lookup. But the second fix it had looked more like the bug we were chasing.
Both patches were small, and the diff looked reasonable and fine. Unfortunately, Codex couldn't run our test suite because this was a fairly new Mac Mini. I hadn't actually set up Docker yet. The tests it wrote didn't pass my smell test either. Any third-party integration requires probably a little bit of mocking, but agents left to their own devices will just mock endlessly. I pushed back and asked for a more realistic regression test without bending ourselves into knots or excessive mocking. The test kept a stale object in memory, changed the real state in the database underneath it, and then showed that the background job reloaded the object before sending the contract.
That looked much more like the bug we were trying to fix, so I asked Codex to push everything up. I opened the pull request and let CI do its thing. It passed. I gave the diff one more once-over in the GitHub app on my phone as a sanity check, then merged it. I knew if the patch didn't fix the issue, we would be in the same place we already were in. I also knew it wasn't going to bring down production. The lease manager ended up trying again, and the contract went through. The Codex app part of this felt new and surprisingly polished, but the process was what I would normally do with my laptop: think through a problem, guide the agent, push back where I needed to, wait for CI, and decide whether to merge. I spent maybe twenty minutes on it in pieces while I waited in line with my family.
Instead of losing hours of our vacation going back to the hotel and dealing with it on my laptop, Codex moved that work kind of onto my phone. But the process I was following had taken me six years to build. So I'm Josh, like I said, the lead developer at the Westervelt Company, a land and lumber company in Alabama that's been around for more than 140 years. We have about 10 Django applications covering everything from mill safety to mineral payments and bookings for our hunting lodge. The lease application from the Disney story is the biggest. It manages leases across hundreds of thousands of acres, and it's roughly 19 years old.
I've been a professional developer for about six years, all of them at Westervelt. This was my first job writing software for a living. For a while, I was the whole development team. I was the developer, designer, QA, DevOps, product manager, and the person talking to our users. I was also learning all of those jobs while I was doing them. The software I inherited was a mixture. We had some WordPress and some ColdFusion applications built inside the company that weren't in version control. We also had applications built by contractors. Those were in Bitbucket, but when the contractors needed to deploy one, they sent us a zip file and we copied it onto the Windows Server and restarted the web service.
So I did what I thought any normal developer should do. I created a GitHub organization, got access to the contractor repositories, moved them into our account, and then started the hard work of bringing in tests, CI, and automated deployments. None of that, truthfully, was actually in my job description, and no one had really asked me to do it. It was how I understood modern software should be built, and I was lucky enough that my boss gave me enough room to do it. My first GitHub Actions workflows were over-engineered and sometimes very flaky, but the goal was simple. I was new, responsible for all of it, and wanted enough evidence around a change that I could sleep after deploying it.
Once tests and deployment moved into CI, deploying became just merging a pull request I had tested. That was leverage. The same work still happened, but I no longer had to carry each step myself. I learned most of this job while doing it and by reading a lot of open-source code. I would not be standing here without open source. By the time the first AI coding agents, or coding tools, showed up, I had a pretty clear standard for what a useful tool is. If it was going to take some real work off my plate, I was going to make room for it in my day. ChatGPT and the browser required too much copying back and forth. Copilot and the other tab-completion-style tools...
AI sat closer to the project, but they interrupted my flow without taking enough work off my plate. Then I tried Aider. I don't know if anyone remembers Aider. It was doing the Claude Code thing before Claude Code, running in the terminal, reading and editing files, working inside the project. Claude Code went further by finding its own context, running commands, reading the result, and continuing the loop. These tools could finally take a task through the development loop I had already built. That connection for me was the leverage. CI had moved repeatable work out of my hands, and an agent could take the first pass at work that wasn't repeatable. It could take a bug report, inspect the project, and bring me back a possible cause before I'd even...
...given the rest of my day to it. Even when the diagnosis was wrong, it could rule out something or give me a place to start. And that's what happened at Disney. I spent about twenty minutes of my own attention instead of a few hours back at the hotel. I stayed with my family, and the contract still went out. But those are two different kinds of leverage. CI is supposed to be deterministic, and an agent definitely isn't. That unpredictability is part of why it can investigate a problem and come up with a novel solution, but it's also part of why I can't trust it in the way I trust a CI runner. So, yeah, CI can tell me that all the tests pass, but the tests can all pass while the data model is still wrong.
And this is kind of where my own Django code has changed the most over the years: in the models. I've started paying much more attention to whether the business relationships are actually visible there, or whether they only make sense after someone explains them. Carlton Gibson has a saying: go with the grain of Django. Django has 20 years of conventions around it, how its applications are laid out and how all the various pieces fit together. There are 20 years of documentation, tutorials, Stack Overflow answers, and many, many open-source projects. Django itself is in the training data, and it's one of the main projects used in all the benchmark suites that labs use to test the coding agents.
So agents know Django very well. The farther an application gets from it, the more context you kind of have to supply. But going against the grain isn't automatically wrong. For example, I tend to put my service-layer-type code in custom model managers and querysets. To me, that feels like going with the grain of Django. But agents love creating a services.py file or a separate service module instead. And I'm sure there are plenty of people in this room who prefer that as well. I still think my way is right. But both can produce clear code, and fighting the agent over every session doesn't buy me much. Django has a grain, and agents have a grain too.
So I've learned to loosen my grip when the difference is mostly taste. But taste can still carry information. Charlie Marsh, who created UV and Ruff and is now an OpenAI employee, has posted the same joke twice: “This bool could have been an enum.” A Boolean makes the surrounding code explain what true and false mean. An enum names the values and has somewhere to put a third state if it shows up. That's partly taste, but I think it's useful taste. The lease application had a much bigger modeling problem than just a simple enum-Boolean comparison. The application started as an Access database 19 years ago. It moved through a Cold...
Fusion application written mostly in raw SQL and eventually became Django. The older design used fairly flat tables, and at the time that made sense. Direct SQL and flat rows can be simple, but after 19 years of features and changes, some of the business relationships were just hard to see. For instance, a hunting lease can cover several tracts of land, and one of them has to be the primary tract. Other parts of the business use that tract to identify the lease, connect it to a landowner, and perform financial transactions. And so this is what it looked like before. The old model stored is_primary as a Boolean on each tract assignment.
If a lease covered five tracts, then there were five rows, and one of them was only supposed to say true. We later added a constraint so no more than one active tract for the same club and year could be primary, and that helped. But the lease itself still had no relationship to follow. To find its primary tract, the code had to work back through the club, the year, active status, and all the tract assignments for the lease. A person onboarding to the codebase learns that rule once and remembers it. An agent wakes up every session having to relearn the entire world. Every time one touched this part of the application, I had to make sure it reconstructed that same answer in its context.
And here's the thing: I already knew that model was awkward for years. I got very good at writing custom model managers and query sets to smooth over those inherited relationships. Changing the model was not impossible, but external reports and Power BI integrations read those tables directly. A schema change meant coordinating with people outside the application, which was enough friction for the workaround to keep winning. It was easier to teach the human developer the rule once and just let them keep moving. The refactor was already on my list, but having to teach the same rule over and over again to every new agent was what finally pushed me to do it.
We added primary tract as a foreign key on the lease and wrote a data migration for the old rows. It only set the primary tract when it could find a matching active tract, so rather than guessing, the new field is still nullable. Some old lookup behavior remains around for this same reason. So the model is not perfect, and the database does not prevent every invalid state. But now the first answer to “What is this lease's primary tract?” is lease.primary_tract. The relationship is written down where you would expect to find it: on the lease. Now an agent can find that relationship without as much explanation. That also helps the next person work on the application, including me, six months down the road.
More generally, when an agent keeps getting something wrong, I ask myself, “What kind of a disagreement are we having?” Is it fighting a harmless preference, like where I put a service function? Is it struggling with an information-poor representation, like a misplaced boolean field? Or is it repeatedly reconstructing a fact the application should state directly? If it's a domain fact, I look for a model, a relationship, or a constraint that can say it. If it's a code smell, maybe it becomes a lint rule or a Django system check. And if it's just taste, I've learned to let that go sometimes. When I find myself typing the same business rule into prompt after prompt, I don't want to solve that with a better prompt.
I want the next agent to be able to find the rule in the code. None of this means that the agent will choose a better data structure on its own. When the code leaves room for an easy answer, it usually takes it. So slop's a big word these days; it's a word everybody uses for bad agent code. And what I mean by it in this talk is that it's code that looks plausible and solves the problem sitting on the surface. It may pass every test. It may even work in production. But it solves the problem in front of it without dealing with the larger problem underneath. Earlier this year, Bryan Cantrill wrote a post called “The Peril of Laziness Lost.” It starts with Larry Wall's three virtues of a programmer: laziness, impatience, and hubris.
Cantrill argues that laziness is the most important one. We do hard design work now because we don't want to have ourselves or the next person keep paying for that same awkward design later. His shortest version of what agents lack is this: work costs nothing to an LLM. An agent never has to maintain 200 lines it just added. It never gets tired of working around the same bad interface. It doesn't feel the code base getting harder to hold in its head because it doesn't have to hold that code base in its head tomorrow. It doesn't have a head. So it takes a local fix. If the tests fail, it changes the code until they pass. If writing a pile of mocks gets them to pass, it will write that pile of mocks. And an agent can write both the implementation and the tests.
So that means it can write tests that prove the solution it's already chosen. Once the solution is in the code base, it becomes a fact for the next agent. Agents are much more likely to accept an existing pattern than to stop and ask whether that pattern should exist in the first place. So slop compounds. A bad, small choice gets copied into the next feature and the next one until it becomes just how the application works. An old application gives the agent even more mixed evidence. The lease application contains choices made at different times by different people for different reasons. Some are deliberate, some are inherited, and some remain because changing them would break something.
An agent sees all of this as equally real. When the code gives it mixed answers, it tends to reach for the most common answer it's seen elsewhere. I tried using agents to solve this. I'll send an implementation through adversarial reviewers. That helps until the implementing agent treats every criticism as an order. A reviewer told to find complexity will find some. And a five-line fix can become 200 lines of defensive checks that are unlikely or impossible. The reviewer has the same missing judgment as the implementer. It gives me another opinion without telling me how much that opinion matters. So I treat it as one more check. Tests catch behavior that we knew to test.
Linters catch patterns we already rejected. CI runs those checks every time, and reviewers may catch something that another agent missed. Human review is still where I decide where the design fits the application. How carefully I read depends on what the change can hurt. If an agent writes a one-off script that only I will run, I may glance at the shape, run it, and see what happens. But if that script's going to run every day as a scheduled job, then I'll read it a little bit deeper. If it changes a core model or a path our users depend on, I will read it with a fine-tooth comb. That's how I looked at the Disney patch. I knew the code. The patch was small. CI passed. If it had failed, the contract would still be stuck.
I could see that it would not bring down production. I also could not reconsider the whole integration from my phone and think about a potential lower rewrite. And I still haven't done that deeper redesign, to be honest. What I established from Disney was that the patch was safe enough for that one incident. And maybe one day I can stop reading the code. Current agents have not earned that from me. After about three years, this kind of failure mode that they have has not gone away. Some weeks working with them is genuinely fun. Other weeks I correct the same mistakes over and over again until I wonder why I'm doing this.
But then I step back and compare that annoyance with how work used to feel. A bug report would land on an already full plate and displace something else. Now an agent can do the first investigation and give me some idea of the cause and size before I decide how much attention it needs. I spend less time anxious about everything waiting for me and more time annoyed at the agent in front of me. And so far I can live with that trade. One reason I keep making that trade is because agents have changed what I can afford to do in my spare time. I've been working on a Django language server. So Django normally finds bad template tags by running the template through the template renderer. A language server needs to find them while you're still editing.
One version used tag validation rules and TOML files. The version I'm working on now actually scans the Python AST, finds where the exception is raised, and then traces it back up there to the condition that led to it. In theory, that works for both built-in tags and custom tags in anybody's project. It's still a work in progress, though. And if I had to do it all by hand right now at night, I probably wouldn't, to be honest. I love writing software and solving problems, but every evening I would spend on this is time I'm not spending with my family. Agents let me keep the project moving without letting it take over every evening. They also let me build rough versions of six possible designs instead of just comparing them in my head. I can run them, read them, and pick out and keep the best parts.
And that gives me better evidence, but the experience is different from working through one version by hand. A few years ago I read Crafting Interpreters and actually ended up writing a parser for Django templates. I wanted to learn how compilers worked and understand the Django template engine deeply, and I ended up writing it in Rust because I wanted to learn a new language. It's a new challenge, and the challenge was part of the fun. An agent could get surprisingly far on that parser, probably finish it in just a few minutes these days. But I can still write something by hand when learning is the point. Working with agents is, to be honest, also kind of a puzzle.
During a good week, I enjoy finding one where one failed, writing a better check or lint rule, changing the shape of the code, and seeing what the next attempt improves. What frustrates me, though, is how temporary some of that learning is. The compiler concepts I learned building that template parser still apply. Something I learned about steering one model may stop working when the next one ships, and I find that incredibly frustrating and sometimes a little disheartening. There's also, to admit, some cognitive debt in that. I write code by hand much less often than I used to. If these tools disappeared tomorrow, I could still do the work, but it would take me a while to get back to my old speed.
That's a real cost. At the same time, I spend much more time comparing designs, thinking about boundaries, reviewing architecture, and deciding which problem is worth solving. And I don't know how much of that comes from just using agents or how much of it comes from that many more years of experience. Jeffrey Litt uses the phrase “understand to participate.” I need to understand the project well enough to decide what happens next instead of handing the work to an agent and watching it build something for me. That doesn't make craftsmanship and building opposites, though. The business cares whether the application solves its problem.
But it also cares when a bug takes three weeks to fix or a feature is too dangerous to change. Clear, changeable code is where those concerns meet. And at the end of the day, the judgment is what remains mine. At Disney, it meant deciding that a small patch was safe enough for the incident. In the primary tract refactor, it meant recognizing that the rule belonged on the lease instead of in queries and in people's memory. An agent could still write the code for either change. I just had to decide what the application should say and what risk I was willing to take. Getting the data structures right has always mattered. If you're coding with agents, though, I think it matters even more these days, because when you get that right, the agents can fly.
And I'll just close with this classic quote from Fred Brooks: “Show me your flow charts and conceal your tables, and I shall continue to be mystified. Show me your tables, and I won't usually need to see your flow charts. They'll be obvious.” Thanks.