Pi Agent – Crash Course | Minimal Coding Agent

Alejandro AO · Beginner ·📰 AI News & Updates ·2mo ago

Key Takeaways

Provides a crash course on Pi Agent, a lightweight terminal harness for building a powerful coding assistant with customizable models and features

Full Transcript

Good morning everyone. How's it going today? I hope you're having a wonderful day. Uh today we're going to be taking a look at the Pi agent harness, which let me just add the animation right here. It's a beautiful agent harness, very minimalist, that is taking the world by storm recently. I have been trying it for the past few weeks and it works great. So, the idea is that this video is the only video that you need to actually get started with it. We're not going to go over every single feature, just everything that you need to actually start using it. Later, if you're interested, I may do a crash course about more detailed features. So, what we're going to do is first of all, say what is the Pi agent, then how to customize it, then what are Pi extensions, and then what are Pi packages, okay? So, without any further ado, let's get right into it. All right. So, very quickly, let's talk about what is actually Pi. And it's very straightforward. It is a an agent harness that is very minimalist and it grows with you. When you just install it, it comes with only four tools instead of all these bloated agentic harnesses that are out there. And it comes with pretty much no features. You really just build the features that you want. So, for example, let me show you. So, it doesn't come with MCP. It doesn't come with sub agent support. It doesn't come with permission pop-up, so it is able to just do whatever it wants. It doesn't come with plan mode and it doesn't come with built-in to-do's or to-do like this tool that actually tracks the to-do's in real time. Uh what it offers instead is that you can add MCP support if you want. You just have to ask Pi to enable MCP support. It does You can add sub agents if you wanted. Uh there are no permission pop-ups, but you can either run this in containers or build ask Pi to build a permission pop-up system, which is actually what I'm going to show you in just a moment. There is no plan mode, so instead of doing that, it can write the plans to its files, or it can just implement its own plan mode as well. That's also possible. There's no built-in to-dos. Ideally, what they recommend is that you use a to-do.md instead, or you can also build it. But, let me show you how to install this. So, what you're going to do is you're going to copy this thing right here. Going to go right here. You're just going to execute. And there you go. Now, I am not going to reinstall it because I already have it installed. But, once you have installed it, you're going to be able to just do pi and you will see this [snorts] terminal interface. And it's very straightforward. It will already load the skills that you have in your agents file immediately. But, something important is that if you just installed it, you're not going to have any models in it. So, you're not going to be able to use it with any LLMs. So, in order to actually be able to use it, you're going to have to do login. And there are two ways to login. You can login with a subscription or with an API key. In this case, I have logged with an API key from Hugging Face, but you can also login with a subscription, for example, from Anthropic, from ChatGPT, or from GitHub Copilot. I do think that Anthropic has discontinued and disabled third-party harnesses, but you can still use it for ChatGPT and Copilot. In my case, I have already selected Hugging Face, so I'm using all the Hugging Face models from Hugging Face inference providers. So, what I can do now is I can just do {slash} model and I can just select from either my favorite models or from all of the models available in Hugging Face right here. So, I can use Gwen, MiniMax, Deep Seek, Gemini, etc. In this case, I'm stick I'm sticking to MiniMax for the demo, but know that that is also a possibility. Remember that if you want to do that, all you have to do is login with an API key, search for Hugging Face, and enter your API key. Okay? All right. So, now let me show you some of the features. Okay, so the first thing that I want to show you is the way to change models. I already showed you a little bit about this, but you can do {slash} model and you will be able to go through all of the models that you have available for any different subscriptions or API keys that you have added. In this case, I have only Hugging Face, but you can also remember that you can used to log in and add any other provider and you will have all of them available when you do {slash} model, okay? Now, as you can see right here, I have two different uh scopes. So, I have all and here if I hit tab, I go to scoped, which are kind of my favorite models. So, in order to set your favorite models, what you're going to want to do is to {slash} scoped models like this and here you're going to be able to select them. So, say for example that I want to add Minimax 2.1 as well. What I'm going to do is just go through it, hit enter and now it is right there. Then I hit control S and I save it and now if I just get out of here, I can just do control P to switch across my favorite models. So, for example, control P GLM, control P DeepSeek, Minimax, Minimax, Keemia, etc., okay? So, that is what you can do. And also, there is also the possibility of changing the thinking level of your models. So, some models have thinking level levels available, so low, medium, high, etc. And if you want to do that, all you're going to have want to do is shift tab like this. And there you can [snorts] see that it's minimal, low, medium, high. For example, that's for GLM. If I want to switch, for example, let's switch to DeepSeek, I can also switch from minimal, low, medium, high, etc., okay? Same thing if you have your Codec subscription connected to Pi, you will also be able to change your thinking level for GPT 5.5, for example. All right, so something I want to show you right now is prompt templates. Now, these are prompts that you can do kind of like {slash} commands, so custom {slash} commands that whenever you're type them, they're going to be your custom prompt. So, what you can do is actually ask uh Pi to create its own custom prompts and that's a little bit easier, and then you can customize it like that. So, for example, right here I'm going to ask it, "Create a custom prompt for code review. Make it detailed and very thorough." And there we go. And as you can see, it is reading its own documentation in order to be able to update this and to apply the things that I asked. And there you go, it has finished doing the whole thing. Now, it has added my new custom prompt. Now, something to keep in mind is that whenever you update Pi or you ask Pi to update itself, you're going to have to either restart Pi or just ask it to reload like this. And now that it is reloaded, I should have my new prompt right here, which is code review. And as you can see, I can just hit enter, and I'm just going to stop it because in this case, I am not even in a coding workspace, but just to show you that it replaced my {slash} command with all of this very detailed explanation of what I want. So, if you find yourself typing the same prompt over and over, what you can do is just put it into a custom prompt, and it will do just this. And you can, of course, add variables to it, and it just makes working with your coding assistant much more simple. Now, to give you an idea of where this is stored, just to give you some general culture about this, I'm just going to do Ctrl D to get out of Pi, and let me show you where it is located. So, if I go to my home folder, and I go to {dot} Pi, you will see that I have my agent folder right here. So, I go inside agent, and inside it, you can see that I have extensions, prompts, sessions, et cetera. So, this prompt was stored in prompt. So, I go to prompts, and right there, you will see that you can see my code review. So, I can just open it, and as you can see, it is this code review that my agent just created for me. And I can, of course, just add more custom prompts right here manually. If you already have your coding hand harness, or you have added your custom prompts to GitHub Copilot or to other assistants, you can just copy them right here and start using them in Pi. And just for the record, Pi automatically scans all of the configurations that are in your home folder in the .pi directory and you can also have a .pi directory within your workspace to have custom settings for that specific workspace, okay? That's for prompts. Now, let's take a very quick look at skills. Okay, so now let's talk very quickly about skills. If you're not familiar with skills, I do have a very detailed and thorough video to understand what skills are and how to install them. I use skills.sag to install them most of the time. You can watch that video right here. It's a crash course about everything that you need to know about skills. Um but in the case of Pi in particular, it is very straightforward. All you have to do is to open Pi and you will see your skills listed right here. And in order to for Pi to identify your skills or to load them, uh it first of all search in multiple places. It search into .agents directory, so both your home and your workspace uh .agents directory. And if you go inside skills, it will load all of those right there. And it will also automatically load all of the skills in your .cloud directory, okay? So, in my case, my .cloud directory has pretty much the same skills as my .agents directory because I use same links between them. But um just note that that is the case. And also, if you want to to be very specific for Pi, you can also add the skills right here inside your .pi agent and inside the skills directory here. So, I have my skills right here. And as you can see, I also have some sim links right here that go to my .agents directory anyways. So, there you go. That is for skills and how where they uh where they where they are found. Now, in order to actually use them, what you're going to want to do is to slash scale and you will be able to select any scale that you have loaded right here. In my case, I have some a few scales available. Uh video tool for example is a scale that I built that I used to edit my own videos. Scale visualizer, I five coded it yesterday just to help me visualize my scales. Scale creator, I think it's built in and find scale I also think it's built in. I don't remember. I mean built in with the cloud code if I remember correctly. Um but let me just show you this scale visualizer for example. So, there you go. I just called it and it automatically runs my MD file, runs the script in order to generate my visualization and then I'll be able to just open it and see what what scales are available. And this is actually a good uh moment to show you that you can also run bash commands within your terminal inside Pi. So, what you're going to want to do is to {exclamation mark} and then whatever you write right here is going to be interpreted as a bash command. So, you can do open and then I can just open my skills visualizer. And also something that you can do is to double {exclamation mark} and the difference is that if you use one, the bash command is going to go into the history of the conversation, so your agent will know that you ran that command. And if you do double, it is not going to go into the history, so your agent will not know it and of course it will not clutter your context if it is something unrelated. So, what I'm going to do is I'm just going to do open and there you go. Here's my skills visualizer. It's very straightforward. I mean it's just a very quick visualizer that I made to be able to see my scales and the scripts and their references. Um I'll leave a link in the description if you want to use it. It's on GitHub. So, there you go. It is very straightforward as you see. Pretty much the same functionality with skills that you have at cloud code or code eggs or cloud or open code, etc. Okay? Now, let's go into the more fun parts, which is customization of your AI agent. All right. So, next thing that we're going to do is we're going to take a look at the themes because as you can see Pi is [snorts] very minimalist and you can basically edit or modify everything about its terminal user interface. In this case, I'm going to change something very minimal which is the themes. So, what you can do is you go to settings and right here you're going to type themes and you're going to see that you have multiple themes available. In this case, it comes with two themes preloaded. So, dark theme and light theme. And the light theme it the only difference is that it turns this to light for some reason. I don't like it. It's I just use the dark one. But, what we could do is ask Pi to create a new theme for us. And in this case, I'm going to ask you to create a theme in this workspace. So, it's not available for everyone in the home directory. So, let's do that. Create a fun theme for Pi agent right here in this workspace. Make it fun. Make it creative. And make it great looking. So, let's take a look at that. And there you go. It is done. Now, if I go to settings, I'm probably not going to be able to sit to see it. So, I'm going to go to theme. As you can see, it's not there yet. What I'm going to do is I'm going to hit reload because remember that anytime that we change anything in the configuration or we have used Pi to build itself, we're going to have to reload all the settings. Now, you can see I have my new custom theme right here which is gummy. So, I'm going to do settings and on themes, I'm going to go to gummy this time. And there you go. Now, I have gummy available. It is a little bit different and it also has different colors for thinking. And uh there you go. It's just a very quick way. But, of course, you can modify the entire terminal user interface if you want to. That's just a very quick overview of themes. Now, let's go into context files. All right. Now, let's take a very quick look at the context files. Now, this is something that is universal. Uh Pi follows the agents.md standard, which basically is this set of instructions that all your AI agents load automatically in your workspace or in your home directory. And Pi follows this convention as well. And however, it also reads the Claude.md file that you have. So, let's take a look at this. So, let me show you very quickly how this works. If I go to my videos directory, it's just one our repository that I have right here that actually I use agents on. So, right here you see that I have my agents.md and my Claude.md file. What happens is that Pi reads both of these and adds them both to context, okay? So, it is going to see both my agents.md, which is all of these things, and it's going to also see my Claude.md file, which is right here, as you can see. And there you go. This is essentially what's going on right here. And also, something important is that this one right here all both both of these are located in my workspace directory. But, if I go to my home directory, here I also have a .claud directory. And inside this, I also have a Claude.md file. And what happens is that Pi will automatically load all of them just like any other AI agent that you're currently using. So, if you're using Claude or Codex, they you they actually do the same. So, that's why it's probably a good idea to be careful with what you add to your home directory agent files. There you go. That is how to handle context. It's very straightforward, as I told you. Just add here very general instructions about your workspace or about your general way you interact with your coding agent, okay? So, let's go to the next part. All right. So, now let's take a look at extensions. And extensions are very straightforward. As you remember correctly, uh Pi is very very minimalized. As you can see here, we have some themes and prompts and skills, but these are things that I added after I installed Pi. These are [snorts] things that were not there by default. And Pi also does not come with many of the things that some people would consider basic or that some agents come with at front uh right out of the box, such as it doesn't come with MCP, it doesn't come with sub agents, it doesn't come with permission pop-ups or with plan mode or or to-dos, etc., okay? Uh of course, there are ways to update that and to change that, and the way to do it is with extensions. So, I told you that Pi is very simple and very straightforward, and it is also very modular, which means that you can either write your own extensions by hand or you can have Pi write its own extensions and update the way that it interacts with your computer. So, for example, let's go right here and go to documentation, and inside the documentation we can take a look at the extension section, and you can see that extensions allow you to extend the functionality of your Pi agent. And here are some examples, but let me actually show you how to do this. So, right here, what I'm going to do is I'm just going to prompt it to create an extension for the current workspace. So, this is not going to be available for all of my Pi sessions, only for this specific workspace, that prints a welcome message whenever a new session starts. Write a set of messages that are quotes from famous scientists and writers, and each time display one randomly. So, I'm going to just run this, and let's have it write the whole thing. And there you go, it finished creating it. And what you can do is just restart Pi. Let's just get out of it, and let's reopen it. And as you will see, here we have our nice little quote right here. It says, "Logic will take you from A to B, imagination will take you everywhere." says Albert Einstein. And that is just some nice little functionality that we have added right here. And you can of course add many other things. So, for example, you can add things to your footer, for example, things to your editor right here, whatever you want, okay? Now, let me give you another very quick example. Here I have another prompt that I have that I think that is a good extension that you can add if you're going to be using this as a coding agent, not like an autonomous agent in a sandbox or anything. So, I can ask it to create a pie extension at the current workspace that asks for confirmation before running any bash command containing rm -rf or git push force, because I'm going to be using this for coding, so I would not really want my agent to remove or push force things without my permission. So, let's take a look at how it does it. And there you go, it has completed writing the whole thing. Now, let's see if it actually does it. So, what I'm going to do is I'm just going to get out of here. I don't remember what I have available right here. I'm just going to create a new directory right here, call it hello, and inside of it, let's just create another um hello file right here. So, hello.md. And there we go. And here, right now, if I ask pie to remove it, I'm going to be able to test that new extension that I created. And as you can see right here, we have the dangerous command guard extension and the welcome quote extension that we created before. So, remove the hello directory from here. And there you go, it's saying that there is a dangerous command detected, rm with force recursive flags. Execute anyway, yes or no? So, then here I can say yes, and now it will delete it. There you go, so hello directory has been removed. And uh just to show you that this actually works and how and where this is located, let me just show you that right here in my Pi test directory, which is just somewhere that I had been doing some uh experiments. If I go into my Pi directory and I go inside extensions, you will see that I have my two extensions right here. And as you can see, they are basically just TypeScript files that are very, very straightforward, okay? So, there you go. And just to give you the demonstration that this actually did not work before we created the extension, I'm just going to remove the extension. I'm just going to remove the dangerous command. And let's go right here. Let's go back here. And let's just create again hello directory. And let's just create inside of it. What we're going to do is we're going to open Pi. And we're going to ask it to remove remove the hello there from here. From And as you can see, it run r m r f hello and it removed everything without asking me for permission. So, my extension actually worked. And there you go. That is how extensions work, how to use them, and how to create them. And if you take a look at the documentation, there are a bunch of examples of useful extensions that you may want to create. All right. Now, let's take a very quick view at packages. Now, packages are very straightforward. These are essentially just um bundles of extensions, skills, prompts, etc. that come all together in a single package so that they all work together and you can build them together. Uh they're very straightforward and you actually have them already available right here in the packages section. All of them that is have been built by contributors in the community. So, here are some of the common functionalities that you already know from other coding agents that you can add with a single command to your Pi agents. So, for example, there is Pi subagents, there is context mode, MCP adapter to be able to use MCP, web search because of course Pi agent does not come with web search by default, Pi web access, et cetera. So, a bunch of different things that you can use. Feel free to explore this and of course all of this are open source for you to be able to actually see what you are installing. And naturally, be careful to not install any package that you do not trust or that you have not thoroughly reviewed, at least had Pi review it to make sure that it is safe because these packages sometimes contain scripts and your agent will sometimes execute those scripts. So, you don't want to be executing malicious scripts in your computer naturally. So, there you go. Just take a look at this and of course be feel free to create your own if you want to. Okay, so now it's time for my favorite feature of Pi probably. Other than the fact that it is customizable, which is amazing, I think [snorts] my favorite feature is sessions. Now, of course Pi is great because it's customizable and it is minimalist and you can just build your own agent harness with it. But to me the best part about this is the sessions part. So, it makes it extremely easy for you to retrieve, edit, and navigate through your threads, okay? So, for example, let's suppose that you are right here in my just this test that I gave to you. I can just do /name and I can rename this specific thread. So, I will call it testing for example. And now as you can see right here, it is named testing and if I do /session, I will see that this session is called testing. And also, very importantly, it tells me where it is located. And now, this is extremely important because if we go right here to my .py agent, and if I go inside my agent, I can see that I have my sessions right here. And if I go inside sessions, you will see that I have all of my sessions that I have started with my Pi agent organized by directory where I started. So, for example, this one right here, let's say that I want to go into temp. So, I'm going to go into temp right here. Let's go right here. >> [snorts] >> And here I have all my conversations that had in that directory in JSONL format. Now, there is that, but also let's suppose that you are using your agent and at some point you start you send it some message and you just messed things up and you didn't want to send that message, but you want to continue from a previous message. It's very straightforward. All you do is tree. And this will give you a list of all of your messages. And you can just continue from where you started. So, for example, let's see, let's go back to my assistant message. I do not want to summarize the other things. And here we are back there. I want to go forward again. I'll just go forward like that again. And there you go. That's very straightforward. All that we're doing is just navigating our tree. There are also two other commands that are pretty useful. So, fork, for example, will take the session, duplicate it, and you will continue working on that one. Or you can also clone a session which will duplicate the current session at the current position. From here, something else that you can do is ask your agent to compact your conversation in case you're close to reaching your limit in your context window, and it will manually compact that session. And something nice is that you can add custom instructions right here, like for example, something like pay attention to the API or something like that. Okay? And probably my favorite thing right here is that you can export your session just like that. So, I'm just going to click export and you can see my session was exported to this file right here. Now, let me actually open it for you. I'm just going to do open and here it is. So, as you can see, it is a pretty nice user interface where I can visualize all of my messages and right here I can also navigate the whole thing in this nice little sidebar and I can filter with tools, with user, labeled, or all. And since I I mean, yeah, there's also the possibility of labeling your messages, but uh I'll show that later or you can probably read the documentation for that to make to not make this video super long. And of course, very nicely, if you want to use this thread to maybe train a large language model or create a for example create a scale, you can just download the JSONL and now you can use that to create your scale. So, there you go. And there you go. Thank you very much for watching. It has It has been a pleasure. Uh I'll probably make a more detailed video on Pie or some other tutorials about Pie and how to use it, but uh I suppose that with this you have more than enough to get you started and to customize your Pie agent for whatever you want to do. I can probably make videos about how to run Pie with local models or how to run or create other more specific extensions, but uh please let me know what you would like to see. Thank you very much for watching. It has been a great pleasure and I will see you in the next one.

