David Ondrej jcUqsNpDDDk read

If you don’t run Pi locally you’re falling behind…

Transcript: Done Yayin: 2026-06-12 11:58 YouTube
If you don’t run Pi locally you’re falling behind…
Kanala don
Job gecmisi
Job Durum Deneme Worker Istek Baslama Bitis
SummarizeYouTubeTranscript #263 Done 1 learning-prod-worker-1 2026-06-22 01:37:52 2026-06-22 01:38:52 2026-06-22 01:39:02
FetchYouTubeTranscript #253 Done 1 learning-prod-worker-1 2026-06-22 00:27:23 2026-06-22 00:28:47 2026-06-22 00:28:56

Ozet

openai/gpt-4.1-mini-2025-04-14 - 2026-06-22 01:39
Indir

Ozet

David Andre, PI Agent (pi.dev) üzerine kapsamlı bir kurs sunuyor. PI, minimal ve özelleştirilebilir yapısıyla diğer AI ajanlarından ayrılıyor. Kurulumu kolay, sadece dört temel araç (read, write, edit, bash) ile geliyor ve kullanıcıya tam kontrol sağlıyor. PI, 15+ sağlayıcı ve binlerce model desteği sunarak esnekliği artırıyor. Kullanıcılar, sistem ve proje bazlı markdown dosyalarıyla bağlamı yönetebiliyor, ayrıca prompt şablonları, beceriler (skills) ve uzantılar (extensions) ile ajanı sürekli geliştirebiliyorlar.

David, PI’yi terminalde veya gelişmiş CMAX terminalinde kullanmanın avantajlarını gösteriyor. CMAX, birden fazla ajanı paralel çalıştırmaya ve yönetmeye olanak tanıyor. PI, diğer ajanları (örneğin Codex CLI) yöneterek karmaşık görevleri otomatikleştirebiliyor. Ayrıca, PI’nin oturum yönetimi lineer değil, dallanarak ilerliyor; bu da farklı senaryoları paralel takip etmeyi sağlıyor. Güvenlik açısından PI “YOLO modu”nda çalışıyor, bu yüzden güçlü modeller tercih edilmeli veya izin sistemi paketi kurulmalı. Tüm bu özellikler, PI’yi güçlü, esnek ve ileri düzey kullanıcılar için ideal kılıyor.

Ana Fikirler

  • PI Agent minimal, özelleştirilebilir ve hızlı büyüyen bir AI ajanı.
  • Sadece dört temel araç (read, write, edit, bash) ile geniş işlevsellik sağlanıyor.
  • Bağlam yönetimi markdown dosyaları (system.md, append system.md, agents.md) ile yapılıyor.
  • Prompt şablonları, beceriler ve uzantılarla ajan sürekli geliştirilebilir.
  • PI, 15+ sağlayıcı ve binlerce model desteği sunuyor.
  • CMAX terminali ile çoklu ajan paralel yönetimi mümkün.
  • PI, diğer ajanları (örneğin Codex CLI) yöneterek karmaşık iş akışlarını otomatikleştiriyor.
  • Oturumlar dallanarak ilerliyor, böylece farklı senaryolar paralel takip edilebiliyor.
  • PI “YOLO modu”nda çalışıyor, güvenlik için güçlü modeller veya izin sistemi paketi öneriliyor.
  • MCP sunucuları doğrudan değil, CLI araçları olarak kullanılıyor.

Uygulanabilir Notlar

  • PI Agent kurulumu için pi.dev adresinden terminale tek satırlık komut yapıştırılabilir.
  • Kendi iş akışınıza göre append system.md ve agents.md dosyalarını düzenleyin.
  • Sık kullanılan komutları prompt şablonlarına dönüştürerek zaman kazanın.
  • Yeni beceriler ve uzantılar kurarak ajanınızı geliştirin.
  • Web erişimi için pi web access paketini kurun.
  • CMAX terminalini kullanarak birden fazla PI ve Codex ajanını paralel yönetin.
  • Oturum yönetimini öğrenerek dallanmış sohbet geçmişlerini etkin kullanın.
  • Güvenlik için PI permission system paketini kurmayı değerlendirin.
  • MCP sunucularını CLI araçları olarak sarmalayarak PI ile entegre edin.
  • Yeni Society Classroom’dan örnek konfigürasyonlar, beceriler ve uzantılar alınabilir.

Anahtar Kavramlar

  • PI Agent (pi.dev)
  • Minimal AI ajanı
  • Markdown bağlam dosyaları (system.md, append system.md, agents.md)
  • Prompt şablonları (prompt templates)
  • Beceriler (skills)
  • Uzantılar (extensions)
  • CMAX terminali
  • Oturum yönetimi (sessions, dallanma, fork)
  • YOLO modu (izin istemeyen çalışma modu)
  • PI permission system paketi
  • MCP (Model Control Protocol) ve CLI araçları

Transcript

