self-archive ยท diff
git:20260909.bc9876b to git:20260909.cae186a
6 added, 25 removed. Audit A to A.
---
name: self-archive
- description: Archive the bb thread the agent is currently running in, then release its runtime. Use when the user says "self-archive", "archive yourself", "archive this thread", "close this thread out", or tells a bb agent to archive its own session. Differentiator: archives the CURRENT thread via `--self`; to archive other threads use bb-cli or nagent.
+ description: Archive the current bb thread and release its runtime. Use when the user explicitly asks to "self-archive", "archive yourself", or "archive this thread".
---
# Self-archive
- Archive the bb thread you are running in. Works in any bb agent shell because bb sets `BB_THREAD_ID` and the CLI reads it via `--self`.
-
- ## When
-
- Only when the user explicitly asks. Never archive yourself after finishing a task on your own.
-
- ## Workflow
+ Only act on an explicit request to archive this thread. Never use `bb thread delete`.
- 1. **Say goodbye first.** Write the final summary now. Nothing prints after step 3.
- 2. **Archive** this thread. This also archives child threads.
+ 1. Send a brief closing summary before running commands.
+ 2. Archive this thread and its children. If this fails, report the error and do not stop the runtime.
```bash
bb thread archive --self --json
```
- 3. **Stop** this thread. Frees the agent runtime, keeps history. Must be the last command.
+ 3. After archiving succeeds, stop the runtime. Run nothing afterward.
```bash
bb thread stop --self --json
```
- ## Do not
-
- - Do not use `bb thread delete`. That is permanent.
- - Do not use `bb thread update --visibility hidden` as a substitute. Hidden is sidebar-only; archive is the lifecycle close-out.
- - Do not run any command after `stop`.
-
- ## Undo
-
- The user can restore the thread with:
-
- ```bash
- bb thread unarchive <id> --json
- bb thread list --archived
- ```
+ Undo: `bb thread unarchive <id> --json`.