# Persist

> Mark a Note or Collection as persistent so it survives goal-completion cleanup

- Skill: `bdambrosio/persist` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add bdambrosio/persist`
- Raw SKILL.md: https://api.skillmd.com/api/skills/bdambrosio/persist/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: bdambrosio (https://skillmd.com/u/bdambrosio)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/bdambrosio/persist

---


# Persist

## INPUT CONTRACT

- `target` (required): `$variable`, resource ID (`Note_123`, `Collection_456`, `Relation_7`), or named resource
- `name` (optional): Stable name to register for later `load(target="my-name")`
- `out` (optional): `$variable` aliased to the persisted resource

**REQUIREMENTS:**
- Target must resolve to an existing Note, Collection, or Relation

## BEHAVIOR

Marks the resource as persistent on disk so it is not swept by the transient-resource cleanup that runs after goal completion. Persistence is in-place — the same resource ID before and after. If `name` is given, the resource is also registered for load-by-name. If `out` is given, the variable is aliased to the same resource ID (equivalent to `bind` after `persist`).

Use persist for any output a subsequent goal will need to read.

## EXAMPLES

```json
{"type": "persist", "target": "$matches", "name": "transformer_attention_matches"}
```
```json
{"type": "persist", "target": "Collection_17", "name": "weather_report", "out": "$report"}
```

## OUTPUT

Returns `success` with the persisted resource's ID in `resource_id`.

## FAILURE SEMANTICS

- Missing `target`
- Target does not resolve to a Note, Collection, or Relation
- Underlying `mark_persistent` failed (e.g. disk write error)

## ANTI-PATTERNS

- Persisting transient scratch resources — only persist deliverables.
- Assuming `persist` copies or clones — it flips a flag on the existing resource. Both pre- and post-persist variables point to the same ID.
- Passing `out=` expecting a new resource. The binding points to the same resource; use `bind` explicitly if that is clearer at the call site.

