The Apprentice's Sorcerer
Or I how I learned to start worrying and love Claude Code
This is an AI-themed post about my adventures with Claude Code. I’ve been…err.. vibe-podcasting about AI in two recent episodes of Rethink, on the promise of AI here, and on authenticity here, where you can hear fake Ben Ansell. Ben AInsell if you will.
There are a few moments when the sheer volume of possibility overwhelms you. It’s the feeling you get sometimes if you walk into an enormous bookshop or library. So much knowledge out there, so impossible to attain even a fraction. Or perhaps it’s that feeling that us nineties kids will remember of when the ‘World Wide Web’ first became popular and a few key strokes connected you with endless other minds.
My favourite lines in literature about this (possibly just my favourite lines, full stop) are ones many of you will know already. From the final pages of The Great Gatsby:
Most of the big shore places were closed now and there were hardly any lights except the shadowy, moving glow of a ferryboat across the Sound. And as the moon rose higher the inessential houses began to melt away until gradually I became aware of the old island here that flowered once for Dutch sailors' eyes—a fresh, green breast of the new world. Its vanished trees, the trees that had made way for Gatsby's house, had once pandered in whispers to the last and greatest of all human dreams; for a transitory enchanted moment man must have held his breath in the presence of this continent, compelled into an aesthetic contemplation he neither understood nor desired, face to face for the last time in history with something commensurate to his capacity for wonder.
Shivers.
Are we at another ‘last and greatest of all human dreams’? The genius of Fitzgerald’s writing here is it conveys not only nostalgia - none of us can ever ‘rediscover’ the American continent - but also possibility. Because, reading this we all know other such moments have happened afterwards - imagine the image of the earth seen by Yuri Gagarin. There is no ‘last time in history’ for wonder it turns out.
Anyway, there’s probably a reason I didn’t do English A-Level, so enough riffing on metaphor and possibility from me. What I want to convey though, is one of those moments where you realise that the brakes have been taken off, that you can suddenly do far more, understand far more, change far more, than you thought you could a day ago. And then the question comes, well what do you do with that?
Just as scrolling the ‘World Wide Web’ all day turns out to be bad for your brain; just as spending every waking hour reading in the library turns out to be bad for your eyes; will the arrival of agentic AI, turn out to be bad for our willpower, our sense of direction, our own… well… agency?
That was all a typically winding way to get to the subject of today’s post - my experiences over the past month with Claude Code.
I am very far from the first person to write such a piece. Indeed, I feel I am just adding to a Borgesesque library of such Substack posts. But what I don’t think most of the writing about Claude Code has conveyed is how you actually engage with it and what it does when you do.
In other words, I want to show, not tell. And maybe come back to what this all means after doing that.
And the easiest way I thought of to do that was to create a website showing the kinds of things you can do with Claude Code. Oh and spoiler… I didn’t actually create the website, Claude Code did.
Here it is. I have kept the front page very simple. There are six links to different projects. Feel free to start mucking around. I’ll come back to them.
But before I do, I think it’s worth trying to explain what exactly Claude Code is.
It’s a golem that lives in your computer’s terminal and creates files for you.
You might wonder first off, what on earth the ‘terminal is’. Fair point. Here’s a picture of my one.
Compelling.
I use a Mac and the Terminal app basically allows you to write commands in the computer language Unix that do the basics of computing: create files and folders, delete files and folders (important not to screw up…), download and run applications, process commands in some applications, and compile and run commands in other software languages including Python and R (the two I will be talking about today).
People substantially more skilled at computing than me might well use the Terminal to directly run a lot of their code. I’m a mere baby and so would prefer to use an IDE (Integrated Development Environment) such as RStudio or PyCharm, which provide both text editors for coding and drop down menus for such fripperies as saving your file or looking at data.
So does this mean Claude Code forces you to become a super-skilled hacker type from 1980s movies, mashing in instructions in green text on a dark screen? No. But it kind of is one. Claude Code is going to be working within the terminal, typing Unix commands, or developing code in other software languages and then compiling it in Unix. You have your own private 80s style hacker.
Your own interaction with the Terminal is twofold. First you need to open it to get Claude Code going by (once you’ve installed it) typing the word ‘claude’. Second, your conversations with Claude Code are going to be done through the Terminal, much like your conversations with the chatbot Claude or ChatGPT are done through a web browser. Here’s what that process looks like.
I’ve done two things here. The first is to type “cd ~/Downloads”. “cd” means change directory. Why am I telling you this? Because a crucial thing about Claude Code is it needs your permission to access a working directory. This is to stop it going places on your computer that it shouldn’t and potentially wrecking havoc. So I am putting it in my Downloads folder, which is where it will look for files, create files and folders and potentially delete them. And I had to previously give it permission to do that (it doesn’t ask every time if you’ve done so beforehand).
The second thing I did once in this directory was to activate Claude Code by typing “claude”. This brought up the delightfully 1980s imagery. Notice it says Opus 4.6. That’s the current advanced model that Claude Code uses but if you want it to absorb fewer ‘tokens’ (more later), you can set it to other simpler models such as Sonnet.
Below that is the input line which currently says ‘Try “fix typecheck errors”’. Don’t know what means so I am going to do something else extremely hackneyed - the old “Hello World” request. Let’s go!
Here’s my request, in the black outline above. Below that is Claude Code’s response. OK, here’s what I will create - a file in Python called “hello.py”. Importantly, it also asks me if I want to actually do that, by pressing 1, 2, or 3. This permission structure is really important - it stops Claude Code from going off and just creating (or more worryingly, deleting) things without your say so. Of course if I pressed 2 I would give it permission not only for this but for related edits and while that’s usually fine it very much depends on the context.
Once I have done this it then asks more permission. Do I want to actually run “hello.py”. I won’t bore you with the same image of questions. Here’s the exciting output instead.
So now we see it wrote the code (all two lines of it) to a file it created called “hello.py” and then the ‘bash’ command tells us that it ran a Python compiler, and then below that we see the exciting output. It says it worked for 1m and 52s but the only reason it took so long is because I am writing this on a train and was out of internet range for approximately 1m and 51s. It then provides me with a suggestion for a new edit (looping five times). I’ll spare you that.
Boring example but… it shows a few key things about Claude Code. Firstly, that you speak to it in normal language, which it interprets as instructions for how to manipulate code. Second, that it asks permission at every step, including file creation and running code. And it really did create this file in my Downloads directory. Third, it provides some suggestions for next steps, creating a mildly addictive interaction process. And fourth… well, did you spot it?
I never asked Claude Code to add an exclamation mark or a comma. But it did. Because that’s how the “Hello, World!” program usually works. In other words, there was a Generative AI process going on here too, where it took my command, interpreted it, and then did what it thought I wanted as opposed to what I literally said. That it turns out is the killer app. It not only follows your instructions but it interprets them, extends them, maybe warps them. It is a form of LLM after all.
Let’s now return to the website I created with six sample projects. Each of these took rather longer than one second (or indeed 1m 52s). But not usually much more than ten to fifteen minutes. They also absorbed a lot of ‘tokens’. Tokens are the cost of using Claude Code.
I have a Claude Pro subscription - £180 for a year - which provides me with a set amount of tokens I can use every five hours, and cumulatively every week. It then resets the token allowance at the end of each of these periods. Five hours sounds like a lot of time and tokens. It’s not. Doing something intensive with Claude Code for half an hour will probably use up your five hour allowance, so you will need to wait another four and a half hours. You can of course pay Claude more money for the privilege of carrying on when you hit your limit. How pricy? Depends on what you’re doing? Most people seem to throw an extra $5-10 at it to complete what they are currently doing. That could get pricy fast. With that said, I didn’t crack into this to make any of these projects - they all completed within the five hour token window.
If you need more tokens you might want a Claude Max subscription but now you are spending £90 a month and there are still (much higher) limits. No free lunches and all that. And yes, this is very data intensive and so likely also energy intensive and that’s why all those data centres are being built and no-one can buy an SD card for love nor money. In my own little way I guess I am contributing to this global problem. I agree. Same thing when I get in my car, or leave the lights on, etc etc. As a society these are the costs that we will ultimately need to be trading off against the benefits of AI. And that is a much longer article.
But if you’re not too appalled with me, let’s get back to those projects and the website. And the first of those projects - rather meta this - was to create a personal website. But a more professional one. You can click directly through here. And here’s what it looks like:
Snazzy if quite simple. In Claude’s defence it only took ten minutes or so to create this. Now I already fork out £120 a year to Wordpress for a website I host (also costing money) here. It’s got more images but only because I didn’t give them to Claude. Is it worth paying Wordpress for this privilege. I can’t really see that it is, tbh.
How did I create it? I gave Claude the following command:
“create a new website for me using my existing one www.benwansell.com and my CV in this folder Ben-Ansell-CV-Dec-2025.pdf”
That’s it. It basically generated the website you see but I then asked it to do a couple of other things:
“can you add links to all the papers on the papers page”
“on home page where it says substack add link to https://benansell.substack.com and add link to my BlueSky benansell@@benansell.bsky.social”
“link for the reith Lectures https://www.bbc.co.uk/programmes/m001t2r7”
“Please use the headshot jpg I have just added on the home page”
And finally, the following entertaining exchange:
## 👤 User
can you center my head slightly more in the circle
## 🤖 Claude
Done. I shifted the image crop upward to better center your head. Let me know if you’d like it adjusted further up or down.
## 👤 User
head needs to be moved to the left
## 🤖 Claude
Done. Shifted the crop to the left. Let me know if you need more adjustment.
## 👤 User
other direction! shift back and further
## 🤖 Claude
Done. Shifted to the right. Let me know if it needs more.
## 👤 User
slightly further
## 👤 User
perfect
## 🤖 Claude
Great! The website is looking good. Let me know if you’d like any other changes
Now, you know what me screaming at an AI agent looks like.
So that’s it - I gave it a CV and details about my existing web page. I then asked for links to papers and gave it some other links it didn’t have. Then I put a headshot in the folder and asked that to be added. And the most time consuming part was my back-seat driving about the position of the photo.
But let me let you into a secret. It all looks good but if you follow some links to articles, you will discover that basically Claude got it wrong half the time. E.g. the piece with Jane Gingrich on Political Inequality leads to an entirely different article in the same journal.
So Claude Code is not yet immune to the hallucinations or mistakes we more generally associate with LLMs. But in terms of the coding part, that all works nicely. If you read the HTML source code it’s very clean and sensible too (assuming you know how to read markdown).
Now for something completely different - maybe more fun. My next command is much longer:
“Let’s create a deck-builder game. The premise of this game is Westminster politics. So the levels go from standing for selection as your party’s candidate for a consitituency, to winning a by-election in that constituency, to winning the General election for that constituency, to getting selected as a minister, to getting selected as a Cabinet minister, to winning a leadership election and becoming Prime Minister, to winning a General election as prime minister. Each time you are up against opponents as in a slay the spire style game. Each round involves choosing a card with an action or power from a set of cards. Your opponent can defend and attack. Defend and attack have political meaning (so defend might be to respond with an excuse or a media interview, attack might be to engage in dirty politics against you, or opposition research, or choosing a more attractive policy. At the end of each round you receive some points that you can spend in a political shop (the Olde Westminster Shoppe) on new cards or special powers. “
And this time I used Claude Code’s /plan option where it figures out how it is going to do this. Claude had lots of fun ideas, not least calling it ‘House of Cards’, to which, you know, fair play. Here’s what the game looks like.
You can have a go at the game. All of the cards, the names of the characters etc were generated by Claude. So this is very much Generative AI. Is the game fun, though? No, not really.
But to be fair, I didn’t edit it at all. If I was committed to this idea - I’m not - I would have worked back and forth trying to come up with new card ideas, adjusting the difficulty level, adding some graphics. In sum I would say this is maybe an interesting proof of concept but not much more.
We move on! This time to something more educational. I’m currently writing a ‘natural history’ of democracy (due to be finished next year). So I thought, I wonder if Claude can come up with a nice interactive website on Ancient Greek democracy. Here’s the prompt:
can you create me an intereactive html page for the history of democracy in ancient greece (1000BC to Alexander the Great) with a focus on Athens and Syracuse but with examples of interesting other cases. Please focus on voting rules, how courts were assembled, ostracism, sortition, and ability to dismiss leaders. Also create a pdf document that provides a readable account. There should be a map and a timeline as images in both the website and the pdf.
I apologise for my spelling. Terminal doesn’t have spellcheck. Here’s what we get.
So, this is kind of cool. We get a bunch of the things I asked for (e.g. discussion of sortition and ostracism, a focus on Athens and Syracuse). But there are some weaknesses. It’s all quite thinly sourced - there are sources given down the bottom but it’s hard to tell where any particular information came from. It feels like a textbook written maybe for first year university students but there is of course no real instructor - there is an AI grabbing stuff that seems related and presenting it nicely. Oh and I forgot to tell you, the first map it produced was hilariously wrong and ugly. I mean look at this:
LOOOOOOOL
I complained to the manager - Claude Code - and it did then use an R app called leaflet which produced the much nicer and actually accurate map on the website.
On to the next thing. I thought I would now try some agent-based modelling. And so I went to the classic: Conway’s Game of Life. This is a super-interesting idea that John Conway came up with in Scientific American that could be done with a piece of grid paper. The idea was you fill in some squares on a grid and then use the following algorithm. If a square has fewer than two neighbours (in the eight possible squares near it) then it ‘dies’ of isolation. If it has more than three it also ‘dies’ from over-population. If it has two or three neighbours it’s in the Goldilocks zone and it lives. AND if an empty square has three neighbours it comes alive, as if through reproduction.
What is cool about Conway’s game is that with a very simple set of rules it can produce extremely different outcomes across the grid over various generations from tiny initial differences. It also allows for ‘replicators’ - groups of cells that survive and can move around the grid.
Simple rules, simple presentation. Sounds like an algorithm that would be easy for Claude Code to produce. And indeed all I had to do was ask it to do that “can you create me a small video game that is based around conway’s game of life”. And it created me this entire website.
I tried other versions, a ‘challenge’ version where you have to beat a certain score in terms of squares alive after a certain number of generations. I also created a version of Tom Schelling’s famous segregation agent based model. All of this very easy to initially create. And then very easy to ask for different options for the underlying algorithms. For social scientists, the ease with which one can ask agents to create and then potentially act in agent based models is game-changing.
Or what about more normal British politics research - the kind you are probably used to seeing on this Substack. Yep, can do that too. I had been having an interesting conversation with an FT journalist about whether Nigel Farage was more popular than he used to be. I argued, based on a hunch, that his popularity over time was really stable - everyone had already made up their mind. Being a journalist they asked me, how do I know. And tbh I didn’t really.
But I knew where the data was. The British Election Study has asked questions about people’s relative liking of Nigel Farage all the way back to 2014. So here I did some work and Claude did other bits. I downloaded the giant thirty wave BES panel. I selected the necessary questions from it. I gave Claude some information about when each wave was. And then I asked it to do the grunt-work of showing me how this has changed over time.
So this is absolutely stuff I could do in R, or if you pushed me Python. Indeed I used R for the initial steps. But then I requested the following: “Take the file Farage.csv which has British election study asking how much people like or dislike Nigel Farage for Waves 1 to 30 of the BES. Please use this to provide a similar document”. Similar to what you ask? Similar to one I had done an hour earlier asking Claude to search for YouGov and Ipsos polling. I won’t bore you with other request but what I want to note is I didn’t tell Claude how to analyse the data. Here’s what it came up with.
Claude ‘chose’ to look at mean and median ‘liking’ of Nigel Farage on the zero to ten scale the BES uses (median score usually one or two, which um tells you something); at a tripartite grouping into like, neutral and dislike; and then at strongly dislike (zero) versus strongly like (ten). Again, I did not ask it to do this. But I’m glad it did because we see different stories. Farage’s likability is very consistent across time - and note how Claude (again of its own ‘volition’) labeled some time points in the top graph - but if there is any change it is that his ‘strong dislike’ has moved up from low thirties to mid forties over time. Oh and Claude used R for this, creating a file that did some data cleaning, calculates summary stats, and provides code for these graphs.
Finally, because you are probably exhausted, my website shows how Claude Code can help create presentations from existing academic papers. I have a (recently accepted!) paper on tax progressivity with Asli Cansunar and Mads Elkjaer. I gave Claude Code the pdf of our (not yet copy-edited/ proofed) article and then asked Claude to create me a slide-deck with around twelve slides. You can see them here.
Here’s a nice example - it takes our overall theory and turns it into a visualisation - this is novel, we don’t have this in the paper, at least in this form.
So that’s cool. Where it is less brilliant is in not checking whether the text actually stays on the slide. As in the slide below:
Ooops. So it clearly needs more steering, which means chatting back and forth with it, which I didn’t do because I created the slides to show what can go wrong! Nonetheless, I could also have just edited the slides myself at this point because Claude also provides the .tex files to make the slide pack (this is a nerd thing).
Alright that’s it - at least in terms of what I will show you. I’ve had it make adjustments to my General Election 2029 Predictor App (which I hand coded originally) and those seem to work pretty well. New version here. I’ve made other slide packs of chapters and papers, in part to see if my argument is clear. I’ve done various high speed plots of democracy level across time for a set of countries. I even had it create a 3D video game where you walk around Oxford looking for penguins. That game, it has to be said, sucks.
I hope I’ve given a sense of how Claude Code works and how to start using it if you’re interested (sadly I am not willing to fund your £180 start-up costs). I do think most social scientists are going to have to either figure out how it works or refrain from doing so but make peace with its existence. This is the ‘killer app’ and its precise method of killing you will be social scientists boring you to death talking about it.
But let me finish by casting out again, albeit perhaps not in as lyrical tones as F Scott Fitzgerald could.
Look at the wild range of things I could get Claude Code to do. Some of them were useful, some were fun, many were pointless. But there is no obvious end to any of this. One could always just be agenting.
This tweet about what people are calling ‘token anxiety’ went viral the other day:
People in the Valley can’t stop agenting. The only limitation in an endless factory of agents doing stuff for you is tokens - the price of using an agent. If you had unlimited tokens then I guess you could have unlimited agents doing unlimited stuff.
But what would that stuff be? Why would you want to do it? The analogy I used earlier of being in a library and being overwhelmed by the number of books isn’t quite right. Because those books were written by someone else - you are being overwhelmed by all the myriad knowledge already existing in the world.
But non-stop agenting, that’s as if you were overwhelmed in the library by books that you had asked to be written.
Why are you writing all these books? Who are they for? Can anyone possible consume, even understand all the apps and documents being produced by agents? I mean maybe the agents themselves can. But to what end?
The title of this post is ‘the Apprentice’s Sorcerer’. Yes I did that literary thing of flipping the normal ‘Sorcerer’s Apprentice’. But I didn’t do this (just) to be clever. The myth of the sorcerer’s apprentice is of a wise magician creating a follower they cannot control. In Fantasia, this is Mickey and his out of control brooms. I think that’s how we often think about AI. Us clever humans unwittingly become Dr Frankenstein, building a monster that escapes our chains.
What if we are just not that clever but the agents really are? We are a mere apprentice unleashing sorcerers upon the world. We give vague instructions, the sorcerer gives us what we really meant but couldn’t express. We are Frankenstein building a Doctor, who in turn can build new Frankensteins. We are out of our league.
From an academic perspective, we sort of know what we want the agent to accomplish, but like a superior graduate student they rapidly outpace us. Do we really understand the results that we produced? Isn’t it more comfortable to just assume our magical agent got things right? If there are hallucinations in the code, will we ever be able to catch them?
Like many social scientists I have ever-changing views about the promise of AI. I veer from, it’s useless, hallucinations, etc etc to it’s life-changing, look at my pretty pdfs. When I worry about it, I worry about my kids getting jobs (though obviously I’d secretly like them to live at home with me forever anyway) or I worry about some kind of Skynetesque AI doomer scenario.
But maybe what I should be worried about is the over-abundance of wonder - of endless moments where mankind is “face to face” but it turns out very much not “for the last time in history” with “something commensurate to his capacity for wonder”. Can we come to terms with unlimited creative possibilities? Who is going to appreciate all the wondrous outputs of our agents? Who even has the time?
Perhaps it is pointless to resist. But I expect something innately human in us will do so. We will struggle against all the wondrous possibilities our agents provide, we will thrash impotently, we will push back subconsciously, viscerally, animally.
To paraphrase Fitzgerald, we will still desperately “beat on, boats against the current” but this time “borne forward ceaselessly into the future.”















A very good piece (and one of several which have enhanced my lamentable knowledge and experience of AI thus far).
But even though I think AI is already affecting my consultancy business adversely, I'm 67 in April and not that bothered. So what really strikes a chord is "When I worry about it, I worry about my kids getting jobs"
Both my kids are in their 30s: one is a data visualisation developer married to a website builder; the other is a restaurant general manager whose partner is a proper builder (and a plumber). My perceptions of which one to worry about have changed diametrically in the last 12-18 months!
If people just want to try it out, the app version has a much more user friendly interface and the free version still lets you / it make stuff. I haven't asked it to create a game or anything, but it did create a few websites which more or less did what I wanted them to do - take some live financial data and interpret it, let me know when it changed, etc. (Because I only used the free version, I could only get it to do one 'project' per day, before hitting usage limits). I did find it quite intuitive in understanding what I wanted to do, just from a prompt of a sentence or two and then asking relevant questions to refine what I wanted.