.agent folder is making claude code 10x better...

AI Jason · Intermediate ·🧠 Large Language Models ·9mo ago

Key Takeaways

The .agent folder is used to improve Claude code, with a focus on AI agent systems and large language models, including tools like Playwright and Vercel AI SDK.

Full Transcript

[music] How can we get cloud code works well as your codebase became more and more complicated without getting to circles and make you feel frustrated? Once I learned that there are many things you can do to improve performance dramatically through good context engineering and context engineering basically means how you can optimize what goes into conversation history thread for the cloud code or codeex so that only relevant and necessary information are included here to guide agents next actions. As we know coding agent like cloud code at default has 200,000 token context limit and if you run / contacts in your cloud code you will see breakdown token consumptions across different categories and this is a very basic example of what you can do with context engineering optimization because in general the whole context consist of few different things the system promise assistant tools is something you can't really change it always comes with agent so the part you can optimize is the agent has any MCP tools or custom agents that you don't really use but consume a lot of tokens and the memory file here are basically your cloud.md file and I know as your project became bigger and bigger sometimes the cloud MD file just became so big that leaves very little room for the actual message. So in this very specific example I can already see that if I remove all those MCPS from this agent it will immediately give me 2% additional context token window. So this is one very basic example of what you can do to optimize context window better. The key part you want to optimize is the actual message which including the user message you send as well as list of two call actions that the agent take and the key thing here is that how can you making sure all the information in the history here is relevant and reduce noise as much as possible and there are many things you can do here for example sub agent is a great tool that you can use to reduce context so when I look at what happened here if you prompt agent help me add a Google O the majority of the actions agent take here is actually not about making trends but doing the research to figure out the I plan for the implementation and those research steps generally took whole bunch of context in the conversation thread and with feature like sub agents instead of including all those research related token consumption in the main conversation thread you just delegate and offload the whole token consumption related to research to the sub agent where it has isolated conversation thread to do just this and return back a summary of the research which means only absolute necessary information and tokens are included in the main conversation thread. So one very basic thing you can do is that before you implement big feature you can just add a small text that let's use task or sub agent to do the research first so that it can trigger this specific behavior and this is why I often use a compact command much more proactively so that after agent complete certain set of fairly isolated task often just run the compact so that we can proactively clean up the conversation threadive methods that I often use is set up your own documentation system for your codebase there are many different ways you can do Yeah. And this is the part I want to dive a bit deeper today. But before we dive into that, one trend has been happening is that more and more people use cloud code to not only doing coding task but day-to-day operation task from handling your emails, using different system, automate tasking, different productivity apps, journaling and this tell us there's massive layer to build. Look at what type of use case people are trying to hack into cloud code then productionize it into aic products. That's why I want to introduce you to this research called AI agents unleashed a pragmatic report about what kind of things and use case people are hacking agents into who those people are what they doing and dive deeply into real world examples where they interview hundreds of people from top stars and enterprise in the world across marketing sales operation as well as real world learnings of what actually worked and what didn't the common pitfalls and challenge that people are facing today. So you can use those information to direct your agenda product road map much better. One of the favorite part is that they propose a really useful framework to think through if a task and use case that can drive huge business value that people are currently paying for. So if you're trying to build a genus, I highly recommend you go check out this research. You can access this report for free in description below. And thanks HubSpot for sponsoring this video. Now let's talk about my documentation system for cloud code. So the purpose of documentation system is to create a summarized snapshot of your current codebase. So instead of agent every time doing deep research across the whole codebase to find information that it need, it can just read a summarized documentation that clearly pull all the relevant information together. So it has less noise in the context window and also making sure all the relevant information are feeding into context instead of hoping agent pull all the relevant information together by itself. And the question is what type of documentation is useful and how can you make it scalable as your codebase became larger and larger. So the common structure I have is something like this. I typically just have this dot agent folder that contain all the relevant and useful information that I need. So one is a task folder. This is where I store all the PRDs and if you don't know what PRD is basically before I implement any feature I always turn on plan mode and ask to generate implementation plan and after finish I will always store the implementation plan in the task folder. So next time if we are implementing something similar we can link to those implementation doc as a reference and second part is system folder. So system folder contains things like project structure, the database schema, your APIs or some critical and complex part of your codebase and those things can go across different individual PRDs and really useful for agent to get a overall understanding and this is also the part that it can grow bigger and bigger and third is SOPs. This is where we will log the standard process for doing certain things or mistakes you saw agent make. So after I get agent do something, I will ask it to generate a SOP for this specific process. It can be as generic as like adding a new database table, what are the list of action you should take to something more granular like how to integrate a new replicate model. And last but not least also a readme file. So as your codebase became more and more complicated, there'll be just so many docs and the readme here is almost like index of all documentation files you have and when to read which documentation file. So the agent can quickly get an overview of all the relevant documentations and read injection history. So this is a common documentation system I often use. Meanwhile, I also uses update doc command quite frequently. What it does is that it basically includes certain instructions to agent about what to do when initialize documentation structure as well as when I need to update documentation. So I will run this command after I implement certain features or I can use this update doc command after we help agent correct certain mistakes so we don't make same mistakes again. Then it will create this SOP that clearly list out all the step-by-step process and also the related documentations so the agent can consume more relevant information and this SOP doc will also be included in the readme.md. So this is pretty common structure I use for my projects and continuously maintain and updating them. Obviously the best version of documentation system is always something tailored to your codebase. For example, I talked to Simon from AI builder club where he showcased how he builds a whole documentation system with his team for their Lexi codebase. This is the pointer dock as it were that points to everything um how we do all sorts of things and you know best practices um etc. [laughter] And so this is very human readable obviously as well but it is it was designed more for our LLM friends. We document all the ways we do our like migrations how we store the data. We got a whole class of things with methods for helpers, updators, utilities, all sorts of stuff like that. We've sort of split out all that all this stuff into well doumented sections. >> The very first versions of these we did inside Claude. We got Claude to generate the MD files and then we started using cursor and we've got our own little uh this thing here. All right. >> What what are they these things are called? Now cursor now has got the slash commands. I haven't yet experimented with turning this into a slash command because I've always found this rather frustrating that we've only got so [laughter] much room to see what's going on in there. >> But it's not complicated. We go through and then we say review this class >> and upgrade the inline documentation. So we do that first so that then the class has got the best possible inline documentation and then we'll use a a prompt in the prompt interface to generate the class documentation in more detail. So there's this workflow that goes generate or update the inline documentation and then output that into the bigger documentation. So I've just thrown all the LLMs at this to sort of get as best as we can. It makes the whole process easier to manage by exposing all of that. >> And let me give you a quick example of how do I do it. If I start a new project, let's firstly create cloud.md file. I just added one section for docs specifically explain the doc structure we want agent to follow and then give a rules that we always update agent folder docs after we implement certain features and before we plan any implementation always raise the ray me first to get the full context and meanwhile I will also create a doc cloud folder commands update doc. MD. This is a simple prompt that specifically telling agent about the dock structure and what to do when we start initialize the doc and what to do when we ask to update doc as well as some very specific rules when it create new doc files. I'm going to show you how we use this setup to continuously update docs. So I firstly do /update doc initialize. This will race through my current project and try to set up a do agent folder structure. And once it finish you will see that it creates this agent folder and set up a project architecture as a first doc. And there's also a readme file under the dot agent folder which listing out all the docs that we have. Now let's just take you through example of how do we use this. Let's say we want to build a basic app that can do text to image generation using a model host on replicate. So I'm going to copy over a doc and give prompt. How we build a text to image app using model above and I'm going to use a plan mode. And after I finish the plan I'm going to prompt a save implementation plan in a do agent/task folder and start implementation. Great. Okay, now we have this text to image model working. Quite often in my experience, model will fail to integrate replicated model out of box and that's where R can use this update doc command saying generate SOP integrating replicate model. Then what it will do is that it will create this replicated model integration SOP. In this doc, it will explain specifically step-by-step integration process, the directory structure should follow and also there's a section called related documentations. So for this one probably didn't make perfect sense but you can imagine if your documentation became more and more complicated. This can be used as a directory to lead to all related documents and in the end it will also go update the readme as well to include more stuff. So now I can even clear the conversation without giving too much context and give different model which is text to video and give a prompt help me add text to video capability using model above plan implementation and read do agent doc first for context and again I'm using the plan mode. This time you can see it reading through different files to get the full picture. And we're going to do the same thing. Save the implementation plan to /task folder and start implementing. With this one is able to oneshot this video generation model and it is fully functional without any errors. So this how you can imagine this whole documentation system works. You can have higher confidence that I can just come in any time and start implementing something with pretty consistent performance. You can do same thing for your existing codebase as well to ask cloud code start generating the system architecture documentations which can including text project architecture as well as database schema API endpoint and many more. If you're interested we have a specific session in AI builder club where we include detailed instructions of the cloudd and update do commands that you can copy paste as well as a 1h hour workshop where Simon dive deeper into his specific setup. So you can learn how others are generating documentation system for big and complex codebase. I have put the link in the description below for you to join AI builder club. So feel free to click and join if you're interested. I hope you enjoy this video.

