Create a new worktree and project for the creation of the adapter for the Pi coding agent.
Here's a small transcript of a recent conversation with Pi:
Hi Pi! How are you?
Hey! I’m doing great, thanks 😊
How can I help you with your project today?
Where do you store your sessions?
Good question.
I don’t keep long-term personal session memory.
Session Info
File: /Users/tarunsachdeva/.pi/agent/sessions/--Users-tarunsachdeva-code-traces--/2026-02-14T03-06-41-189Z_d59ba170-7f32-4ba4-94a1-c58570ba91cc.jsonl
ID: d59ba170-7f32-4ba4-94a1-c58570ba91cc
Messages
User: 2
Assistant: 2
Tool Calls: 0
Tool Results: 0
Total: 4
Tokens
Input: 1,529
Output: 367
Cache Read: 1,152
Total: 3,048
So, you delete this?
Session Info
File: /Users/tarunsachdeva/.pi/agent/sessions/--Users-tarunsachdeva-code-traces--/2026-02-14T03-06-41-189Z_d59ba170-7f32-4ba4-94a1-c58570ba91cc.jsonl
ID: d59ba170-7f32-4ba4-94a1-c58570ba91cc
Great catch — yes, that file path is exactly where Pi stores session logs locally on your machine.
So in practice:
So not “deleted automatically by me,” but it’s stored locally and can be cleaned up by your environment/user if needed.
No, not at all, I want to know.
Yep — it’s stored on disk here:
/Users/tarunsachdeva/.pi/agent/sessions/.../2026-02-14T03-06-41-189Z_d59ba170-7f32-4ba4-94a1-c58570ba91cc.jsonl
No — I (as the model) don’t delete anything unless explicitly coded in a tool step by someone with access.
It stays until Pi’s cleanup policy or user actions remove it.
If you want, I can also help you remove old session files safely (with a small command you can run).
As always, for new adapters, start with implementing the adapter interface, run tests so they all fail to start, and incrementally implement the adapter functionality. Please refer to @docs/adding-agents.md.
All functionality should be committed into a branch.
Planning worktree setup and implementation
Starting in-progress tasks
[
{
"id": "t1",
"content": "Inspect existing adapter architecture, registration, and test patterns in CLI",
"status": "in_progress",
"priority": "high"
},
{
"id": "t2",
"content": "Create git worktree and feature branch for Pi adapter project",
"status": "pending",
"priority": "high"
},
{
"id": "t3",
"content": "Add Pi agent ID to shared and CLI agent type definitions",
"status": "pending",
"priority": "high"
},
{
"id": "t4",
"content": "Scaffold Pi adapter interface implementation plus registry exports",
"status": "pending",
"priority": "high"
},
{
"id": "t5",
"content": "Add Pi adapter tests/fixtures starting with failing coverage",
"status": "pending",
"priority": "high"
},
{
"id": "t6",
"content": "Incrementally implement parsing/discovery/env extraction until tests pass",
"status": "pending",
"priority": "high"
},
{
"id": "t7",
"content": "Run relevant test suites and verify green",
"status": "pending",
"priority": "high"
},
{
"id": "t8",
"content": "Commit all changes on feature branch with required attribution",
"status": "pending",
"priority": "high"
}
]Scanning adapters and tests
Reviewing existing adapter types
Planning adapter inspection
Planning session file inspection
Designing robust Pi session parser
Considering file discovery methods
Correcting path typo
Planning directory inspection
Planning additional file reads
Inspecting local agent session directories
Inspecting config for storage paths
Planning agent ID integration
Investigating agent ID color mapping
Investigating agent identifier sources
Inspecting adapter list source
Examining root scripts for project setup
Planning worktree creation
git status --short --branchgit worktree listPlanning branch setup script
ls "/Users/tarunsachdeva/code"Creating new worktree using script
bun run worktree:new feat/pi-adapter -- --newSwitching to direct script run
bash scripts/new-worktree.sh feat/pi-adapter --newUpdating todo statuses
[
{
"id": "t1",
"content": "Inspect existing adapter architecture, registration, and test patterns in CLI",
"status": "completed",
"priority": "high"
},
{
"id": "t2",
"content": "Create git worktree and feature branch for Pi adapter project",
"status": "completed",
"priority": "high"
},
{
"id": "t3",
"content": "Add Pi agent ID to shared and CLI agent type definitions",
"status": "in_progress",
"priority": "high"
},
{
"id": "t4",
"content": "Scaffold Pi adapter interface implementation plus registry exports",
"status": "pending",
"priority": "high"
},
{
"id": "t5",
"content": "Add Pi adapter tests/fixtures starting with failing coverage",
"status": "pending",
"priority": "high"
},
{
"id": "t6",
"content": "Incrementally implement parsing/discovery/env extraction until tests pass",
"status": "pending",
"priority": "high"
},
{
"id": "t7",
"content": "Run relevant test suites and verify green",
"status": "pending",
"priority": "high"
},
{
"id": "t8",
"content": "Commit all changes on feature branch with required attribution",
"status": "pending",
"priority": "high"
}
]Planning adapter scaffold and tests
Inspecting fixture structure
Assessing adapter directory structure
Inspecting build configuration
Inspecting shared dist tracking
Inspecting build artifacts and skill sharing
Assessing skill agent ID references
Planning PI adapter integration
Inspecting local agent files
Designing custom session adapter
Inspecting project planning docs
Planning adapter skeleton implementation
Adding new type for pi
Adding initial adapter skeleton
Creating skeleton adapter file
Adding adapter registration
Planning adapter patching for tests
Preparing targeted test run
bun test test/core/adapters.test.tsPlanning full adapter implementation
[
{
"id": "t1",
"content": "Inspect existing adapter architecture, registration, and test patterns in CLI",
"status": "completed",
"priority": "high"
},
{
"id": "t2",
"content": "Create git worktree and feature branch for Pi adapter project",
"status": "completed",
"priority": "high"
},
{
"id": "t3",
"content": "Add Pi agent ID to shared and CLI agent type definitions",
"status": "completed",
"priority": "high"
},
{
"id": "t4",
"content": "Scaffold Pi adapter interface implementation plus registry exports",
"status": "in_progress",
"priority": "high"
},
{
"id": "t5",
"content": "Add Pi adapter tests/fixtures starting with failing coverage",
"status": "pending",
"priority": "high"
},
{
"id": "t6",
"content": "Incrementally implement parsing/discovery/env extraction until tests pass",
"status": "pending",
"priority": "high"
},
{
"id": "t7",
"content": "Run relevant test suites and verify green",
"status": "pending",
"priority": "high"
},
{
"id": "t8",
"content": "Commit all changes on feature branch with required attribution",
"status": "pending",
"priority": "high"
}
]Inspecting additional adapter tests
Designing robust Pi adapter parsing
Finalizing Pi adapter metadata and subscription logic
Adding fixture files with sanitized data
Adding second file
Updating background fixtures mapping
Adding edge tests for session parsing
Preparing targeted test run
bun test test/core/adapters.test.tsRunning shared build for AgentId
bun run buildRunning full CLI tests
bun testConsidering typecheck stability