Pi
General information
System prompt
1. skill: C:\Users\quocn\AppData\Roaming\npm\node_modules\@mariozechner\pi-coding-agent\docs\skills.md
2. extension: C:\Users\quocn\AppData\Roaming\npm\node_modules\@mariozechner\pi-coding-agent\docs\extensions.md
3. command (prompt): C:\Users\quocn\AppData\Roaming\npm\node_modules\@mariozechner\pi-coding-agent\docs\prompt-templates.md
4. readme: C:\Users\quocn\AppData\Roaming\npm\node_modules\@mariozechner\pi-coding-agent\README.md
5. examples folder: C:\Users\quocn\AppData\Roaming\npm\node_modules\@mariozechner\pi-coding-agent\examples\extensions\
Question?
- Can the UI language be configured to Vietnamese? → No.
System configuration
1. Global settings: C:\Users\quocn\.pi\agent\settings.json
2. auth/API key/OAuth token: C:\Users\quocn\.pi\agent1\auth.json
Shortcuts
@fuzzy-searches files in the current projectShift+Enterinserts a new lineAlt vreads imagesctrl cclears the current inputctrl uclears one linectrl enterinserts a new line
Commands
/reload: reload keybindings, extensions, skills, and prompts/model: switch the current model/new: create a truly new session, without old context/resume: reopen an old session/copy: copy the agent's last response/session: view current session info, including the jsonl file/quit: exit Pi/compact: compact context/tree= move around the existing conversation tree (open the branch map and jump between branches) → does not create a new session, does not delete code- No summary: the old branch is no longer in model context; it only remains in the session
- Summarize / Summarize with custom prompt: the old branch is no longer full context, but Pi compresses it into a summary and carries some of it forward
/fork= create a new branch from an earlier point, then continue in a different direction- old branch:
a -> b -> c -> d - new branch:
a -> b -> e -> f - In other words, it is tree navigation plus a split into a new branch/session. It does not carry the context from
candd; the code stays intact.
- old branch:
/settings: open settings. Press Enter to select.- thinking level: higher means smarter, slower, and usually more expensive
Compact
When context is full, Pi creates a structured summary and keeps the most recent part so the session can continue. Default reserveTokens = 16384, meaning Pi always reserves room for the model to answer.
↑1.8M ↓82k R25M $10.838 121.2%/200k (auto) > it will compact
- reserves room for the next answer
- keeps recent chat intact, summarizes older chat into a structured summary
- reloads context: system prompt + summary + recent chat
- the jsonl history file is not cleared. Every compact summarizes all old content since the previous compaction.
Settings
- Enable images:
File:
C:\Users\quocn\.pi\agent\settings.json
Change:
"blockImages": true
to:
"blockImages": false
then run /reload.
Command (Pi calls it Prompt template)
File:
C:\Users\quocn\.pi\agent\prompts\demo.md
Content:
Explain the following topic briefly and clearly, with examples if needed:
$@
Then type:
/demo Agents
Pi expands the template into a full prompt and sends it to the model.
Explain the following topic briefly and clearly, with examples if needed: Agents
Note: If there is no $@, the template will not receive the extra text after the command. The final prompt becomes only:
Explain the following topic briefly and clearly, with examples if needed:
Skill
Reuse Claude Code skills in Pi
File: C:\Users\quocn\.pi\agent\settings.json
Add a skills array that points to the Claude Code skills folder:
{
"enableSkillCommands": true,
"skills": [
"D:/.claude/skills"
]
}
Pi will automatically discover every skill in D:\.claude\skills\. No need to copy them into ~\.pi\agent\skills\.
How are commands different from skills?
- Similarity: both are text and both can contain a workflow.
- Command: a short markdown prompt file. When called, Pi expands it into a prompt and sends it to the model. It is a reusable prompt.
- Skill: a packaged capability. The model decides to use it when the task matches. A skill can include references, steps, detection rules, and optimized workflows.
Extension
Definition: an extension is TypeScript code that runs inside Pi to extend Pi's runtime behavior.
- skill = teaches the model what to do: “How should the LLM handle this task?”
- extension = gives Pi extra capabilities
- TypeScript file loaded at runtime
- can listen to events, intercept tools, add commands, add tools, change UI, send notifications, store state
So it is like the agent's tools and limbs. It can run when a session starts, when the agent starts answering, when an answer finishes, when a tool is called, or when a tool result returns.
Think of it like this:
- Model = the brain that answers
- Skill = playbook/instructions for the brain
- Extension = mod/plugin attached to Pi's body
- Settings = system knobs
Example: Windows notification extension
Pi starts → loads extension (TypeScript file) → extension registers event hooks (pi.on("agent_end", ...)) → when runtime reaches that event, the extension is called.
Thông tin chung
Prompt hệ thống
1. skill: C:\Users\quocn\AppData\Roaming\npm\node_modules\@mariozechner\pi-coding-agent\docs\skills.md
2. extension: C:\Users\quocn\AppData\Roaming\npm\node_modules\@mariozechner\pi-coding-agent\docs\extensions.md
3. command (prompt): C:\Users\quocn\AppData\Roaming\npm\node_modules\@mariozechner\pi-coding-agent\docs\prompt-templates.md
4. readme: C:\Users\quocn\AppData\Roaming\npm\node_modules\@mariozechner\pi-coding-agent\README.md
5. thư mục ví dụ: C:\Users\quocn\AppData\Roaming\npm\node_modules\@mariozechner\pi-coding-agent\examples\extensions\
Câu hỏi?
- Có cấu hình tiếng Việt được không → Không.
Cấu hình hệ thống
1. Global settings: C:\Users\quocn\.pi\agent\settings.json
2. auth/API key/OAuth token: C:\Users\quocn\.pi\agent1\auth.json
Phím tắt
@để fuzzy-search file trong projectShift+Enterđể xuống dòngAlt vđọc hình ảnhctrl cclear nội dung đang gõctrl uclear 1 dòngctrl enterxuống dòng
Lệnh
/reload: dùng để tải lại keybindings, extensions, skills, prompts/model: đổi model đang dùng/new: tạo session mới thật sự, không có ngữ cảnh cũ/resume: mở lại session cũ/copy: copy câu trả lời cuối của agent/session: xem thông tin của session hiện tại, cả file jsonl/quit: thoát Pi/compact: nén ngữ cảnh/tree= đi lại trong cây hội thoại hiện có (mở bản đồ các nhánh đã có rồi nhảy qua nhảy lại) → không tạo session mới, không xoá code- No summary: nhánh cũ không còn trong ngữ cảnh model, chỉ còn trong session
- Summarize / Summarize with custom prompt: nhánh cũ không còn nguyên context, nhưng được nén lại thành summary rồi mang theo một phần
/fork= tạo nhánh mới từ một điểm cũ để đi hướng khác- nhánh cũ:
a -> b -> c -> d - nhánh mới:
a -> b -> e -> f - Tức nó là tree + tách ra thành nhánh/session mới. Không có ngữ cảnh
cvàd, code vẫn còn nguyên.
- nhánh cũ:
/settings: mở setting cấu hình. Enter để chọn.- thinking level: càng cao càng thông minh, chậm hơn và thường tốn hơn
Compact
Khi context đầy, Pi tóm tắt thành một summary có cấu trúc rồi giữ lại phần mới nhất để tiếp tục. Mặc định reserveTokens = 16384, tức nó luôn chừa một khoảng trống để model còn chỗ trả lời.
↑1.8M ↓82k R25M $10.838 121.2%/200k (auto) > nó sẽ compact
- chừa chỗ cho trả lời mới
- giữ nguyên đoạn chat gần đây, phần cũ tóm tắt thành summary có cấu trúc
- nạp lại ngữ cảnh: hệ thống prompt + summary + đoạn chat gần đây
- lịch sử trong file jsonl không bị clear. Mỗi lần compact, nó tóm tắt lại toàn bộ phần cũ tính từ compaction trước đó.
Setting
- Bật hình ảnh:
File:
C:\Users\quocn\.pi\agent\settings.json
Đổi:
"blockImages": true
thành:
"blockImages": false
Sau đó chạy /reload.
Command (Pi gọi là Prompt template)
File:
C:\Users\quocn\.pi\agent\prompts\demo.md
Nội dung:
Giải thích ngắn gọn về chủ đề sau theo kiểu dễ hiểu, có ví dụ nếu cần:
$@
Rồi gõ:
/demo Agents
Pi sẽ bung template này thành prompt hoàn chỉnh rồi gửi cho model.
Giải thích ngắn gọn về chủ đề sau theo kiểu dễ hiểu, có ví dụ nếu cần: Agents
Lưu ý: Nếu không có $@ thì nó sẽ không nhận thêm nội dung phía sau, lúc đó chỉ còn là:
Giải thích ngắn gọn về chủ đề sau theo kiểu dễ hiểu, có ví dụ nếu cần:
Skill
Dùng chung skill với Claude Code
File: C:\Users\quocn\.pi\agent\settings.json
Thêm mảng skills trỏ sang thư mục Claude Code:
{
"enableSkillCommands": true,
"skills": [
"D:/.claude/skills"
]
}
Pi sẽ tự động discover tất cả skill trong D:\.claude\skills\. Không cần copy sang ~\.pi\agent\skills\.
Command khác skill chỗ nào?
- Giống: đều là text, có workflow.
- Command: file markdown ngắn. Khi gọi, Pi bung nó ra thành prompt và gửi cho model. Nói ngắn gọn, command là prompt tái sử dụng.
- Skill: một gói kỹ năng được đóng gói. Model tự quyết định dùng khi task khớp. Skill có thể có thư mục tham khảo, bước làm, cách nhận diện, và workflow tối ưu.
Extension
Định nghĩa: extension là code TypeScript chạy cùng Pi để mở rộng hành vi của chính Pi.
- skill = dạy model nên làm gì: “LLM nên xử lý task này theo cách nào?”
- extension = dạy Pi có thêm khả năng gì
- file TypeScript, load lúc runtime
- nghe event, chặn tool, thêm command, thêm tool, đổi UI, notify, lưu state
Tức nó giống như công cụ, cái cuốc cái xẻng cho agent. Nó có thể nhảy vào lúc bắt đầu phiên, lúc agent bắt đầu trả lời, lúc kết thúc trả lời, lúc gọi công cụ, hoặc lúc trả kết quả từ công cụ.
Nhìn như thế này:
- Model = bộ não trả lời
- Skill = playbook/hướng dẫn cho bộ não
- Extension = mod/plugin gắn vào cơ thể Pi
- Settings = núm chỉnh hệ thống
Ví dụ: extension bắn thông báo Windows
Pi khởi động → load extension (file TypeScript) → extension đăng ký event hooks (pi.on("agent_end", ...)) → khi runtime chạy tới event tương ứng, extension được gọi.