---
title: "Cody: the AI assistant that actually knows your codebase"
url: "https://aaronfrancis.com/videos/cody-the-ai-assistant-that-actually-knows-your-codebase"
path: "/videos/cody-the-ai-assistant-that-actually-knows-your-codebase"
type: video
author: Aaron Francis
published: 2023-12-14
topic: "AI & agents"
keywords: [cody, ai assistant, codebase context, sourcegraph, code generation, laravel, code understanding, debugging, ai tools, code assistant]
youtube_url: "https://www.youtube.com/watch?v=5Z3TBxUH0lo"
site_index: "/llms.txt"
keyword_index: "/llms/keywords.txt"
---

# Cody: the AI assistant that actually knows your codebase

## Chapters

- Who is Cody?
- Trying it on the Laravel framework
- How do I add a scope?
- Trying it on an obscure repo
- Using Cody to fix our code
- Code generation
- Cody is GA, with a few rough edges

## Transcript

**Aaron Francis:** A few weeks ago, the team at Sourcegraph reached out to me and they're like, "Do you wanna make a YouTube video about Cody?" And I was like, "Yeah, I would love to make a YouTube video about Cody." And you may be thinking, who is Cody and what is this video going to be about? A better question is, what is Cody? Cody is an AI coding assistant, and it's just totally free for personal use, which is kinda crazy.

**Aaron Francis:** You can pay for it for your enterprise, but for personal use, it's just free forever, which is kinda wild. But more interestingly, I think, is it knows your code base. So it, like, ingests your entire repo, and that gives it context to answer the questions instead of just kind of making stuff up, which can be super frustrating.

**Aaron Francis:** So let me show you how it works here on the Laravel repo. I've just pulled down the entire Laravel framework, and, eh, we're just gonna start asking it some questions. So whenever you enter a new project and you're like, "Ooh, I don't really know what's going on here," this might be a good use case for you. So I've got the repo open in VS Code here, and I've just named it Laravel Cody because my creativity knows no bounds. And I'm gonna open Cody, and we're gonna start chatting with the code base.

**Aaron Francis:** Instead of using Claude 2.0, or is it Cloud? I'm gonna use ChatGPT-4. This is one of the things I do like, is it lets you select the model. Presumably, as new models come out, I just get to, to use them. I don't have to, I don't have to do anything. So I like that they let you choose the model. Um, and then down here, you can enable that enhanced context, which is where it knows your entire code base.

**Aaron Francis:** And so I've en- enabled those embeddings, so now we can just start chatting. So I can say, um, "Can you give me an overview of this repo?" Coming into a brand-new code base, this would be really, really useful to kinda get an overview, especially when there's no documentation or README or something like that. One of the things that I super love about Cody is it cites its sources.

**Aaron Francis:** So one of the things that's really frustrating with AI is sometimes you feel like it makes stuff up. But here, it tells you where it got or some of the places it looked for its information, and you can go dive in and look at those same places. So let's see how it did. Um, yeah, I mean, this, this is right. This is right. It's telling me everything about Laravel.

**Aaron Francis:** Um, I imagine it's pulling a lot of it from the README. So it looks like this probably came from security. This came from the license. Um, this is interesting 'cause it's not specifically laid out in the README. It's just the repository structure. And yeah, this is all, you know, this is all right. If I didn't know this code base, this would be more interesting, but this is not interesting to me, so let's just clear the screen, and let's do another one.

**Aaron Francis:** Let's go to ChatGPT-4 again, and I wanna say... What do we wanna do? Um, how do I add a scope to a model? Let's see if it can figure out how I can add a scope to a model. So it looks like it read 15 files, um, and I'm very curious to see what this comes back with. So it looks like to add a scope, you need to define a method with @scope prefix.

**Aaron Francis:** That is correct. Ah, and it's actually writing out a scope for me. This is great. Um, so it tells me all of the steps, which is nice. You know, if I, if I were to read, that would be really helpful. We don't read. Developers don't read. You should read the docs, but we don't read. So moving on, it shows me exactly how to do it, and it actually got the doc blocks right and everything. And then it shows me how to use it.

**Aaron Francis:** So that's pretty cool. Um, yeah, remember, scopes are chainable. Yeah, very cool. Now, I kinda asked it a, a specific question, right? Like, I knew-- I know what the word scope means. If I'm coming into a project and I'm not super familiar with Laravel or, say, I'm opening a Rails project for the first time and I'm trying to figure something out, what I would probably ask is something more like, "How can I..." Let's see.

