Claude Code best practices | Code w/ Claude — Transcript

Explore best practices and use cases for Cloud Code, an AI-powered coding assistant by Anthropic that enhances software engineering workflows.

Key Takeaways

  • Cloud Code acts like a skilled terminal-based co-worker, enhancing developer productivity.
  • It uses a simple, iterative agent approach rather than complex indexing for codebase understanding.
  • The tool improves onboarding and discovery in unfamiliar codebases.
  • Security and permission controls are integral to Cloud Code's design.
  • Cloud Code can be a valuable thought partner, helping developers plan before implementation.

Summary

  • Introduction to Cloud Code and its purpose as a coding assistant built on Claude by Anthropic.
  • Explanation of how Cloud Code functions as a pure agent using terminal-like tools and iterative search.
  • Cloud Code explores codebases using genetic search methods like glob, grep, and find instead of indexing.
  • The tool features a lightweight UI, permission system, and emphasizes security with cloud provider integrations.
  • Cloud Code aids in discovery and onboarding by helping users understand new codebases quickly.
  • It serves as a thought partner for developers, offering multiple implementation options before coding.
  • The speaker shares personal experience with Cloud Code, highlighting its impact on productivity and coding mindset.
  • Cloud Code is designed to work seamlessly with Anthropic APIs and cloud platforms like AWS and GCP.
  • The tool supports evaluation and improvement through prompt tuning and system prompt management.
  • Cloud Code encourages safe usage by involving human intervention for potentially dangerous actions.

Full Transcript — Download SRT & Markdown