Original Description

Get 2025 AI agent playbook for free: https://clickhubspot.com/c2ce5a 🔗 Links - Get .agent system deep dive & workshop: http://aibuilderclub.com?utm_source=youtube&utm_medium=youtube&utm_campaign=agentdocs - Follow me on twitter: https://twitter.com/jasonzhou1993 ⏱️ Timestamps 0:00 /context 1:29 sub agent 2:41 Doc system 6:23 Handle large codebase 8:29 Step by step guide 👋🏻 About Me My name is Jason Zhou, a product designer who shares interesting AI experiments & products. Email me if you need help building AI apps! ask@ai-jason.com #cursor #generativeai #gpt5 #autogen #gpt4 #playwright #ai #artificialintelligence #tutorial #stepbystep #openai #llm #chatgpt #largelanguagemodels #largelanguagemodel #bestaiagent #chatgpt #agentgpt #agent #babyagi #vercelaisdk
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Playlist

Uploads from AI Jason · AI Jason · 0 of 60

← Previous Next →
1 Build Your Own Auto-GPT Apps without coding Step by Step (Dust.tt Tutorial)
Build Your Own Auto-GPT Apps without coding Step by Step (Dust.tt Tutorial)
AI Jason
2 AutoGPT tutorial: Build your personal assistant WITHOUT code (Via Relevance AI)
AutoGPT tutorial: Build your personal assistant WITHOUT code (Via Relevance AI)
AI Jason
3 Create your own AI girlfriend that talks ❤️
Create your own AI girlfriend that talks ❤️
AI Jason
4 How to build with Langchain 10x easier | ⛓️ LangFlow & Flowise
How to build with Langchain 10x easier | ⛓️ LangFlow & Flowise
AI Jason
5 I build an autonomous researcher via GPT | Langchain ⛓️ Tutorial
I build an autonomous researcher via GPT | Langchain ⛓️ Tutorial
AI Jason
6 Smol AI tutorial in 5 mins | Build ENTIRE codebase with a single prompt
Smol AI tutorial in 5 mins | Build ENTIRE codebase with a single prompt
AI Jason
7 Hugging Face + Langchain in 5 mins | Access 200k+ FREE AI models for your AI apps
Hugging Face + Langchain in 5 mins | Access 200k+ FREE AI models for your AI apps
AI Jason
8 How to let GPT control anything & 10x powerful | 8 mins tutorial about GPT funtion calling
How to let GPT control anything & 10x powerful | 8 mins tutorial about GPT funtion calling
AI Jason
9 Extract data & automate EVERYTHING | 10x GPT function calling power
Extract data & automate EVERYTHING | 10x GPT function calling power
AI Jason
10 Finally, an AI agent that actually works
Finally, an AI agent that actually works
AI Jason
11 "okay, but I want GPT to perform 10x for my specific use case" - Here is how
"okay, but I want GPT to perform 10x for my specific use case" - Here is how
AI Jason
12 "Wait..this AI Agent does research for you 24hrs without hallucination?!" - Here is how
"Wait..this AI Agent does research for you 24hrs without hallucination?!" - Here is how
AI Jason
13 "How to give GPT my business knowledge?" - Knowledge embedding 101
"How to give GPT my business knowledge?" - Knowledge embedding 101
AI Jason
14 “Automation 2.0 coming…No more boring data entry job”
“Automation 2.0 coming…No more boring data entry job”
AI Jason
15 "How to 10x chatbot UX? 🤖 🖼️ " - Add Image Responses to GPT knowledge retrieval apps
"How to 10x chatbot UX? 🤖 🖼️ " - Add Image Responses to GPT knowledge retrieval apps
AI Jason
16 “LLAMA2 supercharged with vision & hearing?!” | Multimodal 101 tutorial
“LLAMA2 supercharged with vision & hearing?!” | Multimodal 101 tutorial
AI Jason
17 "Next Level Prompts?" - 10 mins into advanced prompting
"Next Level Prompts?" - 10 mins into advanced prompting
AI Jason
18 Build AI agent workforce - Multi agent framework with MetaGPT & chatDev
Build AI agent workforce - Multi agent framework with MetaGPT & chatDev
AI Jason
19 How to scale your AI automation pipeline
How to scale your AI automation pipeline
AI Jason
20 AI agent manages community 24/7 - Build Agent workforce ep#1
AI agent manages community 24/7 - Build Agent workforce ep#1
AI Jason
21 Autogen - Microsoft's best AI Agent framework that is controllable?
Autogen - Microsoft's best AI Agent framework that is controllable?
AI Jason
22 StreamingLLM - Extend Llama2 to 4 million token & 22x faster inference?
StreamingLLM - Extend Llama2 to 4 million token & 22x faster inference?
AI Jason
23 AI agent + Vision = Incredible
AI agent + Vision = Incredible
AI Jason
24 After 7 days letting AI agents control my email inbox... 📮
After 7 days letting AI agents control my email inbox... 📮
AI Jason
25 How to use New OpenAI DevDay features - GPT4V x TTS demo tutorial
How to use New OpenAI DevDay features - GPT4V x TTS demo tutorial
AI Jason
26 What is Q* | Reinforcement learning 101 & Hypothesis
What is Q* | Reinforcement learning 101 & Hypothesis
AI Jason
27 "Research agent 3.0 - Build a group of AI researchers" - Here is how
"Research agent 3.0 - Build a group of AI researchers" - Here is how
AI Jason
28 GPT4V + Puppeteer = AI agent browse web like human? 🤖
GPT4V + Puppeteer = AI agent browse web like human? 🤖
AI Jason
29 Real Gemini demo? Rebuild with GPT4V + Whisper + TTS
Real Gemini demo? Rebuild with GPT4V + Whisper + TTS
AI Jason
30 AI Robot's ChatGPT moment at 2024?
AI Robot's ChatGPT moment at 2024?
AI Jason
31 GPT5 unlocks LLM System 2 Thinking?
GPT5 unlocks LLM System 2 Thinking?
AI Jason
32 The REAL cost of LLM (And How to reduce 78%+ of Cost)
The REAL cost of LLM (And How to reduce 78%+ of Cost)
AI Jason
33 OpenAI's Agent 2.0: Excited or Scared?
OpenAI's Agent 2.0: Excited or Scared?
AI Jason
34 Real time AI Conversation Co-pilot on your phone, Crazy or Creepy?
Real time AI Conversation Co-pilot on your phone, Crazy or Creepy?
AI Jason
35 INSANELY Fast AI Cold Call Agent- built w/ Groq
INSANELY Fast AI Cold Call Agent- built w/ Groq
AI Jason
36 AI Employees Outperform Human Employees?! Build a real Sales Agent
AI Employees Outperform Human Employees?! Build a real Sales Agent
AI Jason
37 Future of E-commerce?! Virtual clothing try-on agent
Future of E-commerce?! Virtual clothing try-on agent
AI Jason
38 Unlock AI Agent real power?! Long term memory & Self improving
Unlock AI Agent real power?! Long term memory & Self improving
AI Jason
39 "I want Llama3 to perform 10x with my private knowledge" - Local Agentic RAG w/ llama3
"I want Llama3 to perform 10x with my private knowledge" - Local Agentic RAG w/ llama3
AI Jason
40 “Wait, this Agent can Scrape ANYTHING?!” - Build universal web scraping agent
“Wait, this Agent can Scrape ANYTHING?!” - Build universal web scraping agent
AI Jason
41 "Make Agent 10x cheaper, faster & better?" -  LLM System Evaluation 101
"Make Agent 10x cheaper, faster & better?" - LLM System Evaluation 101
AI Jason
42 Claude 3.5 struggle too?! The $Million dollar challenge
Claude 3.5 struggle too?! The $Million dollar challenge
AI Jason
43 Make your agents 10x more reliable? Flow engineer 101
Make your agents 10x more reliable? Flow engineer 101
AI Jason
44 "I want Llama3.1 to perform 10x with my private knowledge" - Self learning Local Llama3.1 405B
"I want Llama3.1 to perform 10x with my private knowledge" - Self learning Local Llama3.1 405B
AI Jason
45 AI process thousands of videos?! - SAM2 deep dive 101
AI process thousands of videos?! - SAM2 deep dive 101
AI Jason
46 "Wait, I'm using OpenAI Structured Output wrong ?!" - Advanced Structured Output tutorial
"Wait, I'm using OpenAI Structured Output wrong ?!" - Advanced Structured Output tutorial
AI Jason
47 How to use Cursor AI build & deploy production app in 20 mins
How to use Cursor AI build & deploy production app in 20 mins
AI Jason
48 Best Cursor Workflow that no one talks about...
Best Cursor Workflow that no one talks about...
AI Jason
49 This is how I scrape 99% websites via LLM
This is how I scrape 99% websites via LLM
AI Jason
50 Better than Cursor? Future Agentic Coding available today
Better than Cursor? Future Agentic Coding available today
AI Jason
51 EASIEST Way to Train LLM Train w/ unsloth (2x faster with 70% less GPU memory required)
EASIEST Way to Train LLM Train w/ unsloth (2x faster with 70% less GPU memory required)
AI Jason
52 1000x Cursor workflow for building apps
1000x Cursor workflow for building apps
AI Jason
53 Easiest way to build fancy UI with Cursor/Windsurf/Bolt/Lovable
Easiest way to build fancy UI with Cursor/Windsurf/Bolt/Lovable
AI Jason
54 From $0 to $4m with just 2 people (ComfyUI Crash-course for E-commerce)
From $0 to $4m with just 2 people (ComfyUI Crash-course for E-commerce)
AI Jason
55 Deepseek R1 - The Era of Reasoning models
Deepseek R1 - The Era of Reasoning models
AI Jason
56 Yep, o3-mini is WORTH the money - Build your own reasoning agent
Yep, o3-mini is WORTH the money - Build your own reasoning agent
AI Jason
57 The ONLY way to run your own Deepseek on mobile...
The ONLY way to run your own Deepseek on mobile...
AI Jason
58 Those MCP totally 10x my Cursor workflow…
Those MCP totally 10x my Cursor workflow…
AI Jason
59 MCP = Next Big Opportunity? EASIST way to build your own MCP business
MCP = Next Big Opportunity? EASIST way to build your own MCP business
AI Jason
60 Gemini 2.0 blew me away - The future of Multimodal Model
Gemini 2.0 blew me away - The future of Multimodal Model
AI Jason

