Devreal

Agentic Coding with Discipline and Skill: Practical Techniques and Tips

Event: AI by the Bay

Agentic Coding with Discipline & Skill: Practical Techniques and Tips | YK Sugi, AI By the Bay 2025

Recording: Agentic Coding with Discipline & Skill: Practical Techniques and Tips | YK Sugi, AI By the Bay 2025

Uh my talk content is about 25 minutes. So I guess I can introduce myself first. My name is YK. I'm a developer experience manager at Daft. It's also known as Eventual and different names. Uh I've also created a bunch of YouTube videos. You might have seen one of them hopefully. uh at some point in your life

A lot of people say like they learn data structures and algorithms uh from my videos and stuff like that. Uh it's actually my first time in Oakland. Excited to be here. Yeah. Uh I I I go to San Francisco a lot, but I don't come to this side of the town a lot. So, it's good to be here. And just quickly, who here is a developer? Nice. Mostly developers

Uh who here is uh data engineer data science a few data scientists a AI engineers okay few product managers not a I guess not a lot of data people more engineering people is what I'm seeing engineer managers maybe a few cool okay uh so the talk I prepared is basically for you know this exact audience you know a mix of uh engineering data people you know product whoever you are I hope uh there's something that you can take away from this and I'm just going to take some water and then get started on the main content so as you can see uh this talk is called cloud code masterass everything everything I've learned about asentic coding in the past 31 months We're just going to get started here. I wanted to first uh quickly go through my history with agentic coding. I started with GBT4. I was really impressed with GBD4's abilities to write good code when it's given good context. And just like a lot of other people, I went on to GPD4 Turbo after that. And shortly after that, I started to build one of the earliest agent coding tools. Uh I called Kaguya. I started to build it basically 31 months ago

It's not actively in development anymore, but I developed it as a Chachib plug-in that gave Chachib access to your local files so that it was able to directly write files on your local drive, edit files, move files, delete files, and run code in Python, JavaScript, and bash script. Back then, it was a strange idea to give your AI access to your local drive. Why would you do that? But of course, nowadays, it's pretty common place, partly thanks to cloud code. And after that I've contributed to multiple agentic coding tools in an engineering and product capacity. And as said earlier now I'm currently a developer experience manager at eventual staff which means I do everything to improve the developer experience there. And also as part of my job and outside I've been pretty intensely agentic coding I would say six to seven days a week uh not every single week but on a typical week. Now how this talk is structured is I'm going to go through 16 lessons over the past 9 to 31 months. Nine months being the time uh since cloud code was launched

And I'm going to go through six specific project examples to do that. Too small, too medium, too large. Kind of like t-shirts, I guess. And I'm going to go through five custommade visuals just made for this presentation to explain some of my ideas and techniques. So, who here is ready for all of that? Perfect. Let's do it. Um, first of all, with the small projects, I wanted to put lesson number zero here because I think a lot of people already know this one. With AI and AI agents, more one-off projects become practical

You might have experienced that. I've experienced it. And one of those projects is what I call GitHub growth analysis. Shortly after I joined eventual staff, we experienced this huge growth on our uh open source repo, it went from uh 3,300 to 4,300 in 17 days. So basically it grew by more than 30% in 17 days even though the project existed for more than uh two years. So that was a huge growth for us. So I started to ask myself, okay, how did that happen? Exactly. And one lesson I can share from this is that CLI in my opinion is the ultimate rag tool in a traditional rag system

Let's say you you have a rag system for answering any question about your codebase. Then what you would do is your rag system would fetch what it thinks are the relevant code snippets from your codebase based on the user query using embeddings or whatever you want to use and then together with the query and the code snippets you try to answer the question using your AI model whatever you choose but with rag with CLI that's essent that's essentially what you know tools like clo code uh are given the query the AI model itself decides okay what do I need to do exactly to answer this question do I need to GP code snippets do I need to run a GitHub a CLI command 10 times do I need to run curl three times do I need to create a Python script and then run it show the result and then answer the question and as you can see it's a lot more advanced system you know it's a fundamentally different system in my opinion and This is pretty much the workflow I went through for this particular project too. I started by you know having cloud code fetch data from GitHub relevant data and then I started to have it visualize it using Python. Eventually, I was able to come up with this particular visual, you know, two charts put together, color coded and everything. And basically, I was able to get better insights thanks to this little project. And one more lesson I can share from this is that I was able to create the these charts and do this analysis because of my fundamental coding and data skills. So I would say you know those fundamental skills like writing, coding, data skills are still relevant. In fact they get amplified by your AI agents