Video metni
en markdown 2026-06-22 00:28 youtube-transcript-api:generated
Indir
My name is David Andre and this is a
complete course on PI agent. First, what
even is PI? PI Agent, also known as
PI.dev, is a very simple and
customizable AI agent and it's the AI
agent I've been using every single day,
even more than cloth code and CEX. Also,
it's one of the fastest growing
repositories in all of GitHub, meaning
soon enough, I think Pi will become the
most popular AI agent in the world.
Right now, we're witnessing the Pi
revolution. A lot of the top people in
AI and business have recently switched
to PI, and I'm one of them. I've been
using Pi every single day. I've talked
to the founder, Mario Zakner, and I've
taught over 250,000 people how to use Pi
Agent, and I've compiled everything I
know about Pi into a clear step-by-step
course, which is what you're going to
get in this video. So, first, let me
show you how to install and set up Pi by
going to pi.dev, which is the official
site for PI agent. And here all you have
to do is scroll down a little bit to see
the oneliner installer command. I'm
going to go with a curl command and
simply click on copy. After you copy the
command, open any terminal on your
computer and simply paste it inside.
This is going to install pi globally on
your computer. If this is your first
time setting up pi, it will take like 20
seconds to install it. Now, if you want
to use pi effectively, you need to
understand the difference between a
product and a harness. Cloth code and
codecs are more of a mass market
products. They're highly opinionated,
bloated, they're slow, they have tons of
features, tons of safeguards, guard
rails because they're made for tens of
millions of people, the mass market VIP
coder audience. Why, on the other hand,
is a harness. It comes with just four
tools. It's the most minimal agent out
there. It has a very tiny system prompt,
and the rest is up to you. And I think
the homepage of pi.dev says it the best.
You should adapt pi to your workflows,
not the other way around. Now, why Pi?
This is not the only agent out there.
Why should we be using Pi over other
agents? Well, first of all, it's the
most minimal agent out there, making it
easy to customize and change. Also, the
system prompt is just 1,000 tokens,
which is 10 to 15 times less than other
agents. And by the way, those are tokens
that you have to pay for every single
time you use it. And unlike Codex or
Cloth Code, Pi supports over 15
different providers with thousands of
different AI models. So back to the
terminal here to launch Pi all you have
to do is type in two letters PI and hit
enter and this will launch it. As you
can see I'm already authenticated. If
you are not type in /lo and this will
open the menu for selecting your
provider. Right? So you can use either a
subscription such as the CHBD correct
subscription or an API key. I'm going to
go with that and I'm going to select
open router. There it is. Hit enter. And
next we need an API key. So let's switch
back to the browser. Go to open
router.ai here. Go to the top right and
make sure you're logged in. Then go to
the credit section and make sure to
charge up some credits. You don't need
to do $90. Just do $5 or $10. That'll be
more than enough. Then go to the left
and click on API keys. And inside of top
right, you'll see this blue button, new
key. Click on that. And this lets you
create a new open router API key. I'm
going to name it subscribe. If you're
watching this and if you want me to make
more videos on PI agent, make sure to
subscribe. We are so close to 400,000
subscribers. So please go below the
video and click the subscribe button.
It's completely free and it's the
easiest way to show appreciation for
this type of content. Okay, so next I'm
going to set a limit. I'm just going to
do $30, something reasonable. And I'm
going to click on create. Then I'm going
to copy that. Keep your API keys
private. Do not share them with anybody.
I'm going to go to terminal and paste it
in here. Hit enter. And as it says,
saved API key for open router. So now we
should have everything ready to send the
first bronze. So say hi. And let's see
if we can get a response. There it is.
Hi David, what do you need? Amazing. So
this is PI agent running locally on my
MacBook powered by Opus for if you want
to change the model obviously you can do
/model to select any other model
available on open router uh which
basically they have all the models right
so that's why you use it if you want to
change the thinking effort as you can
see I'm on extra high do shift tap this
is one of the first keyboard shortcuts
you need to learn shift tab says
thinking off then if I do shift tab it's
minimal low medium high and extra high
usually I have it on extra And I do
prefer to use fast even though it's
double the cost of Opus 4.8. Opus 4.8
fast inside of Pi Agent is just
incredible. You'll see what I mean later
in the video. I've been building
software for years and the back end is
still the thing that slows everybody
down. You can cook up a nice front end
in an afternoon, but the moment your app
needs real data, user accounts,
embeddings, file storage, you find
yourself stitching up together five
services that barely work together. This
is why Superbase exists. Superbase gives
you a single Postgress instance with
authentication, storage, PG vector all
built in and it is production grade so
it doesn't fall over once you put some
real load on it. Now the real reason why
buildings with superbase is so easy is
their agent skills. You just give the
skill to your agent and tell it to
install Superbase and just like that
cloth code or cursor can understand your
schema, your RLS policies, your
migrations, everything about your
database. So when the agent writes SQL,
it lands it on the first try, not on the
fifth one. And unlike other databases,
Superbase is fully open source. In fact,
Superbase is betting on a world where
agents write all of your code and
they're laying the foundations for it.
So if you're building anything with AI,
you really should be using Superbase.
Plus, you can get started completely for
free. It's going to be the first link
below the video. Thank you to Superbase
for sponsoring this video. Now before we
begin configuring our PI agent, you need
to understand how the context
engineering works inside of PI. So just
like most agents, PI gets context from
simple markdown files. And there are
three main markdown files that PI looks
at and these are the free ones. First is
system.md. This will override the full
system prompt. Be careful with this one.
I would probably not touch it. If you
want to change its default behavior,
append system is better. This is
appended at the end of the system prompt
every single time you use PI. It's
basically just like updating the system
prompt without messing up any of the
default things that Mario added. The
third option is creating agents.mmd file
either globally or inside of any folder
you're working on with context specific
to that project that folder. This is
always added in that session. So mostly
you're going to be changing number two
and number three when you want to change
how PI agent behaves on the context
side. And one more thing that's very
nice about PI is that it even reads your
existing cloth.m MD files. So if you
have a clot code setup with a project
full of cloud MD files, PI will work
there just fine right away. So as I
mentioned, Pi comes with just four
built-in tools. Read, write, edit, and
bash. Very simple. Read allows you to
read any file. Write allows you to
create files. Edit allows you to edit or
change files. And bash is the most
powerful tool which allows PI agent to
control the terminal. Everything else
like web search, you need to add it
yourself through extensions. Don't
worry, I'm going to show you all of that
step by step in a second. But first, you
really need to internalize that these
four tools is all you need. You don't
need dozens of MCPS, hundreds of
pre-built skills, endless amounts of
plugins. You don't need that. And PI
agent is the clear proof. And again,
this approach is very powerful. For
example, just with bash tool, Pi can
basically do anything on your computer
since it can use the terminal and it can
open files, manage files, install
packages, create folders, open
applications, close applications,
analyze your network, improve Wi-Fi
speed, anything else that a professional
developer could do if you had full
access to your computer, PI agent can
do. So, let me show you how to update
the context inside of Pi by having it
update itself, right? So, I can say find
the global.py pi folder on my MacBook
and it can find that and inside say like
inside find the append system file.
There it is. It found this append system
and say okay add in a new sentence
saying that you should always respond in
English unless I talk to you in a
different language then respond in that
language. Any change you want to make
just tell it to make it and it will make
it right. As you can see I have some
other stuff here. Always make your
responses clear and concise. dates. I
prefer this format. If you're American,
you are incorrect. Day, month, year is
the only correct format. Anyways, I have
some other stuff. You know that I'm in
Poland. Katita, no emojis. Short direct
English. This is the new sentence that
was just added. This is also a good one.
David can't see tool/bash output. Always
relay results in text. If you use cloth
code, you know how annoying it is when
it just says here's the results and it
doesn't show you the results. So, that's
why I added this. And yeah, anything
that PI agents should know in any
session, just add it into
appendystem.mmd.
Then if you're working on specific
projects, just just say something like
create agents.md for that project. And
we'll create an agents.mmd file specific
to that project, which is always going
to get loaded if you're using pi in that
project. And again, more on that later
in the video. I'll show you some demos
and I'll show you my existing workflow,
which is way more advanced than using
this terminal. In fact, let me give you
a sneak peek because I'm using PI Agent
inside of CMAX and I'm using it to do a
lot of things at the same time. And I
know this might seem overwhelming to
some of you, especially if you don't
have T-Max or CMAX installed. But trust
me, this setup is very OP. You can
easily launch new PI agents. You can
have them control it. List out other PES
inside of this CMAX workspace. And this
really is how I use AI. Like 90% of my
AI interactions happens right here
inside of CMAX with PI agent. So later
in the video, I'll show you my agentic
engineering setup. But for now, I'm
going to be using a simple terminal,
which any of you have access to, and you
can just do the steps I'm doing. Oh, and
by the way, all of the prompts, skills,
templates, extensions, everything I
mentioned in this video are going to be
available in the first link below video.
So, click on that. It's completely free.
Just fill out your email and I'm going
to email you the full bundle of my Pi
agent setup. Another thing you need to
configure right away with Pi is web
access. So since Pi is very minimal, it
doesn't come with a web search tool. But
setting this up is very very easy. So on
the homepage again, this is pi.dev. Go
to packages in the top and here just
scroll down and type in pi web access.
Hit enter. And there it is. This is the
main package for PI web access. You can
see that it gets over 90,000 downloads
per month. And all we need to do is just
copy this button and open the terminal
and just run it. Or you can even tell PI
to run it. check if I have boom now I
know I already have it so it will say
yes if you don't have it will say no and
say like okay install it globally and it
will just install that right what a lot
of you don't realize is that you can use
these agents to improve the agents right
you don't need to do everything yourself
in the terminal you don't need to try to
understand every command once you have
the agent installed use the agent to
make it self-improve itself tell it
install this package rewrite this prompt
set up a new skill and it can do it. So,
a lot of you are limiting the AI by your
own limited prompts, by your own
low-level prompts because you're not
giving it ambitious enough of tasks.
This is not 2024 anymore. The AI agents
are super powerful. You, the human, are
the limiting block. So, pay attention
because I'm going to be showing you how
to set up Pi in a way where it can 5x
10x your productivity easily. And I know
that because it happened to me. So now
that we have the web access configured,
we can say browse the web and tell me
about the new Elon Musk interview with
Jamie Diamond. As you can see, it will
use the web search which is by the way
free. It uses Exa and it just searches
it for free and it's very fast as well.
Look how fast that was, right? So you
you don't need to switch to Chad GPT to
cla to Perplexity to do a web search.
You could just do all of that from the
comfort of your PI agent. And here it
is. It was on the 4th of June. Jimmy
Davin interviewed SpaceX part of the IPO
road show blah blah blah. Here's some
more info about this topic. Clear
formatting. Very nice. And just like
that, Pi can now do web search. So if I
do Ctrl + C to kill this session and if
I launch Pi again, you can see that it
comes with the Pi extension. And this is
how you make it yours. You don't rely on
Enthropic or OpenAI to give you hundreds
of pre-made extensions, prompts,
guidelines to keep you limited. You get
P by Agent fresh, completely empty, and
you configure it yourself. It might seem
scary at the beginning, but as soon as
you know how to create skills, prompt
templates, install extensions, and
again, I'm going to go into how to set
these up in depth later in the video.
But as soon as you do the first one,
such as the Pi web access, you can
realize how easy it is to improve your
PI agent and keep configuring it and
customizing it for your own needs, for
your own use cases. So let's talk about
how to make your PI agent 10 times
better. Since PI is very minimal out of
the box, you need to learn how to extend
it, how to improve it. And this really
is the secret to getting the most out of
PI agent. Knowing how to keep improving
it day by day. And there are four main
ways to improve your PI agent. Each one
is more powerful than the last. So this
I would say is the must learn thing. If
there's one thing from this video you're
going to learn about Pi, it is knowing
these four methods because this is what
really is going to separate people who
just install it and stop using it after
two days. And people who get Pi and
their Pi grows with them and becomes
more and more powerful with each passing
day. So pay close attention because
these four methods you have to know them
by heart. The first two are the simplest
ones. First is agents.md classic, right?
This is the always on context just
adding anything that you want pi to
remember every single message put it
into agents.mmd file. The second thing
is a bit more advanced and that is
prompt templates. So this is not just
simple prompts. This is more like slash
commands. So if you know inside of cloud
code you can have these pre-built
commands that you can trigger with slash
you know review slash push to get
whatever you want to do. Same thing
works inside of pi. any prompt that you
find yourself repeating often, turn it
into a prom template and it's
triggerable with a slash command. The
third way to improve your pi is skills.
So just like typical agent skills, these
get autoloaded when they're relevant. So
if you have a skill about YouTube,
anytime you begin talking about making
the next YouTube video, Pi will load
that skill. It will read the full
contents of that skill and it will be in
the context window. So this is similar
to cloud skills, it works exactly the
same. Now, the fourth way to improve
your PI agent, which is the most
powerful, is extensions. And these are
real TypeScript code. So, they can do
the most, but they're also the heaviest,
the hardest to develop, right? So,
changing your agents.mmd file, you can
just say make your answers more concise,
and you change it like that. Creating a
prompt template also takes 30 seconds.
Creating a new skill, that can be a bit
longer, maybe one or two minutes.
Creating a new extension, that's the
hardest, right? So, usually use
extensions from other people. I'm going
to show you the best ones in a bit, but
these are real TypeScript code. They can
do a lot. They work as hooks. And these
are basically when markdown changes
aren't enough. And a great example is
the PI web access extension we added
earlier. Okay, so now let me show you
how to create a new Chrome template. I
already showed you earlier how to update
the append.md file. So here you have pi.
If you don't have it started, again,
super easy to start. Just type in pi,
two letters, and then you can ask it
find the global.py PI folder in my
MacBook and the slashprompts folder
inside. So, as you can see, these are
the prompt templates I have right now,
but it's super super easy to create more
prompt templates. So, I'm going to say,
okay, now create a new prompt template
that's going to be slash review and it's
going to be about doing a deep review of
the entire codebase.
Something like that. You just explain
what is the thing that you want the
prompt template to insert and what is
the shortcut. Right? So now the shortcut
is slashreview. And by the way when you
make any changes to your pi config if
you want it to take effect immediately
you need to do slash reload because
right now let's let's try this right. If
I wanted to type in /re right now it
will not work. Slash review it doesn't
work. It's not there. So we need to do
slashreload. This will reload the entire
Pi keybinds, extensions, skills,
prompts, themes. Just it will reload
your entire PI agent. And boom, just
like that. If we do SL review, it works
now. And as you can see, we have the SL
review skill and we enter it. The whole
prompt gets loaded. This is how easy it
is to create these prompt templates. And
again, I didn't do anything. I just told
PI agent to create the new prompt
template for me. And after doing
/reload, it works. So, anytime you find
yourself repeating the same prompt more
than once a day, create a prompt
template for it. It's going to save you
so much time. Now, since I don't need
this one, I'm going to say find the
slash review prompt template and delete
it. And by the way, all of my prompt
templates, skills, extensions, my entire
PI config is available in the new
society. So, when you go to the
classroom here, you can see PI agent on
the right. Click on that and you can see
my prompt templates, skills, agents, MD,
append system MD, and extensions. So you
can just take any of these here from the
resources and add it to your Pi setup
instantly. The link to new society will
be below the video. Now my favorite
prompt template by far is this one
short.md. So anytime I do like, you
know, let's say explain to me how
transformer architecture works for LLMs,
it's going to give a long answer, right?
And even though I have it inside of my
append.md, which you saw earlier, it
always gives a long answer, right? This
is just the nature of the new tokenizer
from Enthropic. So I have this prompt
template /short that I can just invoke
and it says make your answer simpler and
shorter. In the past I used to type this
20 30 40 times per day which adds up
right wastes valuable minutes of your
time and you need to be as optimized as
possible in the age of AI. Every single
minute is valuable. AI is advancing so
fast that you cannot be typing the same
prompts over and over. That's why prompt
templates exist. So now I just have to
do /short tab enter and it makes it
simpler and shorter exactly like I
wanted. So this one is by far my
favorite prompt template. The next thing
I want to show you is my skills. So I'm
going to do / new to create a new
instance of pi. And actually when you do
a slash new it doesn't show the skills.
So I'm going to do ctrl c. This is a
very important command you have to learn
for the terminal. Ctrl c not command
ctrl c. It kills the existing process.
Okay. So no matter whether you're
developer, whether you're non
techchnical, you have to know Ctrl C.
It's one of the most essential commands
for the terminal. So I'm going to start
pi from scratch. And the reason is
because I want to see the set of skills,
right? And you can see that I have a lot
of skills over 50. I mean, you know,
some people have way more, but these are
the ones I actually use. I don't have
random skills that I don't use. I would
say probably 85% of these are from me.
The remaining 15 are from other popular
repositories. But let me actually walk
you through some of them because this
really is the bread and butter of pie.
These skills is what saves me so much
time every single day. I honestly
couldn't live without them. So I'm going
to say find the global.agent/skills
um folder and open it in finder for me.
And again you can tell pi to open apps
for you. So instead of me searching
around on my, you know, desktop taking
minutes to find a folder, which this is
crazy, you know, as I'm interviewing
developers, and by the way, we're
hiring. So if you want to work with us
in Katavit and Poland, there's going to
be a link below the video, see what
roles we have open, and if you qualify
for any of them, make sure to apply. But
just seeing people still do stuff
manually where they click around looking
for folders, it's so amateur. Like you
can literally use an AI agent like pi to
tell it open this specific file inside
of finder for me and it will do that
right away. So that's what I did here
with the agent file and that's what I
did here again with the skills file. So
here here you can see I have a lot of
skills and most of them have been
created in the last 30 days actually. So
there are some that are older but uh
yeah these skills is constantly what I
create, constantly what I upgrade and
again all of them are going to be
available inside of the new society
classroom right here in the PI agent
module. So from these skills here are
the ones that you should definitely have
research prompt. Okay, this one's really
good. So I'm going to jump into PI agent
say read the research prompt skill and
explain it. And since I know it's
already going to be very long, I'm going
to do slshort and I'm going to do option
enter to pre-fire it, right? So you can
presend the next message and it, you
know, I predicted that it's going to be
too long of an explanation. Actually,
this one is pretty fine, but still the
shorter one is better here. And
basically, this makes py optimized for
deep research program writing. So
anytime there's something deeper that
like you want to use maybe a chat GBD
5.5 pro extended or perplexity deep
research or perplexity computer
something just you know a deep research
tool that runs for 10 15 minutes this
will write the prompt for that. So maybe
I can say what are the best meals to eat
before working out for the best workout
effectiveness. And then I'm going to say
follow the skill to write a research
prompt for this. And it's going to read
the skill. Well, it already did read it
earlier here. See, this is what it looks
like when pi reads a skill. You see this
purple skill and that's how you know it
read the skill. So now it gave me this
research prompt and I can just copy that
into you know proper computer or chbd
5.5 pro extended and it's highly
optimized prompt. I don't have to
explain it every time. Right? So this is
a beautiful example of a skill and again
that's just one of the 50 plus different
skills I have for pi and again all of
that is available in the classroom of
the new society. Okay so earlier you saw
me send a prompt before the next one was
finished. So this is called steering pi
midrun and there are two ways to do
this. You can press enter to steer PI
agent right away after the tool call
finishes. This is if something is going
wrong. So if you see it going down the
wrong path, you just say no, that's not
the folder I'm talking about and you
send enter and that's going to steer it
right away. But if you want to cue a
message to send after Pi finishes
completely, then you do alt enter on
Mac, it's option enter, and this will
send a follow-up message after PI agent
finishes responding. So this is great if
you already know what's going to happen.
You just do option enter and you type
the next prompt. You do option enter
again and you can send like two to three
messages ahead of time and when Pi
finishes the current task or the current
response, it will automatically send the
next message. Very clean. I use it all
the time. Also, the slash compact
feature inside of Pi is very good. Let
me just show you because this is way
better than the cloth code one. So here
we've been talking for a while, right?
You can do like slash compact. Boom. And
it will compact the context. And look
how fast it is. It will be like two to
three seconds. There it is. literally
two maybe three seconds inside of cloth
code. This takes a minute. It's so
slow. I never use it inside of cloth
code. I hate it inside of cloth code. In
fact, most agents have very very slow
compaction. But that's not the case in
pi. This slash compact is beautiful.
It's elegant. It's fast and I use it all
the time. So at the bottom you can see
the percentage of your contacts window.
So maybe I can send a message because
after slash compact you just need to
send. So we're at 2.5%. you know when
you start reaching like 30 40 50% you
definitely want to slash compact plus
you can keep an eye on your costs. I'm
using a very expensive model obviously
at extra high reasoning effort. So the
costs are going to be quite substantial,
but no matter what you're using, each
model is performing worse when it's like
90% of context compared to at like 5% or
15%. Right? So at the bottom, this is
always available. Very useful bottom
bar. Actually, let me quickly walk you
through the bottom bar because it's very
useful, right? So on the left you have
information about the tokens. Then you
have your current spend for this
session. Then you have the percentage of
the context window. Then it's auto, this
is auto compaction. Then you have the
model uh creator name. So that's
enthropic. This is not the provider
because I'm using open router. So model
creator name. Then the model name. You
can see that I'm using the fast version.
And then the reasoning effort which
again you can change that with shift tab
easily cycle between them. So this is
very useful status line. And obviously
inside of pi you can change anything. So
if you wanted to remove some of this
maybe you don't want the context info or
whatever you can just tell pi to update
its theme and it can easily do that. So
there's many different themes on pi. So
you can ask it check global.py folder
for any custom themes. There it is.py/
aent/ themes. So if you don't like this
theme and you want it to be different,
you want it to look maybe closer like
cloth code, you can actually do that
with one or two prompts telling PI agent
to update itself. And again, I want you
guys to realize we are so far in AI that
you can literally tell these agents to
self-improve themselves. Stop trying to
figure out everything yourself. Stop
trying to be the bottleneck. Tell the
agent change the user interface to look
more like code. Make it look less like
terminal, more like JBD. Whatever you
want, it can do it. Just communicate it
clearly and don't give up after the
first prompt. Now, this one is super
important. Maybe I should have said it
even earlier, but PI agent is always in
YOLO mode. So, it will never ask you for
permissions. And if you're a beginner,
this can be very risky. But I would
argue that it's just a skill issue
because it can easily delete a folder.
you can easily delete a file or install
some packages that you don't want. But
again, this is why you should use
powerful models. So do not use pi with
small models. Please avoid models that
are cheap like Haiku Gemini Flash. Don't
do it. Don't do it. There's a reason I'm
using the latest version of cloth opus.
Okay? When Cloth Mythos comes out, I'm
going to instantly switch to that. When
OpenI releases GPD 5.6, I'm going to
switch to that. Use the most powerful
model possible. Do not use small models
and definitely do not use them inside of
pi because it's in yolo mode and if you
use a small model the chances of it
messing up and doing some catastrophic
mistake is much much higher than if you
use the latest version of opus. So this
is completely different approach than
cloth code or codex. Both of these are
very safe by default very restricted.
They ask you to approve like every other
tool call. It's very annoying and that's
because these companies are trillion
dollar companies. I mean both OpenAI and
Enthropic are valued at $1 trillion and
they cannot risk some agent going rogue
and deleting companies data, right?
Deleting a production database or
whatever. So they heavily guard rail
them. They heavily restrict them and
that's good for beginners but it's not
good for us people who are actually
serious about AI. Now you have two
options right with Pi. You either use
the best model and continue without
safety guardrails, which is what I'm
doing, or you install a package to solve
this, which is actually what I would
recommend people to do. And there's a
great one called PI permission system.
So, let me show you once again. When you
go to pi.dev, the default PI website at
the top, you can click on packages. And
you can see all of the popular packages,
recent ones, whatever. So, just type in
permission to find all of the packages
around permissions. And there are a lot
of solutions for this, right? You can
click through them, learn about them,
but the most popular one is this one. Pi
permission system with 17,000 downloads
per month. So, you can just click on
that, read about it, or you can just
copy the prompt right here. Pi install.
Just copy that. Boom. And tell it to
your PI agent. Check if we have this
installed.
Boom. Boom. Okay. So, I'm going to say
do not install it because, you know, I
don't mind it being in yellow mode.
Personally, I like it. But if you do
want to install it, if you, you know,
maybe are newer to AI, you're not sure
what these agents do, maybe you're on a
company computer and you cannot risk by
deleting some some info, uh, then
definitely install this one. Uh, again,
all of this is again the link to this
package is going to be inside of the
classroom here in M society. Can just
click on that. It's going to take you
directly to the specific package where
all you need to do is just copy this and
send it to your PI agent saying install
this package. And just like that, it
will install it for you. Now, so far
we've been using PI inside of the
default Mac OS terminal, which is fine,
but it's nowhere near as powerful as
using it inside of CMAX. So, let me show
you that. By the way, if you don't know
what CMAX is, I recently made a full
video on that. So, if you want to check
it out, make sure to watch it after this
one. But CMAX is basically the terminal
for AI agent management, for running
multiple AI agents in parallel. In fact,
let me show you how easy it is to spin
up multiple agents, right? So, we have
PI, we have cloud code, I can launch in
Codex, and this is, by the way, real
time. you know, I'm doing all of this in
real time. And just like that, I
launched four different agents in
parallel in the same workspace in a nice
2x two grid, right? And uh this is Cmax.
This is possible. And actually, we can
ask Pi check what's running inside of
this CMAX workspace and give all of
these agents, all the other free agents,
a simple task just for them to analyze
something, not make any changes.
This unlocks a world of possibilities
because here you can see that pi I have
two skills cmax and delegating to agents
which you will get um in the new society
repo. And there it is. It delegated to
other agents. You can see it sent the
prompt to other agents by itself. I'm
not doing anything. This is pi working
with these agents and telling them what
to do. So by itself it analyzed the Cmax
workspace because I have a skill for
this Cmax and a skill for delegating to
agents. It read both of these skills in
like half a second. It was super fast.
And then it basically send all of them a
test prompt without me having to do
anything. And again, this is really the
future where you have one agent as a
orchestrator. The other agents are doing
the tasks. I'm going to go more in depth
into this later in the video, but just
know that if you want the most out of
Pi, you should definitely use it inside
of CMAX. It is the way it is how I use
it every single day. And it just makes
it so easy to launch different
workspaces with command N. Or if you are
in the same workspace, you just do
command D to launch a new pane on the
horizontal split. You type in pi. Or
maybe you want to do a vertical split.
You do command shift D. You launch
another PI. Or if you don't want to even
do that, you can say, I closed the other
three agents. Make sure to launch three
more PI agents inside of this CMAX
workspace. You just tell it to PI to
launch more agents in there, right? It
can look at the state of the CMAX. It
can launch new paints. It can do
vertical splits, horizontal splits.
There it is. It just launched these by
itself. and it launched these PI agents
by itself. So, CMAX is really amazing.
It also allows you to like zoom in, zoom
out different terminals. It allows you
to resize them nicely. Um, yeah, it
really is the the ultimate terminal. So,
if you are still using the default Mac
OS terminal, I mean, it's fine. You
know, I'm not going to hate on it
because I've used it for years as well.
It's fine, but it's nowhere near as
powerful as CMAX. This has been built
for running multiple AI agents in
parallel. So, I would highly recommend
you use it. And again, it's completely
free, just like Pi is completely free.
So, both are open source, both are free.
There's no reason not to use them. Like,
you literally have no excuses. The only
excuse is sitting down and setting this
up. So, actually do it. If you're
watching this video, when you finish,
watch it all over and set it up. Don't
just be a watcher. Most people are just
watchers. They go through life. They
don't implement anything. They never
change. They have the same habits. Don't
be one of them. Be a doer. Implement
everything I'm showing you. All of this
is free. It's easy to implement. It's so
easy. Like I'm showing you all the
steps. You just have to do it. Sure, it
might be intimidating for the first
time, but you have no excuses. In this
video, I show you everything. It's the
ultimate PI agent course. So, if you
really are serious about AI and you want
to be on the cutting edge, stop being a
washer and start being a doer. Now, as
you might have noticed, PI agent has no
sub agents, and that's by design. So,
instead of using sub agents, Mario, the
creator of Pi, recommends spawning
multiple PI instances in parallel, just
like you can see here I did with T-Max.
And you can use either T-Max or CMAX
easily. Like these are tools that are
very easy to use. And this is the
workflow I've been using daily. It's
simpler, it's more transparent, and
you're actually fully in control, which
cannot be said if you're using cloud
code and the cloud code sub aents, which
half the time you don't even know what
the sub aents is doing or why it's doing
that. Also, the PI plus codeex combo is
very OP. So using PI agent with Codex is
really incredible for development
especially. So I would actually say that
this is one of the best PI workflows out
there currently using PI as the
orchestrator and the CEX as the you know
coder as the one as the one doing the
task like the actor. So Codex CLI
managed by PI amazing for coding and
development and this works especially
well inside of CMAX because PI can spawn
and manage other agents by itself. It
can read the CMAX panes. It can kill
them. It can restart them. It can pull
them and check them every 5 10 seconds.
Yes, doing this inside of CMAX is the
way to go. And by the way, you get the
best of both, right? So you get a PI
agent that's your personal agent with
all the context that you know, you know
how to talk it to. It's easy to talk to.
You can use any model. If you prefer
cloud models, you can use that. And
you're fully in control. And that agent
is driving Codex, which is right now the
most powerful coding harness. Plus, you
can save cost because instead of Codex,
you can use the CHBD subscription, which
you're already paying for. And instead
of PI, if you're using the open router
API key, you don't burn as many tokens
as if you're only using PI or running
two to three PI agents in parallel. So
PI plus codeex definitely the way to go.
In fact, let me just show it to you. So
I'm going to say kill the other three CX
panes. Now launch four new ones in 2x
two grid next to you and in each launch
CEX-OL.
So this will launch Codex CLI inside of
YOLO mode and again we can just chat
with Pi and it's going to manage these
um Codex agents easily.
All right. So it's launching them. Okay.
It's not really the grid is not really
fixed but it launched the agents. Fix
the grid.
It does not look good. And I'm going to
hit enter without option enter to steer
it right away. And you can actually do a
screenshot as well. This is something I
didn't show you. You can easily do CtrlV
to attach screenshots. Here I'm going to
do escape to interrupt it. So anytime Pi
is chatting you can just do escape at
any time to interrupt it and it will
stop generating tokens. And if you want
to paste in a screenshot it is CtrlV,
not command V. Here is what it looked
like and it will read the contents of
that screenshot. We'll see okay this was
messed up. It's not the nice grid that
we wanted and it will figure out how to
fix it. Okay. So now I think it's on the
right track.
There it is. Exactly like I wanted. So
we have the Pi on the left and a 2x2
grid of CEXes on the right. And look how
amazing this is. Like anytime this
launches, it just never gets old. Pi
launching these agents and managing
them. It's it's amazing. So now I'm
going to say, okay, now give each of
them to build a simple single HTML app.
Each of them should be different app and
tell them to launch it on different
local host ports. So you can just chat
with Pi in plain English. Again, again,
this these ones could be completely
zoomed out because you're not really
chatting with them. And what's nice
about CMAX is that the zooming in is
custom for each pane, right? So if you
want some of them to be like very large
font size, maybe the PI agent that
you're talking with, you can zoom it in
while the other ones are very small and
uh not really interactable, but also
easy to look at what they're doing,
right? So now Pi is pulling them. You
can see it's doing like sleep 25 to
check on it in 25 seconds. And your job
is basically to communicate your grand
goal to pi and it's going to send it to
codexis which themselves can do /go goal
to work forever until that goal has been
achieved. Right? So really the amount of
abstractions the amount of loops you can
run here is only limited by your
imagination. But this is my favorite
workflow basically using pi. Usually I
have like two codexes not four because
usually two is enough. But I'm only
talking to the Pi and it's managing the
COX instances and it doesn't burn as
many tokens because all it has to do is
do sleep and then read the contents of
those codexes. But 90% of the tokens or
more is generated by the COX CLI which
I'm running on GBD 5.5 medium fast or if
it's something more difficult I do high
or extra high but medium is usually
enough and definitely use fast mode
inside of Codex. In fact, I would say
that the CH GBT $100 subscription is
probably the highest value $100 you can
spend in all of AI. So if you don't have
that, you're definitely missing out. But
yeah, Codex right now is the best at
difficult coding. And there it is. Yes,
open all four as new Brave
browser tabs.
So again, Pi can control a computer and
it can do stuff, right? So there it is.
We have one, two. So all of these are
the same right now.
So I'm going to tell it screenshot and
confront it.
All of these are the same right now.
Make sure to fix this. Read what the
codexes are doing. Okay. So what
happened is they wrote the same
index.html.
So now PI agent is going to correct them
and you can see that it send the prompt
to all four of them so that they create
this in a separate subfolder because
they kind of overload the files, right?
And the main idea I want to drill into
your head here is that how much longer
would it take you to read the outputs of
these codexes and try to understand what
each of these codex agents is doing. If
it outputs like 2,000 tokens, sure you
can say make your answer simpler and
shorter, but it still would take you a
lot of time to read the full output and
to understand whether it's on the right
track, whether it did what you wanted to
do. But instead, if you have a PI agent
monitoring the output of the CEX agent,
it can read those tokens way faster. I
mean, an LLM can read maybe 100 times
faster than humans. So all you need to
do is tell Pi what you're trying to
achieve. What is the end outcome, the
desired end goal, and will manage the
codeex to get there. This is especially
OP if you're debugging a VPS. Let's say
you have Hermes agent on a VPS, you also
have a Codex CLI there to kind of manage
it, right? So if you want to update your
open claw or your Hermes agent to latest
version, you ideally have a Codex CLI on
the same VPS. But instead of talking to
the codeex which you have to figure out
what's the status of the VPS, why did
the Hermes gateway crash? Why is open
claw disconnecting WhatsApp, you instead
run pi. The pi opens a new cmax pane. It
sshes into the VPS, launches codexi on
the VPS and it talks to it and anything
it outputs it will know it instantly. So
this is really the way having your main
orchestrator, your main agent that
responds in a concise and clear way, has
the main context, knows your
preferences, knows your preferred style
of conversation, manage other agents
that are very powerful developer
optimized agents. This is the way. So
trust me, implement this as soon as
possible. You're going to implement it
sooner or later. So either you do it now
or you do it in 2027, it's entirely up
to you whether you want to be on the
cutting edge and get an unfair advantage
or if you want to be behind everybody.
That's your choice. So now this should
be solved. If we reload these, we should
have a different app in each. So we have
the timer, we have the calculator, to-do
list, and uh what is this? Stopwatch,
right? So very simple apps obviously,
but the main idea is that each of these
codexes build a different app and it
cost me zero in open router cost because
was just managing, right? So it only
spent a few tokens reading the outputs
of them. But most of the code, I mean
all of the code and most of the tokens
would have written with Codex CLI which
is powered by my JVD pro subscription
which I'm paying for anyway. Now perhaps
the most advanced concept inside of PI
agent is the sessions. I'm going to try
to explain it as clearly as possible.
Every session is a tree. So it's not a
linear you know step-by-step assistant
chat like in cloth code. It's instead
more of a tree like this. You can maybe
compare it to Git work trees if you
understand that. But basically anytime
you make any change it branches off
right. So maybe the easiest way is to
demonstrate it. So if we jump back into
pi and I do escape you can do escape
twice. So if you do escape once it
interrupts the message. If you do escape
twice you can go to any previous point
in the conversation history. So maybe if
you scroll up to my last user message
here I can hit enter and do no summary.
And I can change my prompt here. You
know, I can say uh um why are they all
showing the to-do app answer in short,
right? So, I'm saying a different
message from that point in history and
it's going to investigate that and I'm
going to interrupt it because I don't
care about the response. What I care
about is the tree has been created. So,
if I do escape double, we can see that
we still have both versions, right? We
serve the original message which was me
sending the screenshot and pointing out
the issue and we have the new message
which I just sent right now. It kind of
branched off. So instead of having a
linear single chat history, it branched
off into two. And now we can continue in
each of them. And if we if we change the
message any of them, it would branch off
again. So this is the most advanced
message history. It's a bit harder to
understand than the linear one you have
in JBT or cloud code, but it's the most
advanced one. It's the most customizable
one and you can go back any point and
just branch off. Now, if you want to
manually split a branch into its own
session file, you can run slashfork. So,
this is a command inside of pi that will
split the branch. Let me show you. Let's
jump back into CMAX here. So, we can do
/fork and it will create a new fork from
the previous user message. So, we can
select which message maybe you know here
before we did the build. So, instead of
simple HTML gap, we can say a game,
right? Right? So we could say now give
each codex agent a different web app
game to build. Right? And this is a
completely different fork and it's
forked to a new session. So it's not
just the same session in the tree. It's
completely new sessions. So if you do
slash resume you can see your previous
sessions. This is the chat history. So
for people who are coming from cloud
code chb the codex app and you want to
see your previous chats or threads
sessions is the equivalent in PI agent.
Now session files are port portable
JSONL. So you can c them slash share
them, write tool against them. You can
do a lot with them. So if you have a
session that you want to share with
somebody on your team, you can just do
slash share and send them a link. So
here is what that would look like. Slash
share. Boom.
Uh team not found matrix. Okay. So I'm
getting some error. So I'm going to have
pi debug that. Copy. Paste that in. I'm
getting this error anytime I do the
slashshare inside of pi
and do slash share.
Investigate why that is. Browse the web
about what is the proper solution and
tell me how we can fix it. Do not make
any changes yet. And this is the exact
process you should follow when you run
into unexpected errors because so far
everything has been smooth in this video
which is good. you know, I'm making a
nice tutorial for you, but it doesn't
give you the skill set of how to fix it
in case something is different. Maybe
you have a different operating system,
you have a different computer, you have
a different version of Mac OS, whatever.
Maybe you misinstalled it and you have
two conflicting Pi installations. If
something goes wrong, provide it a
screenshot. Tell it what's going wrong.
Tell it to do the web search. Hopefully,
you already set up the Pi web access
extension and tell it, "Okay, explain
what is going wrong and how we can fix
it. Do not make any changes yet. It will
do the web search. It will analyze it
here. It did the web search super
quickly. And investigation complete. No
changes made. What share is blah blah
blah contains. Okay. So my setting
contains matrix but there is no matrix
theme installed.
So we can probably remove the matrix
theme. Yes. Go with removing the matrix
theme. Do not do anything else. This is
how you debug. You tell pi this is what
went wrong. You give it a screenshot.
You tell it to do web search and um it
will fix it. It will research the stuff
and will tell you how to fix it. So now
if we do share it should work. Now we we
can we we have to do slash reload.
Remember anytime you do something you
have to do slash reload. Uh so I'm going
to say read the status of the four
codeex agents in this CMAX workspace so
that there is something in the chat
history and then I can do the slash
share. Okay, there it is. It gave me a
response. So I'm going to do slash share
and it's creating a gist that'll be easy
to share with the rest of my team. So we
get two options. We get a share URL and
a gist. So I can click on this. It'll
open. Actually it opened here. It's kind
of funny. Uh it opened inside of Cmax
because CMAX has a built-in browser by
the way. That's another reason you
should download it. But this is what it
looks like. You basically get a link
where you can share the entire session.
On the left you have the chat history.
And on the right you have the the
outputs, right? The prompts from you as
well as the PI assistant. So anytime you
want to share a conversation with your
team, it's literally just one command
away slash share and that's it. That's
how easy it is to share your pi history,
chat history for a specific session with
somebody else so they can see how you
came to that conclusion. They can see
how you prompted or whatever. So this is
very OP command. Make sure to use slash
share. On the topic of sessions and
sharing, you also need to understand the
slashres command. This is how you can
jump back into any previous conversation
or session you had with Pi. So none of
that is lost. Let me show you. It's
actually very easy. So when we go into
Cmax here, let's say your Cmax crashed,
you had to restart your computer or
whatever, right? And you have to start
pi again. It starts fresh, starts a new
session. So the way you would go to a
previous session is just do /resume and
this will show you all of the previous
sessions. This one you can see 9 minutes
ago here. This one is four minutes ago.
So you can just go into here and this
one is a fork. So you can nicely see
it's a fork of that and in fact if we do
a new one say like hey and then we kill
it and we start by and do slash resume
we should see that as a separate
session. So there's the hey session
which is now literally seconds ago and
this is one 9 minutes ago and that's how
you can see different sessions and you
can just hit enter and boom there you
are in the next session say let's resume
our work or whatever right so anytime
you want to continue in a previous chat
this is how you do that another
controversial design decision in PI
agent compared to other agents is that
it's antiMCP it's again MCP servers you
can see that we've went through this
entire video without mentioning MCPS
once And that's because the PI approach
is completely different. Instead of
connecting MCBs directly, it serves them
as CLI tools. So anything you want to do
with PI, it can do it as a CLI command
line interface. So if you really need to
call an MCB server for some reason, you
wrap it as a CLI tool and suddenly PI
can control it just like it can do any
other terminal command. So there's this
thing called MCP border which exposes
MCP calls as CLI commands and then PI
can just run them through the bash which
is one of the four tools it has. There's
also PI MCP adapter community extension.
It skips the MCP bloat and there's one
small proxy uh for MCP servers and it
loads all of the tools directly. So if
you really need MCP, these are two
solutions, but usually it's just better
to use direct terminal commands CLI
tools which PI can natively execute
without any issues. So that's it. This
has been the ultimate PI agent course
and again all of the resources from this
video will be in the new society
classroom right here inside of the PI
agent module. All the extensions,
agents, MD file, skills, prom templates,
everything I mentioned, you can find it
right here and just take it, copy it and
implement it right away. The link to new
society will be below the