Original Description

Pi Agent is a lightweight terminal harness that gives you a powerful coding assistant without the bloat. Unlike traditional agents with built-in sub-agents, plan modes, and permission popups, Pi starts with just four tools: read, write, edit, and bash. You build the features you need. In this tutorial, you'll learn how to customize Pi with your favorite models (HuggingFace, OpenAI, Anthropic subscriptions, GitHub Copilot), create custom prompt templates, load skills, design themes, and build extensions directly by asking Pi to write them. See how to add permission guards for dangerous commands, create welcome messages, and navigate sessions with tree-based history. By the end, you'll have Pi running on your machine, editing real code, and understanding why "minimalist" doesn't mean "limited." --- 🤓 Topics Covered - Pi Agent installation and core philosophy - Model switching and provider configuration - Custom prompts, skills, and themes - Building extensions with TypeScript - Session management and export --- ⏱️ Timestamps 0:00 - Introduction 0:51 - What is Pi Agent 3:46 - Switching Models 5:28 - Custom Prompts 8:05 - Skills 11:26 - Themes 13:17 - Context Files 15:13 - Extensions 20:32 - Packages 22:02 - Sessions 25:54 - Conclusion --- Connect with me X: https://x.com/_alejandroao LinkedIn: https://www.linkedin.com/in/alejandro-ao/
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Related Reads

📰
What Flamelit's Q3 Contracts Mean for Practical AI Growth
Learn how Flamelit's Q3 contracts impact practical AI growth and what it means for the industry's future
Dev.to · Greg Godbout
📰
Why Mission Expertise Beats Pure Technical Skill
Mission expertise is more important than pure technical skill for the success of AI initiatives, as it ensures alignment with business goals and domain knowledge
Dev.to · Greg Godbout
📰
How Generative AI Is Transforming Modern Businesses (And Why It’s More Than Just ChatGPT)
Learn how generative AI is transforming modern businesses beyond ChatGPT, improving productivity and innovation
Medium · ChatGPT
📰
Apple opens its new Siri AI to everyone with the iOS 27 public beta
Apple releases iOS 27 public beta with revamped Siri AI for everyone to try
TechCrunch AI

Chapters (11)

Introduction
0:51 What is Pi Agent
3:46 Switching Models
5:28 Custom Prompts
8:05 Skills
11:26 Themes
13:17 Context Files
15:13 Extensions
20:32 Packages
22:02 Sessions
25:54 Conclusion
Up next
PLATO Exoplanet Hunter Launch 2026 Searching for New Earths in a Warming World
Tech Folk Insights
Watch →