@tekmidian/pai 0.5.6 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (137) hide show
  1. package/ARCHITECTURE.md +72 -1
  2. package/README.md +107 -3
  3. package/dist/{auto-route-BG6I_4B1.mjs → auto-route-C-DrW6BL.mjs} +3 -3
  4. package/dist/{auto-route-BG6I_4B1.mjs.map → auto-route-C-DrW6BL.mjs.map} +1 -1
  5. package/dist/cli/index.mjs +1897 -1569
  6. package/dist/cli/index.mjs.map +1 -1
  7. package/dist/clusters-JIDQW65f.mjs +201 -0
  8. package/dist/clusters-JIDQW65f.mjs.map +1 -0
  9. package/dist/{config-Cf92lGX_.mjs → config-BuhHWyOK.mjs} +21 -6
  10. package/dist/config-BuhHWyOK.mjs.map +1 -0
  11. package/dist/daemon/index.mjs +12 -9
  12. package/dist/daemon/index.mjs.map +1 -1
  13. package/dist/{daemon-D9evGlgR.mjs → daemon-D3hYb5_C.mjs} +670 -219
  14. package/dist/daemon-D3hYb5_C.mjs.map +1 -0
  15. package/dist/daemon-mcp/index.mjs +4597 -4
  16. package/dist/daemon-mcp/index.mjs.map +1 -1
  17. package/dist/{db-4lSqLFb8.mjs → db-BtuN768f.mjs} +9 -2
  18. package/dist/db-BtuN768f.mjs.map +1 -0
  19. package/dist/db-DdUperSl.mjs +110 -0
  20. package/dist/db-DdUperSl.mjs.map +1 -0
  21. package/dist/{detect-BU3Nx_2L.mjs → detect-CdaA48EI.mjs} +1 -1
  22. package/dist/{detect-BU3Nx_2L.mjs.map → detect-CdaA48EI.mjs.map} +1 -1
  23. package/dist/{detector-Bp-2SM3x.mjs → detector-jGBuYQJM.mjs} +2 -2
  24. package/dist/{detector-Bp-2SM3x.mjs.map → detector-jGBuYQJM.mjs.map} +1 -1
  25. package/dist/{factory-Bzcy70G9.mjs → factory-Ygqe_bVZ.mjs} +7 -5
  26. package/dist/{factory-Bzcy70G9.mjs.map → factory-Ygqe_bVZ.mjs.map} +1 -1
  27. package/dist/helpers-BEST-4Gx.mjs +420 -0
  28. package/dist/helpers-BEST-4Gx.mjs.map +1 -0
  29. package/dist/hooks/capture-all-events.mjs +19 -4
  30. package/dist/hooks/capture-all-events.mjs.map +4 -4
  31. package/dist/hooks/capture-session-summary.mjs +38 -0
  32. package/dist/hooks/capture-session-summary.mjs.map +3 -3
  33. package/dist/hooks/cleanup-session-files.mjs +6 -12
  34. package/dist/hooks/cleanup-session-files.mjs.map +4 -4
  35. package/dist/hooks/context-compression-hook.mjs +105 -111
  36. package/dist/hooks/context-compression-hook.mjs.map +4 -4
  37. package/dist/hooks/initialize-session.mjs +26 -17
  38. package/dist/hooks/initialize-session.mjs.map +4 -4
  39. package/dist/hooks/inject-observations.mjs +220 -0
  40. package/dist/hooks/inject-observations.mjs.map +7 -0
  41. package/dist/hooks/load-core-context.mjs +18 -2
  42. package/dist/hooks/load-core-context.mjs.map +4 -4
  43. package/dist/hooks/load-project-context.mjs +102 -97
  44. package/dist/hooks/load-project-context.mjs.map +4 -4
  45. package/dist/hooks/observe.mjs +354 -0
  46. package/dist/hooks/observe.mjs.map +7 -0
  47. package/dist/hooks/stop-hook.mjs +174 -90
  48. package/dist/hooks/stop-hook.mjs.map +4 -4
  49. package/dist/hooks/sync-todo-to-md.mjs +31 -33
  50. package/dist/hooks/sync-todo-to-md.mjs.map +4 -4
  51. package/dist/index.d.mts +32 -9
  52. package/dist/index.d.mts.map +1 -1
  53. package/dist/index.mjs +6 -9
  54. package/dist/indexer-D53l5d1U.mjs +1 -0
  55. package/dist/{indexer-backend-CIMXedqk.mjs → indexer-backend-jcJFsmB4.mjs} +37 -127
  56. package/dist/indexer-backend-jcJFsmB4.mjs.map +1 -0
  57. package/dist/{ipc-client-Bjg_a1dc.mjs → ipc-client-CoyUHPod.mjs} +2 -7
  58. package/dist/{ipc-client-Bjg_a1dc.mjs.map → ipc-client-CoyUHPod.mjs.map} +1 -1
  59. package/dist/latent-ideas-bTJo6Omd.mjs +191 -0
  60. package/dist/latent-ideas-bTJo6Omd.mjs.map +1 -0
  61. package/dist/neighborhood-BYYbEkUJ.mjs +135 -0
  62. package/dist/neighborhood-BYYbEkUJ.mjs.map +1 -0
  63. package/dist/note-context-BK24bX8Y.mjs +126 -0
  64. package/dist/note-context-BK24bX8Y.mjs.map +1 -0
  65. package/dist/postgres-CKf-EDtS.mjs +846 -0
  66. package/dist/postgres-CKf-EDtS.mjs.map +1 -0
  67. package/dist/{reranker-D7bRAHi6.mjs → reranker-CMNZcfVx.mjs} +1 -1
  68. package/dist/{reranker-D7bRAHi6.mjs.map → reranker-CMNZcfVx.mjs.map} +1 -1
  69. package/dist/{search-_oHfguA5.mjs → search-DC1qhkKn.mjs} +2 -58
  70. package/dist/search-DC1qhkKn.mjs.map +1 -0
  71. package/dist/{sqlite-WWBq7_2C.mjs → sqlite-l-s9xPjY.mjs} +160 -3
  72. package/dist/sqlite-l-s9xPjY.mjs.map +1 -0
  73. package/dist/state-C6_vqz7w.mjs +102 -0
  74. package/dist/state-C6_vqz7w.mjs.map +1 -0
  75. package/dist/stop-words-BaMEGVeY.mjs +326 -0
  76. package/dist/stop-words-BaMEGVeY.mjs.map +1 -0
  77. package/dist/{indexer-CMPOiY1r.mjs → sync-BOsnEj2-.mjs} +14 -216
  78. package/dist/sync-BOsnEj2-.mjs.map +1 -0
  79. package/dist/themes-BvYF0W8T.mjs +148 -0
  80. package/dist/themes-BvYF0W8T.mjs.map +1 -0
  81. package/dist/{tools-DV_lsiCc.mjs → tools-DcaJlYDN.mjs} +162 -273
  82. package/dist/tools-DcaJlYDN.mjs.map +1 -0
  83. package/dist/trace-CRx9lPuc.mjs +137 -0
  84. package/dist/trace-CRx9lPuc.mjs.map +1 -0
  85. package/dist/{vault-indexer-DXWs9pDn.mjs → vault-indexer-Bi2cRmn7.mjs} +174 -138
  86. package/dist/vault-indexer-Bi2cRmn7.mjs.map +1 -0
  87. package/dist/zettelkasten-cdajbnPr.mjs +708 -0
  88. package/dist/zettelkasten-cdajbnPr.mjs.map +1 -0
  89. package/package.json +1 -2
  90. package/src/hooks/ts/capture-all-events.ts +6 -0
  91. package/src/hooks/ts/lib/project-utils/index.ts +50 -0
  92. package/src/hooks/ts/lib/project-utils/notify.ts +75 -0
  93. package/src/hooks/ts/lib/project-utils/paths.ts +218 -0
  94. package/src/hooks/ts/lib/project-utils/session-notes.ts +363 -0
  95. package/src/hooks/ts/lib/project-utils/todo.ts +178 -0
  96. package/src/hooks/ts/lib/project-utils/tokens.ts +39 -0
  97. package/src/hooks/ts/lib/project-utils.ts +40 -999
  98. package/src/hooks/ts/post-tool-use/observe.ts +327 -0
  99. package/src/hooks/ts/pre-compact/context-compression-hook.ts +6 -0
  100. package/src/hooks/ts/session-end/capture-session-summary.ts +41 -0
  101. package/src/hooks/ts/session-start/initialize-session.ts +7 -1
  102. package/src/hooks/ts/session-start/inject-observations.ts +254 -0
  103. package/src/hooks/ts/session-start/load-core-context.ts +7 -0
  104. package/src/hooks/ts/session-start/load-project-context.ts +8 -1
  105. package/src/hooks/ts/stop/stop-hook.ts +28 -0
  106. package/templates/claude-md.template.md +7 -74
  107. package/templates/skills/user/.gitkeep +0 -0
  108. package/dist/chunker-CbnBe0s0.mjs +0 -191
  109. package/dist/chunker-CbnBe0s0.mjs.map +0 -1
  110. package/dist/config-Cf92lGX_.mjs.map +0 -1
  111. package/dist/daemon-D9evGlgR.mjs.map +0 -1
  112. package/dist/db-4lSqLFb8.mjs.map +0 -1
  113. package/dist/db-Dp8VXIMR.mjs +0 -212
  114. package/dist/db-Dp8VXIMR.mjs.map +0 -1
  115. package/dist/indexer-CMPOiY1r.mjs.map +0 -1
  116. package/dist/indexer-backend-CIMXedqk.mjs.map +0 -1
  117. package/dist/mcp/index.d.mts +0 -1
  118. package/dist/mcp/index.mjs +0 -500
  119. package/dist/mcp/index.mjs.map +0 -1
  120. package/dist/postgres-FXrHDPcE.mjs +0 -358
  121. package/dist/postgres-FXrHDPcE.mjs.map +0 -1
  122. package/dist/schemas-BFIgGntb.mjs +0 -3405
  123. package/dist/schemas-BFIgGntb.mjs.map +0 -1
  124. package/dist/search-_oHfguA5.mjs.map +0 -1
  125. package/dist/sqlite-WWBq7_2C.mjs.map +0 -1
  126. package/dist/tools-DV_lsiCc.mjs.map +0 -1
  127. package/dist/vault-indexer-DXWs9pDn.mjs.map +0 -1
  128. package/dist/zettelkasten-e-a4rW_6.mjs +0 -901
  129. package/dist/zettelkasten-e-a4rW_6.mjs.map +0 -1
  130. package/templates/README.md +0 -181
  131. package/templates/skills/createskill-skill.template.md +0 -78
  132. package/templates/skills/history-system.template.md +0 -371
  133. package/templates/skills/hook-system.template.md +0 -913
  134. package/templates/skills/sessions-skill.template.md +0 -102
  135. package/templates/skills/skill-system.template.md +0 -214
  136. package/templates/skills/terminal-tabs.template.md +0 -120
  137. package/templates/templates.md +0 -20