00:06
Speaker A
Let's get started. Welcome everyone to Cloud Code best practices. In this talk, I'm going to talk about kind of what Cloud Code is at a high level. Then we'll peer under the hood a little bit to kind of understand how Cloud Code works. And then knowing that because it's useful to kind of
00:25
Speaker A
know how your tools work. We're going to talk about good use cases for Cloud Code and also
00:42
Speaker A
best practices we've figured out both internally and from our users for getting the most out of
00:54
Speaker A
this tool. But before I get started, I'd like to introduce myself real quick and talk about how
01:11
Speaker A
I ended up on the stage. So, my name's Cal and I joined Anthropic about a year and a half ago
01:24
Speaker A
to help start up a team we call Applied AI. And it's the Applied AI's kind of mission,
01:34
Speaker A
our team's mission is to help our customers and partners build great products and features on
01:49
Speaker A
top of Claude. So what that really means is I spend a lot of my day prompting Claude to
02:06
Speaker A
get the absolute best outputs out of these models. That said, I also love to code and
02:14
Speaker A
I'm definitely one of those coders that like starts a lot of projects, has some crazy idea,
02:30
Speaker A
and then just never finishes them. So, I have this graveyard of just like code that I started,
02:41
Speaker A
never really finished. But I'm always spinning new things up. And late last year,
02:52
Speaker A
I was in Slack and I was hearing about this new tool that a few people are using. They were saying
03:03
Speaker A
it was really cool. And so, on a Friday night, I downloaded the tool that would become Cloud Code.
03:22
Speaker A
And I threw it at this kind of new note-taking app that I wanted to build. And like that whole
03:32
Speaker A
weekend just kind of totally changed the way that I code and think about software engineering. I was
03:41
Speaker A
carrying around my laptop with me all weekend. I was super addicted to just watching Cloud Code
03:50
Speaker A
work and I would press enter and I'd switch over to my browser and refresh and I watched this huge
04:11
Speaker A
powerful application come together in front of my eyes. And I got way farther into this thing than
04:29
Speaker A
I ever would have on my own. And it just blew my mind. And while I was doing this, I was a little
04:48
Speaker A
worried. I was like, you know, I kind of know how these things work. So I'm like, man,
05:05
Speaker A
I'm using a lot of tokens. I hope I don't get in trouble or anyone like notices. I'm not really
05:22
Speaker A
contributing to Anthropic code. But what I didn't know is that the Cloud Code team had
05:33
Speaker A
built this internal like leaderboard tracking how much all the Anthropic employees were using
05:43
Speaker A
this. And over the weekend, I had shot to the top. And so through that, I got to meet Boris
06:00
Speaker A
and Cat and some of the early Cloud Code team. And I was able to start talking to them and say,
06:19
Speaker A
"Hey, I love this tool. I also know a lot about prompting. Can I help you all out?" And so through
06:42
Speaker A
that I got involved and now I'm one of the core contributors on the team and I do a lot of I work
06:54
Speaker A
a lot on the prompting, the system prompts, how the tools work, the tool descriptions and tool results,
07:09
Speaker A
as well as I work on how we evaluate this tool. So when we think about changing the prompts, how
07:20
Speaker A
do we make, how do we know we made things better or the same and we didn't totally ruin Cloud Code. So
07:35
Speaker A
with that said, let's kind of dive in. So, here's my current mental model of Cloud Code and how I
07:48
Speaker A
describe it to people when people ask me. Cloud Code is like that co-worker that does everything
08:04
Speaker A
on the terminal. It's the sort of person that just never touches the GUI. They're a whiz. I think
08:15
Speaker A
of when I was a junior engineer, I had this mentor and I would walk over to his desk and I would say,
08:35
Speaker A
"Hey, Tony, can you help me with this bug?" and he would whip open his terminal and he'd
08:51
Speaker A
be like doing all these crazy bash commands and changing things around in Vim and I'd
09:10
Speaker A
always walk away thinking, "Wow, that was crazy. I should learn how to do that." I never did.
09:25
Speaker A
But having Cloud Code on your computer is kind of like having Tony next to you all the time.
09:30
Speaker A
So, how does Cloud Code kind of work under the hood? At Anthropic, we try to always do what
09:45
Speaker A
we call the simple thing that works. And what that means for Cloud Code is it's what we would
09:56
Speaker A
consider a very pure agent. And Anthropic, when we talk about agents, what we really mean is some
10:12
Speaker A
instructions, some powerful tools, and you let the model just run in a loop until it decides it's
10:28
Speaker A
done. And that's really what Cloud Code is. So it's tools, powerful tools, and the tools that you
10:49
Speaker A
know someone that was really good at a terminal would be able to use tools to create and edit
11:07
Speaker A
files, to use the terminal. And then you can also do things like pull in other things with MCP. Now,
11:22
Speaker A
on top of that, there's how Claude understands the codebase. And if you're going to build a
11:36
Speaker A
coding agent or a coding tool a year ago, you'd probably have ideas like, well, okay, I'm going to
11:46
Speaker A
get this user message about something about this codebase and I'll need to figure out which files
11:51
Speaker A
are relevant. So maybe I'll like index the whole codebase and embed it and do this fancy like kind
11:57
Speaker A
of RAG retrieval thing. That is not how Cloud Code works. We don't do any sort of indexing. Instead,
12:14
Speaker A
Claude kind of explores and understands the codebase how you if you were new to a team
12:33
Speaker A
and new to a codebase would explore a codebase and that is through a genetic search, the same
12:49
Speaker A
sort of search tools you or I would use things like glob and grep and find and it can work its way
13:08
Speaker A
through a codebase and understand what's going on. And when we talk about a genetic search, that really
13:24
Speaker A
means the model can go do some searches and then it can look at the results and can say, "Hm, maybe I
13:43
Speaker A
need to figure out a few more things. I'm going to go do some more searching," and then come back. And
14:01
Speaker A
then on top of these primitives, on top of this agent, we have a few things. We have a very nice
14:19
Speaker A
light UI layer where you get to watch Cloud Code work. You see all the text fly by and we
14:29
Speaker A
have this nice permission system that allows the agent to work and allows and kind of forces the
14:38
Speaker A
human to butt in when the agent is doing something dangerous. And then on top of that, we also care a
14:55
Speaker A
lot about security in this tool. And so because Cloud Code is just such a lightweight kind of
15:04
Speaker A
layer on top of the model and the fact that our model is available not just behind Anthropic APIs
15:22
Speaker A
but also with our cloud providers AWS and GCP, it's very easy and native to point Cloud Code at one of
15:32
Speaker A
these other services if you feel more comfortable consuming cloud that way. Now a lot of people ask
15:42
Speaker A
me, "Hey Cal, what can I use Cloud Code for? Like what is it good at? Where is it interesting?" And
15:47
Speaker A
the reality is it's kind of great at everything. So let's start with discovery. Oftentimes in your
16:01
Speaker A
career, you will be dropped into a new codebase. Whether that means you're switching teams,
16:16
Speaker A
you're switching companies, I don't know, you're starting to work on some sort of
16:33
Speaker A
open source project. And probably when you're first getting started and getting familiar,
16:49
Speaker A
you're not very productive because you're just trying to figure out where things are in the
17:07
Speaker A
codebase, what patterns kind of the team is using, things like that. And Cloud Code can kind of help
17:25
Speaker A
supercharge that onboarding process. You can ask Claude, "Hey, where is this feature implemented?"
17:42
Speaker A
Or since it's great at the terminal, you can say, "Hey, look at this file and look at the git
17:52
Speaker A
history and just kind of tell me a story about how this code has changed over the past couple weeks."
18:06
Speaker A
One thing you can use Cloud Code for, and I think this is underrated, is instead of just diving in
18:19
Speaker A
and starting to work, you can use Cloud Code as a thought partner. So oftentimes when I'm working
18:36
Speaker A
with Claude and I want to implement a feature or we're going to change something up, I'll open up
18:43
Speaker A
Claude and I'll say, "Hey Claude, you know, I'm thinking about implementing this feature,
19:02
Speaker A
can you just kind of like search around and kind of figure out how we would do it and maybe report
19:12
Speaker A
back with like two or three different options? Don't start working. Don
19:32
Speaker A
while we've had this like think hard or extended thinking. Now this is great but with our past models the we wouldn't let our model think between tool calls and that's probably when the thinking matters most. So starting with cloud 4 they can now our models now think between tool calls and
19:50
Speaker A
we can watch this happen. So we have Claude in this project. There's a few different files in here and I'm just going to tell it to think hard and figure out what's in this project and we can watch Claude start to work. And so the way you know you triggered thinking is you'll see kind
20:03
Speaker A
of this lighter gray text and then it'll call some file, it'll call some tools, it'll read some stuff, and then we see some more thinking. And this is awesome. Um, so I encourage you when you're working on tasks and solving bugs, throw a think hard in there. And then the other thing,
20:21
Speaker A
and you know what, we'll just throw it up real quick, is I have this in VS Code, but of course this is in Jet Brains as well, but we have these new great integrations with VS Code and and Jet
20:33
Speaker A
Brains. Um, we can do things like Claude's going to know what file I'm in. What file am I in?
20:42
Speaker A
That is not what I meant to say, but Claude's going to figure it out. And you can do things like this.
20:58
Speaker A
So these are the sort of things I would encourage you to stay on top of. We have a public uh kind of GitHub project called Claude Code under Enthropic. You can post issues there, but we also post our change log there. And so I check this once a week and make sure that I'm on
21:14
Speaker A
top of all the new stuff we're shipping because even I can't keep up with it. So, with that said, we have like four minutes left. I'm happy to answer questions about anything cloud code related. We have it here. I can live demo some stuff if you're interested. Um, let's do a few.
21:33
Speaker A
Thanks. Real quick, this might be obvious, but multiple cloud MD files in a project. I presume that's possible and it just figures it out or no? So, there's a few options, of course, like in the same directory. You couldn't um but you could have one here and one in a subdirectory. And I think we
21:57
Speaker A
changed this so that all the subdirectory ones aren't read in because like Anthropic, we have a monor repo and people would open it at the top and blow up their context with all the claud MDs. So, we encourage Claude when it's searching around and it discovers claw.md files in um child directories
22:16
Speaker A
that are relevant to be sure to read them. But by default, it just reads the cloud MD file in the current working directory when you fire it up. And then also you can set one in like your home
22:26
Speaker A
directory. Um there are things you can do though. We have this new thing like in your cloud MD you can start referencing other files. So you could for instance um do something like this with an at sign um if you have other cloud MD files that you just kind of know you always want to read in
22:45
Speaker A
um to do something like that. Hi. Okay. I um have not had luck getting Claude to respect my Claude MD. Like there's one thing particular. Yes. where I'll ask it to refactor something and then it will leave inline comments explaining the like the what of it is and it's like like something that's
23:04
Speaker A
extremely obvious and so I'll tell it like go and remove any inline comments that describe the what of what's happening and then it will remove it and then immediately do it again and like the same pass. So do you have any strategies for dealing with that? So there's kind of two things that
23:19
Speaker A
fix that. So that was actually kind of a model problem. There's nothing in the prompt. We have actually a lot in the prompt for 37 that said, "Whoa, do not leave comments." And despite that, the model just loves to leave comments. Um, so it doesn't surprise me that your cloud MD didn't help
23:32
Speaker A
much either. We already did a lot I did a lot of work to try to tamp it down from what happens out of the box. So we mostly fixed that in Cloud 4. Now there might be some new weird behavior quirks,
23:45
Speaker A
but the other thing we made better in Cloud 4 is it's just better at following instructions.
23:50
Speaker A
Um, and we've gotten a lot of feedback from early testers that, uh, all of a sudden, whoa, my cloud MD is being followed way more closely. Um, and it might be a good chance to go look in your CloudMD and decide, do I still need this stuff? Maybe I can take some of it out. Maybe
24:05
Speaker A
I need to add a few new things. So, moving over to the new models might be a good time to take another look at what's in there and see what you need and what maybe can go. Uh, for the record, I'm trying to think of something that you might not have thought of. We're doing
24:19
Speaker A
multi- aent execution and parallelization. Can you make it so that for four agents, say agents two and three use the context from agent one, maybe agent four uses the context from agent two at a certain point. Yeah. Um yeah, etc. That's interesting. We're trying to So,
24:37
Speaker A
kind of like I said at the beginning, we're trying to do the simple thing that works, which is just one agent that's great at coding and does everything. Um I think we want to figure that out. Probably what's going to happen is if you wanted to do that, you would ask all your
24:51
Speaker A
agents to probably like write to a shared markdown file or something like that so they can all kind of like check in and communicate. Um, sometimes like I'll be working with cloud.md or claude and I'll just say like, "Hey, I need you to write some stuff in like ticket.md for another developer and
25:06
Speaker A
then I'll fire up another cloud code and I'll be like, hey, read ticket.md like another developer left this note for you. Like this is what you're going to work on." So, I would think about trying to write that state to a file and then just kind of like count on the model's ability to just like
25:20
Speaker A
read files and make sense them um is probably the best you can do today. And maybe we'll figure out clever ways to expose that uh in the product as something more native. Cool. All right. And with that said, I have some rare clawed code stickers that I found in my backpack. So, come find me.
25:42
Speaker A
I'll be hanging out over there or something. Um, happy to share them. Thank you. [Applause]
Topics:Cloud CodeAnthropicClaudeAI coding assistantsoftware engineeringcodebase explorationgenetic searchterminal toolsdeveloper productivitybest practices

Frequently Asked Questions

What is Cloud Code and who developed it?

Cloud Code is an AI-powered coding assistant developed by Anthropic, built on their Claude model to help developers write and understand code more effectively.

How does Cloud Code understand and explore a codebase?

Cloud Code uses a genetic search approach, leveraging terminal commands like glob, grep, and find to iteratively explore and understand the codebase rather than relying on indexing or embeddings.

What are some practical uses of Cloud Code mentioned in the video?

Cloud Code is useful for onboarding to new codebases, discovering where features are implemented, reviewing git history, and acting as a thought partner to explore multiple implementation options before coding.

Get More with the Söz AI App

Transcribe recordings, audio files, and YouTube videos — with AI summaries, speaker detection, and unlimited transcriptions.

Or transcribe another YouTube video here →