The second example I wanted to share is this mortgage analysis project. It's also a small one and quick background on this one is that I wanted to decide okay should I get variable or fixed mortgage. If you went through this process ever, you know that it's a big decision in Canada can you know in Canada or anywhere else. So I wanted to do a little bit of you know e economics types analysis and one less I can share from this is that everything is rag you know like I said glow code is a great rag tool but you can kind of supplement whatever it's able to get with your own information and command a and control a are your friends in my opinion in the world of AI. So this example uh I created this chart with inflation, unemployment, interest and miser index. Miser index being inflation plus unemployment. It's a real index. And the way I created this chart was by going to different websites and then fetching different data

Instead of, you know, just having cloud code manually fetch it, you know, by itself, I had it write a piece of JavaScript code that I could run in the browser console directly so that I could download the data directly instead of, you know, relying on Claude's ability to like recite these pieces of data. Exactly. And there are different situations like that where GLO doesn't necessarily have access to particular data like maybe Slack messages or Reddit posts, stuff like that. And in that case you can just do you know command a control A and then give it uh to cl code by yourself. Now on to medium-sized projects. Example three I wanted to share is this uh super voice assistant project that I've been working on for a while. It's a voice transcription u app that works locally on your Mac. And one lesson I can share related to this is that voice is faster than typing

I I've been talking to you know AI using my voice for a while now. Basically for three years since chatbt u and I found that you're able to provide a lot more context a lot faster and it's a lot more fun in my opinion. So I've been using tools like you know super whisper mac whisper but I found that uh these tools are lacking in some ways. I wanted to create my own tool, an open source tool, but I realized I know nothing about nothing in this area. Basically, I needed to answer questions like, you know, how do I build a Mac app in the first place? Like, I don't even know Swift, what voice transcription models do I need to use and what is the best way to run Whisper on my local machine? I could have Googled all of these questions manually, but I just, you know, used claw code as a Google replacement essentially, and that worked pretty well. Number six I wanted to share is that you want to learn to break down complex tasks into smaller ones. A good example from this one is I wanted to develop this feature where it would detect the you know keyboard shortcut start recording audio and transcribe whatever I said and that's a pretty big task. If you had asked you know cl code at that time to develop it it would have failed miserably because it's too complex

So in that case I you know I decided to create smaller features first like just transcribe a pre-recorded audio file that's it nothing else and then another one I built was just detect the keyboard shortcut and show alert nothing else. So I built these smaller features before combining them together. And the way I personally visualize it is be you know instead of going from point A to point B directly you can go from point A to point A1 A2 A3 and then B at the end. You might think this is pretty obvious but it's not necessarily obvious depending on the situation. For example, yes, just yesterday I was talking to a colleague of mine about code optimization. and he wanted to use uh cloud code to optimize some some of our rust code that runs behind uh our Python library and he was just asking close code to you know run uh different types of algorithms and try different things and then see what works but this is a big task if you think about it so I suggested why not break it down to two steps first have it run profiling jobs and then let it optimize the code so even just with this example. You can see that just breaking it down into multiple steps, it becomes much easier. Number four is uh this quick start project that I've been building pretty recently

It's uh this basically this guide that I've been writing uh for a new user for new users of Daft and it's essentially like a blog post. And for stuff like that, I found that cloud code is great for writing too. By the way, I'm not getting paid by them. I I just think it's a great tool. Um, and the way I personally use it is basically I just speak to it, you know, using my own voice transcription model, uh, voice transcription tool and then go from there. I say, okay, I I want this kind of stuff and then this and this and this and it often gets to like 50% 60% of the way there and I need to like work with it to fix it. Like I I say, okay, this sentence is great, but this other sentence is not good. I I need to remove these things and it just works

And you can also let it do research if you're not sure like exactly how to do certain things. You can point it to let's say a GitHub repo and then you know kind of do its own research uh as your own writing assistant. Now on to large projects. The first one I wanted to share is the custom Nex.js website that I've been part of a team working on. It's the main website of Daft. And one problem I noticed, you know, pretty much right after I joined was we had this problem with this uh testimonial page where it it wouldn't transition at the right timing uh when I clicked uh you know into a certain customer. So I wanted to kind of figure it out figure it out you know have basically have cloud code fix it. And basically when I have a problem like that my approach is just point you know the agent at the problem and then iterate from there