@@ -1,371 +0,0 @@
1
- <!-- Generated by PAI Setup -->
2
- # Universal Output Capture System (UOCS) - History System Documentation
3
-
4
- **Location:** `${PAI_DIR}/History/`
5
- **Purpose:** Automated documentation of ALL work performed by PAI and specialized agents
6
- **Status:** Configure during `pai setup`
7
-
8
- ---
9
-
10
- ## Overview
11
-
12
- The Universal Output Capture System (UOCS) is PAI's automatic memory - capturing every feature, bug fix, decision, learning, research, and session through hooks with **zero manual effort**.
13
-
14
- **Core Principle:** Work normally, documentation handles itself.
15
-
16
- ---
17
-
18
- ## Quick Reference
19
-
20
- This file is the **complete reference** for the history system. All specifications, conventions, and usage patterns are documented below.
21
-
22
- ---
23
-
24
- ## Directory Structure
25
-
26
- ```
27
- ${PAI_DIR}/History/
28
- ├── Sessions/YYYY-MM/ # Session summaries (SessionEnd hook)
29
- ├── Learnings/YYYY-MM/ # Problem-solving narratives (Stop hook + manual)
30
- ├── Research/YYYY-MM/ # Investigation reports (Researcher agents)
31
- ├── Decisions/YYYY-MM/ # Architectural decisions (Architect agent)
32
- ├── Execution/
33
- │ ├── Features/YYYY-MM/ # Feature implementations (Engineer/Designer)
34
- │ ├── Bugs/YYYY-MM/ # Bug fixes (Engineer)
35
- │ └── Refactors/YYYY-MM/ # Code improvements (Engineer)
36
- └── Raw-Outputs/YYYY-MM/ # JSONL logs (PostToolUse hook)
37
- ```
38
-
39
- **Quick Decision Guide:**
40
- - "What happened this session?" → `Sessions/`
41
- - "What did we learn?" → `Learnings/`
42
- - "What features were built?" → `Execution/Features/`
43
- - "What broke and when?" → `Execution/Bugs/`
44
- - "What was improved?" → `Execution/Refactors/`
45
- - "Why this approach?" → `Decisions/`
46
- - "What did we investigate?" → `Research/`
47
- - "Raw execution logs?" → `Raw-Outputs/`
48
-
49
- ---
50
-
51
- ## Project Session Storage
52
-
53
- **Location:** `${PAI_DIR}/projects/{encoded-path}/`
54
-
55
- Claude Code stores session transcripts per-project. PAI organizes these with a clean structure:
56
-
57
- ```
58
- ${PAI_DIR}/projects/{encoded-path}/
59
- ├── sessions/ # Session transcripts (auto-organized)
60
- │ ├── {uuid}.jsonl # Main session transcripts
61
- │ └── agent-*.jsonl # Subagent transcripts
62
- ├── Notes/ # Session notes (PAI extension)
63
- │ └── NNNN_YYYY-MM-DD_desc.md
64
- └── TODO.md # Project task tracking
65
- ```
66
-
67
- **Path Encoding:** Directory paths are encoded by replacing `/` and `.` with `-`
68
- - `/Users/you/Projects/myapp` → `-Users-you-Projects-myapp`
69
-
70
- **Session File Lifecycle:**
71
- 1. **During session:** Claude Code writes `.jsonl` to project root
72
- 2. **On UserPromptSubmit:** Cleanup hook moves stray files from previous sessions
73
- 3. **On Stop:** `stop-hook.ts` moves current session files to `sessions/`
74
- 4. **On SessionStart:** Context loader creates structure and migrates any stragglers
75
-
76
- **Key Files:**
77
- - `{uuid}.jsonl` - Full conversation transcript with token usage
78
- - `agent-*.jsonl` - Subagent (Task tool) transcripts
79
- - `Notes/*.md` - Human-readable session summaries
80
- - `TODO.md` - Synced from TodoWrite tool
81
-
82
- ---
83
-
84
- ## File Naming Convention
85
-
86
- **Unified format:**
87
- ```
88
- YYYY-MM-DD-HHMMSS_[PROJECT]_[TYPE]_[HIERARCHY]_[DESCRIPTION].md
89
- ```
90
-
91
- **Components:**
92
- - **Timestamp:** `YYYY-MM-DD-HHMMSS` - Enables chronological sorting
93
- - **Project:** Optional identifier (e.g., `dashboard`, `website`, `PAI`)
94
- - **Type:** Mandatory classification
95
- - `FEATURE` - New functionality
96
- - `BUG` - Bug fix
97
- - `REFACTOR` - Code improvement
98
- - `RESEARCH` - Investigation
99
- - `DECISION` - Architectural decision
100
- - `LEARNING` - Problem-solving narrative
101
- - `SESSION` - Session summary
102
- - **Hierarchy:** Optional task number (e.g., `T1.2.3`)
103
- - **Description:** Kebab-case, max 60 chars
104
-
105
- **Examples:**
106
- ```
107
- 2025-10-13-140000_dashboard_FEATURE_T1.1_database-schema-setup.md
108
- 2025-10-13-153000_dashboard_BUG_T1.2_jwt-expiry-validation.md
109
- 2025-10-13-092000_PAI_DECISION_unified-capture-architecture.md
110
- 2025-10-13-083000_LEARNING_kitty-remote-control-api.md
111
- 2025-10-13-180000_SESSION_feature-implementation-day-1.md
112
- ```
113
-
114
- ---
115
-
116
- ## Hook Integration
117
-
118
- ### 1. PostToolUse Hook
119
- **Triggers:** Every tool execution (Bash, Edit, Write, Read, Task, etc.)
120
- **Implementation:** `${PAI_DIR}/Hooks/capture-all-events.ts --event-type PostToolUse`
121
- **Output:** Daily JSONL logs in `Raw-Outputs/YYYY-MM/YYYY-MM-DD_all-events.jsonl`
122
- **Purpose:** Raw execution data for forensics and analytics
123
-
124
- **Key Feature:** Completely generic - captures ENTIRE payload automatically
125
- - **Future-proof**: New fields added to hooks are automatically captured
126
- - No code updates needed when Claude Code adds new fields
127
-
128
- ### 2. Stop Hook
129
- **Triggers:** Main agent task completion
130
- **Implementation:** `${PAI_DIR}/Hooks/stop-hook.ts`
131
- **Output:** Auto-captured files in `Learnings/` or `Sessions/` based on content
132
- **Purpose:** Lightweight capture of work summaries and learning moments
133
-
134
- **How it works:**
135
- 1. Extracts structured response format sections
136
- 2. Analyzes for learning indicators (problem, solved, discovered, fixed)
137
- 3. Categorizes as LEARNING (2+ indicators) or WORK (general session)
138
- 4. Generates appropriate filename and saves to history
139
-
140
- ### 3. SubagentStop Hook
141
- **Triggers:** Specialized agent task completion
142
- **Implementation:** `${PAI_DIR}/Hooks/subagent-stop-hook.ts`
143
- **Output:** Categorized documents in appropriate directories
144
- **Purpose:** Organized work documentation by agent type
145
-
146
- **Categorization Logic:**
147
- - Architect → `Decisions/` (DECISION)
148
- - Engineer/Principal-Engineer → `Execution/Features|Bugs|Refactors/`
149
- - Designer → `Execution/Features/` (FEATURE)
150
- - Researchers (all types) → `Research/` (RESEARCH)
151
- - Pentester → `Research/` (RESEARCH)
152
- - Intern → `Research/` (mixed - defaults to RESEARCH)
153
-
154
- ### 4. SessionEnd Hook
155
- **Triggers:** Session exit (when you quit Claude Code)
156
- **Implementation:** `${PAI_DIR}/Hooks/capture-session-summary.ts`
157
- **Output:** Session summary in `Sessions/YYYY-MM/`
158
- **Purpose:** High-level session documentation
159
-
160
- ### 5. SessionStart Hook
161
- **Triggers:** Session initialization (when you start Claude Code)
162
- **Implementation:** `${PAI_DIR}/Hooks/initialize-pai-session.ts`
163
- **Purpose:** Load core context and prepare session environment
164
-
165
- ---
166
-
167
- ## Custom Slash Commands
168
-
169
- ### /search-history [query]
170
- **Purpose:** Full-text search across all history
171
- **Example:** `/search-history authentication bug`
172
- **Implementation:** Uses ripgrep with context lines
173
-
174
- ### /show-project-history [project]
175
- **Purpose:** Chronological timeline for project
176
- **Example:** `/show-project-history dashboard`
177
- **Output:** Most recent 30 files for project
178
-
179
- ### /trace-feature [task-number]
180
- **Purpose:** Complete implementation history for task
181
- **Example:** `/trace-feature T1.2`
182
- **Output:** Features, bugs, refactors related to task
183
-
184
- ### /bug-timeline [feature]
185
- **Purpose:** Bug introduction and fix timeline
186
- **Example:** `/bug-timeline authentication`
187
- **Output:** Chronological list of related bugs
188
-
189
- ---
190
-
191
- ## Metadata Schema
192
-
193
- Every capture file includes YAML frontmatter:
194
-
195
- ```yaml
196
- ---
197
- # Core classification
198
- capture_type: FEATURE|BUG|REFACTOR|RESEARCH|DECISION|LEARNING|SESSION
199
- timestamp: 2025-10-13T14:30:22-07:00
200
- duration_minutes: 45
201
-
202
- # Context
203
- project: dashboard
204
- executor: main|architect|engineer|designer|researcher
205
- session_id: uuid
206
-
207
- # Development tracking (when applicable)
208
- hierarchy: T1.2.3
209
- spec_kit_feature: 001-user-authentication
210
- spec_kit_task: T005
211
- user_story: US1
212
- phase: 2
213
-
214
- # Technical details
215
- files_changed:
216
- - path/to/file.ts
217
- technologies:
218
- - TypeScript
219
- - Vitest
220
-
221
- # Outcomes
222
- status: completed|blocked|partial
223
- tests_added: 12
224
- tests_passing: 12
225
- coverage_change: +5.2%
226
-
227
- # Bug tracking (for bugs only)
228
- bug_severity: critical|high|medium|low
229
- bug_introduced_by: T1.1
230
-
231
- # Relationships
232
- related_to:
233
- - other-capture-file.md
234
- depends_on:
235
- - prerequisite-file.md
236
-
237
- # Searchability
238
- tags:
239
- - authentication
240
- keywords:
241
- - user model
242
- ---
243
- ```
244
-
245
- ---
246
-
247
- ## Common Usage Patterns
248
-
249
- ### Before Starting Work
250
-
251
- ```bash
252
- # Has this been done before?
253
- /search-history [feature-name]
254
-
255
- # What decisions were made about this?
256
- ls ${PAI_DIR}/History/Decisions/*/[project]_*
257
-
258
- # What did we learn about this domain?
259
- /search-history [domain-term]
260
- ```
261
-
262
- ### During Development
263
-
264
- **No action required** - work normally, everything captured automatically.
265
-
266
- ### After Encountering Issues
267
-
268
- ```bash
269
- # When did this break?
270
- /bug-timeline [feature-name]
271
-
272
- # Complete history of this feature
273
- /trace-feature T1.2.3
274
-
275
- # What similar bugs have we fixed?
276
- /search-history "[bug description]"
277
- ```
278
-
279
- ### Periodic Review
280
-
281
- ```bash
282
- # What did we accomplish this week?
283
- ls -lt ${PAI_DIR}/History/Sessions/$(date +%Y-%m)/ | head -7
284
-
285
- # All decisions made this month
286
- ls ${PAI_DIR}/History/Decisions/$(date +%Y-%m)/
287
-
288
- # Learnings from this quarter
289
- ls ${PAI_DIR}/History/Learnings/$(date +%Y-%m)/
290
- ```
291
-
292
- ---
293
-
294
- ## Advanced Queries
295
-
296
- ### Find all features for project
297
- ```bash
298
- find ${PAI_DIR}/History/Execution/Features -name "*_dashboard_*"
299
- ```
300
-
301
- ### Find bugs introduced in specific task
302
- ```bash
303
- rg "bug_introduced_by: T1.2" ${PAI_DIR}/History/Execution/Bugs/
304
- ```
305
-
306
- ### Find all work from specific date
307
- ```bash
308
- find ${PAI_DIR}/History -name "$(date +%Y-%m-%d)-*"
309
- ```
310
-
311
- ### Analyze tool usage patterns
312
- ```bash
313
- cat ${PAI_DIR}/History/Raw-Outputs/$(date +%Y-%m)/*.jsonl | \
314
- jq -r '.tool' | sort | uniq -c | sort -rn
315
- ```
316
-
317
- ### Extract all architectural decisions
318
- ```bash
319
- find ${PAI_DIR}/History/Decisions -name "*.md" | \
320
- xargs grep -l "Alternatives considered"
321
- ```
322
-
323
- ---
324
-
325
- ## Benefits
326
-
327
- - **Root Cause Analysis** - "When did we break this?" instantly answerable
328
- - **Decision Tracking** - Every architectural choice preserved with rationale
329
- - **Learning Accumulation** - Problem-solving patterns captured and queryable
330
- - **Process Improvement** - Complete history enables identifying bottlenecks
331
- - **Knowledge Harvesting** - Past solutions easily found and reused
332
- - **Zero Overhead** - Completely automated capture
333
-
334
- ---
335
-
336
- ## Maintenance
337
-
338
- ### Automated (No Action Required)
339
- - Hooks capture all work automatically
340
- - Files created with proper naming
341
- - Metadata populated by hooks
342
- - Categorization handled by hook logic
343
-
344
- ### Manual (Periodic)
345
-
346
- **Monthly:**
347
- - Review directory sizes
348
- - Archive older months if getting large (>1000 files/month)
349
- - Validate hook functionality
350
-
351
- **Quarterly:**
352
- - Extract common learnings into best practices
353
- - Analyze bug patterns for process improvements
354
- - Review categorization accuracy
355
-
356
- ---
357
-
358
- ## Routing Triggers
359
-
360
- **Load this documentation when the user says:**
361
- - "history system" or "UOCS"
362
- - "how does capture work" or "automatic documentation"
363
- - "where are sessions saved" or "history directory"
364
- - "how to search history" or "find past work"
365
- - "SubagentStop hook" or "capture hooks"
366
- - "learning capture" or "session summaries"
367
- - Questions about file organization in History/
368
-
369
- ---
370
-
371
- **This is the memory of your AI infrastructure - it remembers everything so you don't have to.**