The .agent folder can significantly improve Claude code by providing a structured approach to AI agent systems and large language models. This video provides a step-by-step guide on how to utilize the .agent folder for better code performance.

Key Takeaways
  1. Set up the .agent folder
  2. Integrate with Playwright and Vercel AI SDK
  3. Optimize code for large language models
  4. Follow the step-by-step guide provided in the video
💡 The .agent folder can improve Claude code by 10x, making it a crucial tool for AI developers working with large language models.

Related Reads

📰
GPT-5.6 USA: Global Privacy & Competition Ripple
Understand the global implications of the US GPT-5.6 rollout on AI regulation and competition
Dev.to AI
📰
Integrating the OpenAI API the Right Way — Streaming, Rate-Limiting, and Prompt
Learn to integrate the OpenAI API effectively with streaming, rate-limiting, and prompt engineering for better performance and results
Dev.to · Ardhansu Das
📰
Building an NLP Pipeline That Actually Understands Offer Text (with spaCy)
Learn to build an NLP pipeline using spaCy that extracts structured data from offer text, improving understanding and analysis
Dev.to · Ardhansu Das
📰
Building an AI Web Crawler That Outputs LLM-Ready Content Chunks
Learn to build an AI web crawler that outputs LLM-ready content chunks, enabling efficient data preparation for large language models
Dev.to · Oaida Adrian

Chapters (5)

/context
1:29 sub agent
2:41 Doc system
6:23 Handle large codebase
8:29 Step by step guide
Up next
5 Levels of AI Agents - From Simple LLM Calls to Multi-Agent Systems
Dave Ebbelaar (LLM Eng)
Watch →