So in this particular case I said I have this problem I described it in detail. Can you solve it? He said okay I'm able to identify the like the general area of the codebase I need to fix but the solution you came up with was not that good. So I started a fresh conversation and I say okay here's the problem. Here's the particular file that you need to look at. here are the different solutions that you know you may have tried but they they are not the right solutions. Can you come up with something else and it was able to finally then able to come up with a good solution. Lesson nine in my opinion is you want to be braver in the unknown. So a quick example from our own experience is we made a huge mistake with this website uh where we sent out a bunch of emails to subscribers like 16 emails in like 16 minutes or something that something really bad

Uh so I I felt you know pretty bad about it. I wanted to kind of uh dig into it. So basically I just asked okay this problem happened. How did it happen? I'm not familiar with the codebase but can you help me understand? And once I was able to identify the exact function, I was like how did how did this uh particular function cause this problem and how could we have written it better? And this entire process led to best you know better postmodm and it gave me more confidence about like uh being able to discuss with my colleagues about this problem. And one lesson uh that you can hopefully take away from this is that you need to be able to choose the right levels of abstraction when you're asking these questions. In other words, vibe coding is a spectrum. The way I visualize this is like this where you start with probably uh high level questions. You might say, you know, five coding questions, five analysis questions, and then you can go down into more details like file levels, function levels, line by line, maybe even checking dependencies

And the final example I wanted to share is the docs project. This is the uh the ripple that we have for our entire docs. This is where, you know, I put the medium quick start project too. And I had this particular issue where a CI job on my PR kept failing and it was pretty frustrating. I wasn't sure why uh what happened and I asked you know I pointed code at this problem and then I tried to be braver in the unknown and I said why did this uh job fail and I linked to the PR and it gave me an answer like oh it had a storage issue but that wasn't very helpful you know what storage what's causing it so I thought maybe there was a certain commit you know in the past that caused this particular problem and after that commits all the CI jobs and PR jobs PR uh CI jobs started to fail but when I asked that it turned out that's not the case it came back to me and said hey you know some of these jobs are failing after a certain point but not all of them so it's like a flaky test so I said okay what's the difference between the successful jobs and failing jobs and it was actually able to identify the problem exactly what the problem was, you know, it went straight to the dependencies. In this particular case, it had something to do with uh update with a dependency. And when I saw that, I was like, okay, that that sounds plausible, but is it true? You know, it had this uh PR description that it generated. It said GitHub updated Ubuntu latest runner image from this one to this one

It said it had this evidence this you know link runner image uh failed jobs successful jobs but I thought is it hallucinated is it true I'm not sure so I decided to double check everything I had cloud code itself verify its own results you know in a separate fresh conversation I said can you verify this sentence can you verify this link can you verify these links and it was able to do exactly that so sometimes you want to check you know the results uh output to yourself. Sometimes you want to have your AI agent do that for you, whatever you decide to use. And this gave me enough confidence to, you know, turn this draft PR that I created through cloud code into a real PR. And this was a problem that I personally experienced, but it turned out other engineers, you know, eventual and daft experienced this that same exact problem too. So I was able to unblock them. And that was kind of interesting because it wasn't necessarily their expertise. You know, their expertise is probably like, you know, uh Rust, Python, and stuff like that. Not necessarily the the CI jobs, but I was able to help them unlock

So that was a huge win for me and for the team. So just quickly additional lessons that I didn't get to cover through this specific examples. 12 is the terminal is the new ID in my opinion. I find myself opening the ID less and less. I just go to the terminal straight and that works pretty well. 13 is visual git clients are lifesavers like uh they always have been but especially with AI generated code I think it's nice to have a way to quickly gen quick quickly check generated code so these are good to have and they're actually great for PR reviews too I put this one here because it's nonobvious to a lot of people you know instead of just using specific tools for PR reviews I know they exist but you can just have code you know look at a PR our uh link you could say can you use GitHub CLI to fetch all the information you need you need to help me review it and then let's go through your file file by file and then you can kind of do a PR review that way and the final one is AI context is like milk because it's best served fresh and condensed uh that's that's pretty much everything I wanted to talk about today if you want to find me on LinkedIn It's on the left side. If you want to find the voice transcription open source app that I created, it's on the right side. And thank you so much

