You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**A Pi extension that gives the LLM tools to manage its own context.**`spawn`, `ledger`, and `handoff` let the agent actively isolate work, persist reusable knowledge, and restart clean — without platform compaction or manual copy-paste.
8
+
**A Pi extension that gives the LLM tools to manage its own context.**`spawn`, `notebook`, and `handoff` let the agent actively isolate work, persist reusable knowledge, and restart clean — without platform compaction or manual copy-paste.
9
9
10
10
---
11
11
@@ -40,7 +40,7 @@ Then disable pi's built-in compaction so handoff stays in control:
40
40
}
41
41
```
42
42
43
-
That's it. Your agent now has `spawn`, `ledger_add`, `ledger_get`, `ledger_list`, and `handoff`. The status bar shows context usage and ledger count.
43
+
That's it. Your agent now has `spawn`, `notebook_write`, `notebook_read`, `notebook_index`, and `handoff`. The status bar shows context usage and notebook count.
44
44
45
45
---
46
46
@@ -49,10 +49,10 @@ That's it. Your agent now has `spawn`, `ledger_add`, `ledger_get`, `ledger_list`
49
49
| Feature | What it looks like |
50
50
|---------|-------------------|
51
51
|**Context usage %**|`ctx 65%` in status bar — green < 30%, yellow < 50%, orange < 70%, red ≥ 70% |
52
-
|**Ledger count**| 📒 `3` when entries exist, hidden when empty |
52
+
|**Notebook count**| 📒 `3` when pages exist, dim `📒 0` when empty |
handoff("Wire OAuth routes into the middleware stack.
96
-
Ledger 'oauth-decisions' holds the constraints.")
96
+
Notebook page 'oauth-decisions' holds the constraints.")
97
97
```
98
98
99
-
The agent decided to spawn research children, save reusable findings to the ledger, delegate implementation subtasks, and handoff when context got noisy. **You said one sentence.**
99
+
The agent decided to spawn research children, save reusable findings to the notebook, delegate implementation subtasks, and handoff when context got noisy. **You said one sentence.**
100
100
101
101
---
102
102
@@ -106,15 +106,15 @@ The agent decided to spawn research children, save reusable findings to the ledg
106
106
107
107
Delegate messy work to an isolated child agent with clean context. The child inherits the parent's model and tools, works independently, and returns only the condensed result. Siblings run in parallel; the parent stays focused on orchestration. Children cannot spawn grandchildren (explosive branch prevention).
108
108
109
-
### Ledger — Continuity Across Cuts
109
+
### Notebook — Continuity Across Cuts
110
110
111
-
A sparse continuity cache the agent curates while working. After discovering something reusable — a fact, constraint, decision, or expensive finding — it saves a named entry. Later contexts fetch entries on demand instead of re-deriving the work. The ledger persists across handoffs, context resets, and session restarts.
111
+
A sparse pocket notebook the agent curates while working. After discovering something reusable — a fact, constraint, decision, or expensive finding — it writes a named page. Later contexts read pages on demand instead of re-deriving the work. The notebook persists across handoffs, context resets, and session restarts.
112
112
113
113
### Handoff — Deliberate Compaction
114
114
115
-
When context degrades or the job changes, the agent saves reusable state to the ledger, writes a focused brief preserving what's still missing, and restarts clean. The new context starts with the brief front-and-center, all ledger entries accessible, and zero noise.
115
+
When context degrades or the job changes, the agent saves reusable state to the notebook, writes a focused brief preserving what's still missing, and restarts clean. The new context starts with the brief front-and-center, all notebook pages accessible, and zero noise.
116
116
117
-
**Rule of thumb:** The ledger holds reusable learned knowledge. Handoff carries the remaining situational context.
117
+
**Rule of thumb:** The notebook holds reusable learned knowledge. Handoff carries the remaining situational context.
118
118
119
119
---
120
120
@@ -139,7 +139,7 @@ A single summary blob mixes durable knowledge with transient situational context
139
139
| Operation | Primitive | What It Prevents |
140
140
|-----------|-----------|-----------------|
141
141
|**Isolate**| Spawn | Context pollution from noisy subtasks |
142
-
|**Persist**|Ledger| Knowledge loss across resets and pivots |
142
+
|**Persist**|Notebook| Knowledge loss across resets and pivots |
143
143
|**Compact**| Handoff | Degradation from overstuffed context |
144
144
145
145
---
@@ -150,10 +150,10 @@ A single summary blob mixes durable knowledge with transient situational context
See [ARCHITECTURE.md](ARCHITECTURE.md) for full module breakdown, tool schemas, lifecycle wiring, spawn child-session lifecycle, and ledger rehydration algorithm.
196
+
See [ARCHITECTURE.md](ARCHITECTURE.md) for full module breakdown, tool schemas, lifecycle wiring, spawn child-session lifecycle, and notebook rehydration algorithm.
Copy file name to clipboardExpand all lines: handoff/command.ts
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -37,7 +37,7 @@ export function registerHandoffCommand(pi: ExtensionAPI, state: AgenticodingStat
37
37
}
38
38
39
39
pi.sendUserMessage(
40
-
`Handoff direction: ${direction}\n\nPrepare a real handoff in the current session and current context. Before calling the handoff tool, capture any reusable state in the ledger if needed. Then complete the picture in a concise but sufficiently detailed handoff brief and call the handoff tool in this turn. Preserve the important knowledge that is still only present in the current context so the next clean context can start well without re-deriving it. Use any structure that makes the next work unambiguous. Include findings, current state, unresolved questions, failed paths worth avoiding, next steps, refs, constraints, and spawn ideas when useful. Reference ledger entries by name when relevant.`,
40
+
`Handoff direction: ${direction}\n\nPrepare a handoff in the current session. First, save any durable reusable knowledge to the notebook: findings worth keeping, constraints discovered, decisions made, or other grounding future contexts will need. Then draft a concise but sufficiently detailed handoff brief capturing only the remaining situational context: current state, blockers, unresolved questions, failed paths worth avoiding, and next steps. The next context will read the notebook on demand, so do not duplicate notebook content in the brief. Use any structure that makes the next work unambiguous. Reference notebook pages by name when relevant.`,
0 commit comments