Hi. If you’ve been following along all these lessons, you’ll remember that lesson one, we started using AI in the form of text chatting, such as ChatGPT, Google AI studio. You could use Anthropic’s Claude as well. There’s a whole host of different AIs that you can use for that.
We then took a look at using GitHub Copilot through a companion app called GitHub Copilot for Xcode that integrates a little bit more fully with Xcode, although we didn’t find it particularly useful. In the last lesson, we concentrated looking at an AI enhanced IDE called cursor. Again, there’s many of them. Visual Studio Code integrates with GitHub Copilot really nicely. There’s a thing called windsurf I believe is now been built by OpenAI. So there’s a whole host of those as well.
And our final category of AI enhanced development for iOS apps is in the form of terminal programs. We’re going to use something called Claude Code. There are others as well, including OpenAI Codex, but we’re going to take a look at using Claude Code.
So it’s a little bit confusing. Claude is a category of models including Sonnet including Opus each, which have different versions. But then on top of those models, there are different ways to interface with them. So you can actually use them through GitHub Copilot. They are available in that way. You can use them through various different APIs. Or here we’re going to use them through any product created by anthropic Claude called Claude Code, which is a terminal program.
Let’s take a little look behind me at some of the things that it can do as a little video here with two excited looking people in a wooden room, because that’s my head’s on the way to excited people in a wooden room, because that’s how we introduce all AI things these days. Wood is good, and AI is good. AI is definitely not metal and plastic and coming for our lives.
It allows you to do a whole host of different things. And in actual fact, it’s quite a powerful tool for doing really quite deep thinking. It’s very easy to install. It requires Node.js 18. I’m going to go small so you can see there’s a little better required. Node.js. And it’s a one of those joyous copy the link and paste it in your terminal, all kinds of things that always feel really safe.
So I’m going to copy this for now. And then I’m going to go over to my terminal. First of all, I want to make sure that I’ve got npm installed on macOS. I would suggest to install that with homebrew. If you don’t have homebrew, go and install that. You get that at brew.sh—Another copy and paste this thing into your terminal kind of vibe. And then you would just do brew install npm, which I should already have installed, and hopefully it’s doing an auto update for for homebrew. Let’s bear with it a moment when it does that. There we go. It’s already installed. That’s good.
And if I do npm dash dash version, I can see that I have 11.3 doesn’t really matter. I care about node version which needs to be bigger than 18. And it says that we’re on version 24. Cool. Then I’m going to paste that line in npm install dash g means it’s globally, so it’s not. If you don’t do that, it’ll install it just in the current directory, which is how node JavaScript based projects do they install all the dependencies in the current directory? Unless you use dash G, in which case you’ll be able to use everywhere.
And it’s @anthropicai slash Claude Code and go ahead and install that. There we go. It’s that’s now added 12 packages. To get to run it, I just type claude. I navigate to the directory. I’ve got my code, which for me is this m3 aid-materials. 04-claude final. That’s where I’m going to be working.
So then first of all, we need to say do we trust this code? So there’s nothing nefarious in there that I don’t trust. The people have created that Claude might potentially execute or share, or anything like that. So there’s nothing in there that’s untrusted. So I’m going to proceed, which is all good.
And then I’m just going to move my face over here. And then that’s me installed. Now, the first time that you do this, it is going to ask you to log in. You do need an account with Claude to be able to get this to work. And if I jump back, we can have a look somewhere at pricing is, so the various different ways that you can pay for it.
Claude Code is included in the Pro and the Max plans. This pro plan is basically the entry level plan that allows you to use the web interface for chats. So a little bit like if you use chat GPT, then that’s kind of the equivalent, but using different models. And then there are two max plans. The difference, I mean, all three of these pretty much is how many fast API requests you get and how many you get on the on the bigger model, the opus model. And that’s because they’re quite expensive. These requests are quite expensive because they take up huge amounts of energy.
However, there is an alternative way that you can pay for this, and that’s the way that I’ve got mine set up and that is to use the API. I have an API account, and Claude code links with that API account. It talks about. So these are the models we talked about. We’ve got opus, sonnet and haiku. So large, medium and small. It talks about the price per input and output based on tokens.
And so this way is very much pay for what you use. There’s no sign up for $200 a month. See how much you know, you might not use anything like that much. This here, you will literally be paid for what you use. If you’re using it a lot, then the all you can eat an inverted commas subscription is probably better for you, but this is good to me. I just pay for what I use.
Anyway, so enough of tedious information. What you do is you set up an account, you tell it that you, I want to use an API account. Okay, so if you want to use the API approach, you need to go to console.anthropic.com and log in there. You get $5 for free to start with, which is enough to be playing around with. But then within, then you can specify how much you want to, how much you want to add. So you kind of create your credits. You can see that I have $8.97 left. And then within there I can specify that I have a month’s limit. I’m only going to spend, at very maximum $50 a month on this.
So that’s that. I’m not going to jump back over into Claude we’ve loaded it, and it’s telling me. Welcome to get started. What I would like to do is just find. Tell me about this project, please. Can you tell me about this project?
So I just type in that in the same way that you would type into any of the other chat apps. We’re now doing it in the console. So it’s going off. It’s read the spec. Something that’s interesting is it is always telling you how long it’s taking is telling you how many tokens it’s using.
It’s told me this is yesterday’s weather. And I said that shows the weather was like in your exact location 24 hours ago. Focused prototype uses the open meteo archive API hyperlocal historical weather data. So it then talks about what it how it works and all these bits and pieces. And it’s also guessed that it’s educational materials because it’s got starter and final. Very clever.
Okay. So what I would like it to do is could you take a look at the spec and tell me what is not yet implemented, please. So exactly the same chat that I would do before. It’s going off and it’s starting to spend some tokens. It reads all of the files in. And now it’s getting the response. So this is tokens. Output tokens. Helpfully, a token isn’t a word. Some words or a token. Some words or multiple tokens.
So it’s read those. It’s looked at all of the implemented features reckons those are done the implementation. So it says the implementation appears complete and matches the specification. The only unused file is ContentView which contains the default template. But the app currently uses WeatherView as its main interface.
Okay. So all right. Could you remove ContentView then please? So when you ask it to start making changes to code, then it will ask for your permission. So in this case, it’s telling me it wants to run a bash command. rm The name of the file. Do I want to proceed so I can say yes? Yes. And don’t ask again for rm commands in this directory. Then you can say no. And token orders do differently. So I’m going to say yes. You can delete that file. There we go.
That is a very quick summary of getting Claude going. And us being able to start asking questions. And we’ve done something. In the next video we will come back and take a look at why the app doesn’t work the way that we expected it to, and see if Claude can help us fix that. So we’ll see you then.