aep save captures what worked — the intent, constraints, preferences, and workflow — into a reusable pack stored in your agent’s directory. Future sessions load this pack to start aligned from the first message.
When to run save
Runaep save immediately after a task completes successfully, while the context is still fresh. The quality of the extracted signals degrades if you wait.
Example user phrases
What the save flow does
Extract core signals
The agent reads the session and pulls out six signal types:
| Field | What it captures |
|---|---|
intent | The goal the task was trying to achieve |
constraints | Hard rules the agent had to respect |
preferences | Softer style or approach choices |
workflow | The sequence of steps that worked |
failure_traps | Mistakes or dead-ends encountered |
success_checks | Verifiable conditions that confirmed success |
Infer applies_to
The agent derives structured hints about where this pack is most relevant:
- languages — e.g.
"typescript","python","go" - frameworks — e.g.
"nextjs","django","rails" - paths — glob-style hints like
"app/**"or"src/api/**" - domains — labels like
"frontend","backend","infra","data"
Initialize experimental fields
Three sets of fields are populated on first save:strength — a single merge_suggestions — left empty by default; populated later if overlapping packs are detected.
0–1 scalar reflecting how strong the captured pattern is. Clearly successful tasks start at 0.7–0.9.metrics — usage counters initialized to reflect that the pack is brand new:times_applied:0first_used_at: equal tocreated_atlast_used_at: equal tocreated_at
Resolve the install target
The agent detects which agent environment is active for this repo and sets the AEP root accordingly:
If multiple agent directories exist, the agent prefers (in order): the directory explicitly referenced by you, the directory that already contains
| Agent | Directory |
|---|---|
| Claude | .claude/aep/ |
| Codex | .codex/aep/ |
| Gemini | .gemini/aep/ |
| OpenCode | .opencode/aep/ |
| Cursor | .cursor/aep/ |
aep/ files, the directory matching the currently running agent, then asks if still ambiguous.Write the pack file
The pack is saved as:All v1.0-exp packs carry
"version": "1.0-exp" at the top level.Update the index
<agent-dir>/aep/index.json is updated with a new entry (or refreshed if the pack already existed):Update instruction files
After saving, the agent updates agent instruction files so future sessions load AEP by default. Depending on which files exist in the repo, this includes:
AGENTS.mdCLAUDE.md- Codex instructions file
- Gemini instructions file
- OpenCode agent instruction/config file
- Cursor project instruction/rules file
Example pack
Here is a complete v1.0-exp pack as it looks afteraep save:
Optional: run evidence
You can ask the agent to also write a run evidence folder at:transcript.summary.md— a plain-language summary of the sessionsignals.json— the raw extracted signalsoutcome.json— the final outcome recordgenerated-pack.json— a copy of the pack as generated
Related pages
aep apply
Load and rank packs before starting a task
Schema reference
Full field definitions for v1.0-exp packs
Task packs
Learn about task-scoped packs
Matching and scoring
How applies_to and strength affect ranking