[applause] We have uh plenty of time for questions. So, if you have one, please raise your hand and I will bring you the microphone. Do you have any tips for managing the context? When things get weird, do you just start over? >> Uh, yeah, I think starting over is a good one. And if you need to like bring bring over certain parts of the context, there is like a built-in compact function functionality, but I tend not to use it personally. I just tend to just uh ask it to you know put the important parts in a file you quickly review it and then you can start a fresh conversation and then go from there. What are your top three tips for saving tokens? >> Right. Saving tokens. Um >> balling on a budget

>> Say again. um just designing on a budget, you know, >> right? Um so I I use a monthly, you know, subscription service. It's like either $20 a month or $100 a month and that that helps a lot in my opinion because I don't have to worry about like every single token. But I think the other thing is just keeping each conversation short and focused. Any other questions? >> And while we wait for the next question, uh I think it's good to like try try out different services. Like I know let's say Google AI Studio gives you a bunch of free tokens. So like if you don't if you don't want to use cloud, you can use like different services too. Uh hey so when you said kind of be comfortable with pointing it to unknown things like but how do you get the confidence that it it is doing the correct thing like I know you mentioned you opened up a new conversation and let it verify it but outside of that you like like assume if the model itself is doing something wrong like how do you like are there extra verification tools when do you use when it's kind of when when it's unfamiliar domain for example

>> Uh I I didn't quite get the like last half the question, but my understanding is your question is like how do you know if if it's doing the right thing? >> Yeah. Outside of opening a new conversation in a separate window, like what other tools or techniques do you use to make sure it's it's doing the correct thing in an unfamiliar domain, >> right? Um so to me it's it's all about this, you know, like if you're just vibing, you don't necessarily know if it's doing the right thing. If you want to check, you need to kind of dig in. So, you know, if it's like a data analysis example, you can double check with different sources of data. If it's more of a coding example, you can, you know, you can write tests, you can check the behavior. So, I think there are different ways to go down in the levels of abstraction. And, you know, if you're if you want to be really sure, then you can just check, you know, code line by line. >> I'll actually tack on a question that exact one

How often do you find yourself going line by line and manually checking what that generates? >> Uh, sometimes it depends. It depends on like the size of the project and kind of how I treat the project too. If it's a one-off project, I don't care about lines. But if it's a PR I'm sending to a large project, then, you know, I check it more carefully. >> You have a question? >> Oh, sorry. Um, I'm not sure what operating system you're using, but what terminal are you using? Uh, >> I just use the the default terminal on Mac. I I know there are different ones, but you know, it works well enough. >> Uh, thank you for good talk

Um, it's a question about CLI versus IDE. I use cursor and thinking about going uh trying out cloud code. Uh cursor also talks to your files locally. Uh is there is it just a personal preference or like as far as whether to use CLI or or an ID like cursor um or is there an actual advantage to using the CLI? I think it it is a personal preference at the end of the day and it whenever I choose a tool the the thing I would ideally you know uh prioritize the most is the performance and I think the performance comes down really to if you're using the same model let's say clo you know started 4.5 whether it's in cursor or close code then it comes down to the system prompt and you know tool descriptions and also like the UX So I think if you were evaluating I would compare like different tools to see like which which tools work the best with which models. But you know in my experience cl code seems to work well enough with you know its system prompt and tool descriptions and all of that. >> I think we'll do one more question. >> Okay. Thank you for your talk

So my question would be let's say you have like uh a long lived uh bloody enterprise project with like millions and millions of lines of code and thousands of pages of documentation. How like more effective way to manage all this to and use like LLMs for coding assistance coding like like managing all this stuff. Thank you. >> Right. Uh so I haven't personally used claw code for you know a project of that scale but I think the way I would approach it is you know if it's that big like which parts are important you know are there like any folders that you can exclude or particular folders that you can focus on uh and then you can go from there. The other thing you can try that I've seen other people try is you can use like something like Gemini CLI where I've heard, you know, it's cheaper and they it's able to handle larger context more cheaply. So what I've heard some people do is, you know, they they they have cloud code use Gemini CLI as like a sub aent and then kind of you know pre-process some of that large context. >> All right, thank you for the questions and another round of applause

Thanks for our speakers. >> [applause]