**Aaron Francis:** What would I say? How can I create a bit of a reusable query on my models? Let's see how that does. So instead of using the specific, like, jargon word of how do I create a scope, I say like, "Hey, here's what I'm trying to do. How do I do it?" And yes, thank goodness, it nailed it.

**Aaron Francis:** Um, this is great. So you can create reusable queries by defining query scopes. A scope, so it, it picked up that word for me. And then it goes on to say there are local scopes and there are global scopes. And it shows me, um, a couple of instances of a local scope, how to use it, and then a couple instances of a global scope and how to use it, which this, this is great.

**Aaron Francis:** This is exactly what I'm looking for. Um, and it's continuing to go on with the global scope and shows me how to-- oh, that's nice, how to turn off a global scope as well. It's just, it's continuing to, it- it's just continuing to produce. I didn't know if I knew about anonymous global scopes, so this is pretty good, right? But there's a lot of content about Laravel out there, and I feel like, I don't know, it's kind of a softball.

**Aaron Francis:** Give it a huge well-known framework, ask a, you know, a medium level question, and it gets it right. We're gonna look at a repo that is slightly less well-known than the Laravel repo, and that is the personal and private repository for aaronfrancis.com. Not quite as much has been written about that. So let's look for something completely random, completely esoteric, and boy, do I have the file for you.

**Aaron Francis:** It's called BladePortal. Now, imagine if Laravel Blade had portals. That would be pretty cool. Would it be useful? Not super useful, but it would be very, very cool. And so I wrote that. Now, BladePortal, never been seen before. Nobody has any context on it. I'm gonna highlight the whole thing and ask Cody. I don't want Claude.

**Aaron Francis:** I wish it would stay on ChatGPT-4. I'm gonna ask Cody, uh, "What is going on here?" And it's gonna take that context and send it off, and it's gonna figure out what is going on in this completely novel bit of code. And it says, "It's a utility for managing content placeholders and portals within Laravel Blade templates." It tells me what Blade is, and then it gives me a breakdown of the entire class.

**Aaron Francis:** And you can see it looked a few other places for context. Um, I don't know that it got anything valuable out of any of these. Maybe in, uh, this one it registers a service provider, but it looked at a few places. But mo- most importantly, it looked at this entire file, and then here is, here's the overview. Here's the documentation that I didn't write for BladePortal.

**Aaron Francis:** Um, BladePortal Eh, I don't know. I don't think it's that useful. Uh, it's kinda cool. Uh, maybe I'll do a video on that someday. But the important thing is Qody figured it out. It's never been published before. I sent it off, it came back with some actually useful information. We've been using Qody to understand code, which is nice, but why understand code when you can just write bad code and have the computer fix it?

**Aaron Francis:** That's a joke. You need to understand your code. But anyway, let's say we open up Qody here, and we say, "Show me the smells in Blade Portal." And this is gonna look through the Blade Portal file and figure out what some of the code smells are. There's a, a document code command, there's a generate tests command, and there's one more that I'm gonna show you, which is just, like, kinda clean up or, or make the code better.

**Aaron Francis:** But here's the result. Here's the result from the smells, uh, command, and it says it's generally sound OOP, which that's what I'm looking for. I just want a computer to tell me I'm doing a good job. It does tell me, "Hey, here are some things that you can fix." The last thing I wanna show you is some actual code generation here. So here we are in the command that puts the articles on my website. It just looks in a views articles folder and then does some stuff.

**Aaron Francis:** But what I'm actually looking for is, yeah, actually that right there. I'm actually just looking for markdown. So it figured that out, and it wrote that for me. I could say, you know, something like, "Ignore hidden files," and drop down here, and there you go. It would do that. But since we restricted it to markdown only, I don't super need that. So it does do that auto-completion. And then very interestingly, I can come down here and highlight this bit of code and hit Command + Shift + V, and then I can tell it to do something with this particular bit of code.

**Aaron Francis:** And I can say, "Combine these filter and reject, uh, functions into one function." And it's gonna work on that. And so the thing here is I'm mapping over this collection twice, and, you know, I don't really need to be. And so it's gonna do something and then put it back together.

