---
title: "persist"
description: "Store data durably"
canonical: "https://acs.synapti.ai/capabilities/persist/"
last_updated: "2026-11-25T13:52:54+01:00"
---

# persist

Store data durably

Generated from [schemas/capability_ontology.yaml](https://github.com/synaptiai/agent-capability-standard/blob/main/schemas/capability_ontology.yaml), [skills/persist/SKILL.md](https://github.com/synaptiai/agent-capability-standard/blob/main/skills/persist/SKILL.md) at commit 18c38b74ac21. Ontology version 2.2.0.

Layer: [REMEMBER](https://acs.synapti.ai/layers/remember/index.md)

## Safety

| Property | Value |
| --- | --- |
| Risk | Low |
| Changes state | Yes |
| Needs checkpoint | No |
| Needs approval | No |
| Overridable | No |
| Blocked from autonomy | No |

In a workflow, it never shares a parallel group with rollback (F504).

## Relationships

**Figure: Relationships of persist: 4 relationships with 4 capabilities.** persist has 4 relationships with 4 capabilities: 1 with edges into it, 1 with edges out of it, and 2 joined to it only by edges that run both ways.

| Capability | Row | Relationships |
| --- | --- | --- |
| [`mutate`](https://acs.synapti.ai/capabilities/mutate/index.md) | Edges into persist | `enables` (into) |
| [`checkpoint`](https://acs.synapti.ai/capabilities/checkpoint/index.md) | Either way | `alternative_to` (both ways) |
| [`rollback`](https://acs.synapti.ai/capabilities/rollback/index.md) | Either way | `conflicts_with` (both ways) |
| [`recall`](https://acs.synapti.ai/capabilities/recall/index.md) | Edges out of persist | `enables` (out of) |

- `enables`: Unlocks [`recall`](https://acs.synapti.ai/capabilities/recall/index.md)
- `enables`: Unlocked by [`mutate`](https://acs.synapti.ai/capabilities/mutate/index.md)
- `conflicts_with`: May not share a parallel group with [`rollback`](https://acs.synapti.ai/capabilities/rollback/index.md)
- `alternative_to`: Can substitute for [`checkpoint`](https://acs.synapti.ai/capabilities/checkpoint/index.md)

## Contract

**Figure: Contract of persist: 4 inputs (1 required), 10 outputs.** persist takes 4 inputs, 1 required (filled pin) and 3 optional (hollow pin), and returns 10 outputs. The tables below list every field.

### Inputs

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `data` | any | Yes | Data to store; it round-trips as I-JSON, and data holding a secret the host recognises is refused (Standard v1.2 §4.5, §6.7) |
| `key` | string | No | Storage key; without one the host chooses it and returns it as key |
| `ttl` | string | No | Time to live, a duration (Standard v1.2 §5.10.1) longer than zero; the entry ends ttl after stored_at (§4.5) |
| `scope` | string | No | Who can read the entry and how long it lasts, one of run (the run the host started and every run nested in it), session, user, project, global or an x- name; the host's default when absent (Standard v1.2 §4.5) |

### Outputs

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `stored` | boolean | Yes | When true, a recall of the key in the scope returns the data until the entry ends; when false, nothing was written (Standard v1.2 §4.5) |
| `key` | string | No | Storage key |
| `scope` | string | No | The scope used |
| `stored_at` | string | No | When the entry was stored Format: date-time |
| `expires_at` | string | No | When the entry ends, for an entry with a ttl Format: date-time |
| `timestamp` | string | No | Deprecated, the same instant as stored_at (Standard v1.2 §4.5) Format: date-time |
| `evidence_anchors` | array of Anchor (or deprecated string or object) | Yes | What the output is based on, as evidence anchors (Standard v1.2 §6.5). An empty list grounds nothing, and the output is then marked inferred (§3.1). |
| `confidence` | number | No | The producer's probability that the output's claim is correct, self-reported; given when the output is inferred (Standard v1.2 §3.1, §4.1.1) From 0 to 1 |
| `inference_method` | string | No | How the output was reached when it is not grounded in evidence; with confidence it marks the output inferred (Standard v1.2 §3.1, §4.1.1). A producer should use model_knowledge, deduction, induction, abduction, analogy, statistical, simulation, assumption or an x- vendor value; a grounding policy (§5.20) requires one of them. |
| `uncertainty` | Uncertainty | No | The uncertainty of the output's principal value; its confidence equals the output's confidence (Standard v1.2 §4.1.1) |

The skill returns 14 fields: 8 are in persist's output contract (2 required) and 6 are the skill's own, outside the contract; it leaves out 2 contract fields (inference_method, uncertainty).

| Field of the skill's output | In the output contract |
| --- | --- |
| `stored` | Yes, required |
| `key` | Yes, optional |
| `scope` | Yes, optional |
| `stored_at` | Yes, optional |
| `expires_at` | Yes, optional |
| `timestamp` | Yes, optional |
| `persisted` | No, the skill's own |
| `write_operation` | No, the skill's own |
| `verification` | No, the skill's own |
| `metadata` | No, the skill's own |
| `duplicates_found` | No, the skill's own |
| `confidence` | Yes, optional |
| `evidence_anchors` | Yes, required |
| `assumptions` | No, the skill's own |
| `inference_method` | Yes, but the skill leaves it out |
| `uncertainty` | Yes, but the skill leaves it out |

## Used in workflows

No reference or domain workflow uses persist yet.

## Claude Code skill

**Figure: What the persist skill's tools can do, against the ontology.** The skill may use 2 tools: 1 only read and 1 change files; the ontology marks persist as changing state, and Edit can make the change.

| What they can do | Tools |
| --- | --- |
| Only read | `Read` |
| Run commands, which can change state | none |
| Change files | `Edit` |

**Figure: The field names each step of the persist procedure uses.** 7 of the procedure's 8 steps use the name of an input or output field of the persist skill as a word; 5 output fields of 14 are used by no step (verification, duplicates_found, confidence, evidence_anchors, assumptions).

| Step | Inputs it uses by name | Output fields it uses by name |
| --- | --- | --- |
| 1. Validate content | `data` | `persisted` |
| 2. Determine scope and destination | `data`, `key`, `ttl`, `scope` | `key`, `scope`, `stored_at`, `expires_at` |
| 3. Read existing content |  |  |
| 4. Check for duplicates/conflicts |  | `timestamp` |
| 5. Format new content |  | `timestamp`, `metadata` |
| 6. Apply the write | `data`, `key` | `key` |
| 7. Write to destination |  | `write_operation` |
| 8. Verify write | `data`, `key`, `ttl`, `scope` | `stored`, `key`, `scope`, `stored_at`, `expires_at` |

**Figure: The output fields each example of the persist skill writes out.** 3 examples against the skill's 14 output fields: stored, key, timestamp, persisted, write_operation, verification, metadata, duplicates_found, confidence, evidence_anchors and assumptions are in every example.

| Example | Output fields it writes out |
| --- | --- |
| Example 1: Persisting a Project Decision | `stored`, `key`, `scope`, `stored_at`, `expires_at`, `timestamp`, `persisted`, `write_operation`, `verification`, `metadata`, `duplicates_found`, `confidence`, `evidence_anchors`, `assumptions` |
| Example 2: Detecting Duplicate | `stored`, `key`, `timestamp`, `persisted`, `write_operation`, `verification`, `metadata`, `duplicates_found`, `confidence`, `evidence_anchors`, `assumptions` |
| Example 3: Merging with Existing Content | `stored`, `key`, `timestamp`, `persisted`, `write_operation`, `verification`, `metadata`, `duplicates_found`, `confidence`, `evidence_anchors`, `assumptions` |

**Figure: The neighbours the skill lists for persist, checked against the ontology and the catalogs.** The skill lists 7 capabilities as common neighbours of persist; 2 of them have an edge with it in the ontology, and 0 run next to it, in that order, in a catalog workflow. Under each tile, an edge reads from its source to its target, with persist's symbol in its place: "requires Ps" is a requires edge from the tile's capability to persist, so the tile's capability must run before persist; "Ps precedes" is a precedes edge from persist to the tile's capability.

| Listed as | Capability | Ontology edge | Next to it in a workflow |
| --- | --- | --- | --- |
| commonly follows | [`compare`](https://acs.synapti.ai/capabilities/compare/index.md) | none | never |
| commonly follows | [`discover`](https://acs.synapti.ai/capabilities/discover/index.md) | none | never |
| commonly follows | [`recall`](https://acs.synapti.ai/capabilities/recall/index.md) | `enables` (into it) | never |
| commonly follows | [`generate`](https://acs.synapti.ai/capabilities/generate/index.md) | none | never |
| commonly precedes | [`recall`](https://acs.synapti.ai/capabilities/recall/index.md) | `enables` (into it) | never |
| commonly precedes | [`verify`](https://acs.synapti.ai/capabilities/verify/index.md) | none | never |
| commonly precedes | [`audit`](https://acs.synapti.ai/capabilities/audit/index.md) | none | never |

### Intent

Execute **persist** to write stable learnings, decisions, and patterns to durable storage for future recall and consistency.

**Success criteria:**
- Content is written to the correct destination
- Existing content is preserved or properly merged
- New content follows established structure/format
- Metadata (timestamp, source) is recorded
- Write is verified successfully

**Compatible schemas:**
- `schemas/output_schema.yaml`

### Inputs

| Parameter | Required | Type | Description |
|-----------|----------|------|-------------|
| `data` | Yes | any | Data to store; it round-trips as I-JSON, and data holding a secret is refused (STANDARD v1.2 §4.5, §6.7) |
| `key` | No | string | Storage key; without one the host chooses it and returns it as `key` |
| `ttl` | No | string | Time to live, a duration (§5.10.1) longer than zero, e.g. `30d` or `PT12H`; the entry ends `ttl` after `stored_at` |
| `scope` | No | string | Who can read the entry and how long it lasts: `run`, `session`, `user`, `project`, `global` or an `x-` name (§4.5); the host's default (`session`) when absent |

Inputs not listed here are outside the capability's contract: a workflow step that binds them gets W604 (STANDARD v1.1 §5.5).

### Procedure

1) **Validate content**: Ensure content is appropriate for persistence
   - Check content is non-empty and meaningful
   - Verify content type classification
   - Ensure no sensitive data (credentials, PII) is being persisted: data that holds a secret is refused, not redacted, since memory is read back as fact (STANDARD v1.2 §6.7). Persist where the secret is kept (an environment variable's name, a vault path), not the secret
   - Validate content structure if object

2) **Determine scope and destination** (STANDARD v1.2 §4.5): the entry `{key, scope, data, stored_at, expires_at}` goes to the scope's store
   - `session` (the default): this conversation
   - `project`: a file the project keeps (`CLAUDE.md` for decisions and patterns, a specific file for domain knowledge)
   - `user`, `global`, `run`: the store the host provides for them
   - A scope this host does not provide: store nothing, and answer `unsupported_scope`; a `ttl` that is not a duration longer than zero: store nothing, and answer `unsupported_ttl`
   - Data that holds a secret: store nothing, and answer `secret_in_data`

3) **Read existing content**: Load current state of destination
   - Parse structure and sections
   - Identify target section for new content
   - Note existing entries to avoid duplicates

4) **Check for duplicates/conflicts**: Compare new vs existing
   - Exact duplicate: Skip or update timestamp only
   - Similar content: Flag for review
   - Contradiction: Stop and request clarification

5) **Format new content**: Structure for persistence
   - Add timestamp and source metadata
   - Format according to destination conventions
   - Include rationale if decision/pattern

6) **Apply the write**: A persist to a key that holds an entry replaces it
   - To combine with what is there, `recall` it first and persist the combined data
   - Within a file, `append` a new section, or `replace` the entry under the key

7) **Write to destination**: Execute the write operation
   - Use Edit tool for file modifications
   - Preserve file formatting and structure
   - Add section headers if needed

8) **Verify write** (read-after-write, §4.5): read the key back in the scope and compare
   - The data read back equals the data stored; then report `stored: true` with `stored_at` (and `expires_at` for a `ttl`)
   - `stored: false` means nothing was written or replaced: the step completes, and a workflow that depends on the write checks `stored`

### Output Contract

Return a structured object:

```yaml
stored: boolean  # true: a recall of the key in the scope returns the data until the entry ends; false: nothing was written (§4.5)
key: string  # Storage key (destination and section, e.g. "CLAUDE.md#Patterns")
scope: string  # The scope used (§4.5)
stored_at: string  # ISO 8601 date-time the entry was stored
expires_at: string | null  # When the entry ends, for an entry with a ttl
timestamp: string  # Deprecated: the same instant as stored_at
persisted:
  content_type: decision | pattern | fact | context
  content_id: string  # Unique identifier for this persisted item
  destination: string  # File path where content was written
  section: string | null  # Section within file
write_operation:
  strategy: append | replace | merge
  bytes_written: integer
  lines_added: integer
  lines_modified: integer
verification:
  write_confirmed: boolean
  content_present: boolean
  structure_valid: boolean
metadata:
  source: string  # Where this knowledge came from
  related_entries: array[string]  # IDs of related persisted items
  expiry: string | null  # When this knowledge should be reviewed
duplicates_found:
  - existing_id: string
    similarity: number
    action_taken: skipped | updated | merged
confidence: number  # probability that the data was stored as reported (§4.1.1)
evidence_anchors: array[EvidenceAnchor]  # References to verification; each {ref, kind} (STANDARD v1.2 §6.5)
assumptions: array[string]  # Explicit assumptions
```

#### Field Definitions

| Field | Type | Description |
|-------|------|-------------|
| `stored` | boolean | True: a later `recall` of the key in the scope returns the data until the entry ends (read-after-write, §4.5); false: nothing was written or replaced |
| `key` | string | Storage key the data lives under (destination and section) |
| `scope` | string | The scope used; a step of a 1.2 workflow that binds `scope` fails unless this echoes it (R402, `unsupported_scope`) |
| `stored_at` | string | ISO 8601 date-time the entry was stored |
| `expires_at` | string | When the entry ends, for an entry with a `ttl`; from then on a `recall` does not find it |
| `timestamp` | string | Deprecated: the same instant as `stored_at`; read `stored_at` (a reference to it is W603) |
| `persisted.content_id` | string | Unique ID for retrieval with `recall` |
| `persisted.destination` | string | File path of storage location |
| `write_operation` | object | Details of the write performed |
| `verification.write_confirmed` | boolean | Whether write was verified |
| `duplicates_found` | array | Any duplicate/similar entries detected |
| `confidence` | number | Probability, 0.0-1.0, that the data was stored as reported (§4.1.1) |
| `evidence_anchors` | array of evidence anchors (§6.5) | References to the written location and its verification |
| `assumptions` | array | Explicit assumptions |

### Examples

#### Example 1: Persisting a Project Decision

**Input:**
```yaml
data:
  content_type: decision
  decision: "Use PostgreSQL for all persistent storage"
  rationale: "Strong ACID guarantees, mature ecosystem, team familiarity"
  context: "Evaluated PostgreSQL, MySQL, and MongoDB for new backend service"
  constraints:
    - "Must support complex queries"
    - "Team has PostgreSQL experience"
key: "CLAUDE.md#Architecture Decisions"
scope: project
```

**Output:**
```yaml
stored: true
key: "CLAUDE.md#Architecture Decisions"
scope: project
stored_at: "2024-01-16T10:00:00Z"
expires_at: null
timestamp: "2024-01-16T10:00:00Z"
persisted:
  content_type: decision
  content_id: "decision_db_20240116"
  destination: "CLAUDE.md"
  section: "Architecture Decisions"
write_operation:
  strategy: append
  bytes_written: 256
  lines_added: 8
  lines_modified: 0
verification:
  write_confirmed: true
  content_present: true
  structure_valid: true
metadata:
  source: "conversation:conv_abc123"
  related_entries: []
  expiry: null
duplicates_found: []
confidence: 1.0
evidence_anchors:
  - {ref: "memory:CLAUDE.md#Architecture Decisions", kind: record}
  - {ref: "file:CLAUDE.md:45-52", kind: file}
  - {ref: "verification:re-read:success", kind: tool}
assumptions:
  - "CLAUDE.md is the correct location for architecture decisions"
  - "No conflicting database decisions exist"
```

**What was written to CLAUDE.md:**
```markdown
### Architecture Decisions

#### Database: PostgreSQL [2024-01-16]

**Decision:** Use PostgreSQL for all persistent storage

**Rationale:** Strong ACID guarantees, mature ecosystem, team familiarity

**Context:** Evaluated PostgreSQL, MySQL, and MongoDB for new backend service

**Constraints:**
- Must support complex queries
- Team has PostgreSQL experience
```

---

#### Example 2: Detecting Duplicate

**Input:**
```yaml
data:
  content_type: pattern
  pattern: "Wrap external API errors with domain-specific error types"
  rationale: "Prevents leaking implementation details"
key: "CLAUDE.md#Patterns"
```

**Output:**
```yaml
stored: true  # Already present as pattern_err_001; nothing new written
key: "CLAUDE.md#Patterns"
timestamp: "2024-01-16T11:00:00Z"
persisted:
  content_type: pattern
  content_id: null
  destination: "CLAUDE.md"
  section: "Patterns"
write_operation:
  strategy: append
  bytes_written: 0
  lines_added: 0
  lines_modified: 0
verification:
  write_confirmed: false
  content_present: true
  structure_valid: true
metadata:
  source: "conversation:conv_def456"
  related_entries: ["pattern_err_001"]
  expiry: null
duplicates_found:
  - existing_id: "pattern_err_001"
    similarity: 0.95
    action_taken: skipped
confidence: 0.9
evidence_anchors:
  - {ref: "file:CLAUDE.md:134", kind: file}
assumptions:
  - "High similarity indicates same pattern"
  - "Skipping to avoid duplicate"
next_actions:
  - "Consider updating existing pattern if new rationale is better"
```

---

#### Example 3: Merging with Existing Content

**Input:**
```yaml
data:
  content_type: fact
  fact: "API rate limit is 1000 requests per minute"
  source: "API documentation v2.3"
key: "docs/api-notes.md#Rate Limits"
```

Merge with the existing entry rather than appending a duplicate.

**Output:**
```yaml
stored: true
key: "docs/api-notes.md#Rate Limits"
timestamp: "2024-01-16T12:00:00Z"
persisted:
  content_type: fact
  content_id: "fact_rate_limit_20240116"
  destination: "docs/api-notes.md"
  section: "Rate Limits"
write_operation:
  strategy: merge
  bytes_written: 64
  lines_added: 1
  lines_modified: 1
verification:
  write_confirmed: true
  content_present: true
  structure_valid: true
metadata:
  source: "API documentation v2.3"
  related_entries: ["fact_rate_limit_20231201"]
  expiry: "2024-07-16"
duplicates_found:
  - existing_id: "fact_rate_limit_20231201"
    similarity: 0.8
    action_taken: merged
confidence: 1.0
evidence_anchors:
  - {ref: "memory:docs/api-notes.md#Rate Limits", kind: record}
  - {ref: "file:docs/api-notes.md:23", kind: file}
  - {ref: "source:API documentation v2.3", kind: x-doc}
assumptions:
  - "New rate limit supersedes previous"
  - "6-month expiry for review"
```

### Verification

- [ ] Content validated for appropriateness (no secrets/PII)
- [ ] Destination file exists or can be created
- [ ] Write operation completed without error
- [ ] Content present in destination after write
- [ ] File structure/formatting preserved

**Verification tools:** Read (to verify write), Edit (to perform write)

### Safety Constraints

- `mutation`: true
- `requires_checkpoint`: false
- `requires_approval`: false
- `risk`: low

**Capability-specific rules:**
- NEVER persist credentials, API keys, or secrets. Code enforces it: the skill's PreToolUse command hook blocks an `Edit`, `Write`, `MultiEdit` or `NotebookEdit` whose content holds what looks like a credential (`F504 CONSTRAINT_VIOLATED:`, STANDARD v1.2 §6.7, §5.18.10): the text it carries, and the lines the file will hold after it that it does not hold now (so a key already in the file, or a token two edits build, counts), each also with its `\uXXXX`, `\xXX`, `\/` and `\"` escapes decoded. It matches credential shapes (key and token formats, PEM and OpenPGP private keys, bearer tokens, a URL's userinfo password that is not a placeholder, an `Authorization` header's value mixing letters and digits, with no scheme or after any scheme (`ApiKey`, `SSWS`, ...), also given as a name/value pair or a two-element tuple, as a HAR or code writes headers, and a command's user option's password, `curl -u user:<password>`) and assignments to a credential name (`password`, `passphrase`, `token`, `secret_key`, `api_key`, ...), or values given to an option named for one (`--password <value>`), whose value is quoted with no whitespace and 8 or more characters, or unquoted, 12 or more characters, mixing letters and digits, quotes escaped or not; prose such as `token: rotate monthly` passes. The scan is `hooks/secret_scan.sh`, copied into the hook
- NEVER persist PII without explicit user consent
- Validate content does not contain executable code
- Preserve existing file structure and formatting
- Create backup before replacing existing content
- Stop if destination is a system or configuration file

### Composition Patterns

**Commonly follows:**
- `compare` - Persist the option a comparison selected for future reference
- `discover` - Save discovered patterns or relationships
- `recall` - Update existing memories with new context
- `generate` - Save a generated summary as durable knowledge

**Commonly precedes:**
- `recall` - Persisted content becomes available for recall
- `verify` - Verify persisted content is correct
- `audit` - Record what was persisted for compliance

**Anti-patterns:**
- Never persist without checking for duplicates
- Never persist contradictory information without flagging
- Never persist to files outside project scope without approval
- Avoid persisting ephemeral/temporary information

**Workflow references:**
- Pairs with `recall` for the remember/recall cycle
- Final step in many learning workflows