**Aaron Francis:** So now I'm filtering to say if it has an ID, well, it has to have an ID, and if the app is local, that's fine. Otherwise, it can't be a draft. And so it combined those two, um, it combined those two callbacks into one callback, which in this case doesn't super matter. But this is a nice way to refactor, to say like, "Hey, here's the code I have.

**Aaron Francis:** I'm gonna tell you what to do. You write the first draft, and then I'll come in and do it again." And here it pretty much nailed it the first draft. I may do a little formatting change, but this is what I'm looking for. I can see this giving me superpowers on a project that I'm already familiar with or helping me get up to speed on a project that I'm not really that familiar with. Maybe best of all, maybe the best use case is when I open a project that I wrote and I haven't touched in six months.

**Aaron Francis:** There's no worse coder in the world than me six months ago. Not today, six months ago. And so instead of looking at this code and thinking, "What did I do here?" I can just ask Qody, "What did I do here?" And it will tell me. If you're watching this video, which logically you must be watching this video, then Qody is generally available. As of December 14th, it is generally available. I have found there are a few rough edges.

**Aaron Francis:** Sometimes the models time out. Sometimes it grabs weird context to send off. And I just kind of run it again, and it works. I do wish the PhpStorm integration was a little bit better. I know that they're working on it. Um, but everyone in the world uses VS Code except for me. So the VS Code one is great. The PhpStorm one is coming, but they put most of their energy into VS Code.

**Aaron Francis:** So try it out. Go to sourcegraph.com/qody. Let me know what you think. Leave very nice comments here for the Sourcegraph team. I really appreciate them, um, sponsoring the channel this way. So try it out. Let me know what you think. See ya.

---

## Related on aaronfrancis.com

- [Dreaming Bigger With AI](/podcast/dreaming-bigger-with-ai-e9a5a534) *(Podcast · 2026-02-11 · shared: laravel, ai tools)*
- [Aaron Francis: Building and Teaching Cool Things](/podcast/aaron-francis-building-and-teaching-cool-things-39697cbb) *(Podcast · 2025-03-11 · shared: laravel, ai tools)*
- [The Big Reveal](/podcast/the-big-reveal-675733cf) *(Podcast · 2025-01-28 · shared: laravel, cody)*
- [Origin Stories](/podcast/origin-stories-61d85e94) *(Podcast · 2022-03-15 · shared: laravel, code generation)*
- [About](/about) *(Page · 2026-11-25 · shared: laravel)*

## Relevant Resources from Aaron Francis

- **[Solo](https://soloterm.com)** (overview on site: [/software](/software)): All-in-one agentic development platform and terminal workspace built by Aaron Francis for orchestrating processes and AI coding agents.

## Search aaronfrancis.com (2-Hop Static Keyword Index)

Pick the alphabetical shard matching any topic to find exact pages across all articles, newsletters, videos, talks, and podcast transcripts (every shard is < 40 KB):
[A-B](/llms/keywords/a-b.txt) · [C](/llms/keywords/c.txt) · [D-E](/llms/keywords/d-e.txt) · [F-G](/llms/keywords/f-g.txt) · [H-J](/llms/keywords/h-j.txt) · [K-L](/llms/keywords/k-l.txt) · [M-N](/llms/keywords/m-n.txt) · [O-P](/llms/keywords/o-p.txt) · [Q-R](/llms/keywords/q-r.txt) · [S](/llms/keywords/s.txt) · [T-Z](/llms/keywords/t-z.txt) · [Directory](/llms/keywords.txt) · [Site Map](/llms.txt)

Shards for this page's topics: `cody` ([C](/llms/keywords/c.txt)), `ai assistant` ([A-B](/llms/keywords/a-b.txt)), `sourcegraph` ([S](/llms/keywords/s.txt)), `laravel` ([K-L](/llms/keywords/k-l.txt)).

## About Aaron Francis (Current Context)

Aaron Francis is VP of Marketing and Community at [Laravel](https://laravel.com), founder of [Try Hard Studios](https://tryhardstudios.com), creator of [Solo](https://soloterm.com), co-host of [Mostly Technical](/podcast), and author of [Mastering Postgres](/courses), [High Performance SQLite](/courses), [MySQL for Developers](/courses), and [Screencasting.com](/courses). Full bio: [/about](/about) · Current focus: [/now](/now).
