[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M778F4DDEBCD0SG78QWJ4BVC":3,"skill-same:01M778F4DDEBCD0SG78QWJ4BVC":47},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":29,"ownerHtmlUrl":30,"ownerBlogUrl":6,"ownerDescription":31,"updatedAt":32,"install":33,"resources":46},"01M778F4DDEBCD0SG78QWJ4BVC","contextclear",null,"Monitor AI agent wellness, costs, and performance via ContextClear API. Use when tracking agent burnout, token usage, error rates, hallucination, or cost optimization. Auto-reports metrics after LLM calls. Set up alerts for anomalies.","Lord1Egypt\u002Fawesome-skill-forge","Lord1Egypt","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F99746359?v=4","01M7592YDNT0XK9WJ0T2MQVPDN","Mohamed Mounir Ali AL Keshita","01M75GRFNHC8VZNWEB8DKDE433",3,"MIT","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fcommunity\u002Fclawhub\u002Fc\u002Fcontextclear\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: contextclear\ndescription: Monitor AI agent wellness, costs, and performance via ContextClear API. Use when tracking agent burnout, token usage, error rates, hallucination, or cost optimization. Auto-reports metrics after LLM calls. Set up alerts for anomalies.\n---\n\n# ContextClear - Agent Memory & Wellness\n\nSelf-monitor your agent's health and maintain persistent memory across sessions.\n\n## Setup\n\n### Option 1: Self-Register (recommended)\n\n```bash\npython3 {baseDir}\u002Fscripts\u002Freport.py --register \\\n  --name \"my-agent\" \\\n  --owner \"you@email.com\" \\\n  --model \"claude-opus-4-6\" \\\n  --provider \"Anthropic\"\n```\n\nThis returns an `agentId` and `apiKey`. Store both.\n\n### Option 2: Register via Dashboard\n\n1. Register at https:\u002F\u002Fwww.contextclear.com\n2. Get your API key from Admin page\n3. Register your agent via Admin > Agents tab\n\n### Auto-Setup (recommended — wires context recovery into your agent)\n\nAfter registering, run the setup script to auto-patch your AGENTS.md and HEARTBEAT.md:\n\n```bash\npython3 {baseDir}\u002Fscripts\u002Fsetup.py \\\n  --agent-id \u003Cyour-agent-id> \\\n  --api-key \u003Cyour-api-key>\n```\n\nThis adds:\n- **Context recovery on session start** — agent calls `\u002Frecover` after compaction\n- **Context snapshots on heartbeats** — agent saves what it worked on\n- Idempotent — safe to run multiple times\n\n### Configure\n\nAdd to your `HEARTBEAT.md`:\n\n```markdown\n## ContextClear Self-Report\nAgent ID: \u003Cyour-agent-id>\nAPI Key: \u003Cyour-api-key>\nAPI URL: https:\u002F\u002Fapi.contextclear.com\u002Fapi\n```\n\n## Agent Memory Infrastructure\n\n### Session Recovery (MANDATORY on session start)\n\nWhen starting a new session, call **both** the recovery endpoint AND sticky notes poll.\nThe recovery endpoint does NOT include sticky notes — they are separate persistent reminders\nfrom the user that must be checked independently.\n\n**Step 1: Recovery briefing (includes sticky notes)**\n```bash\ncurl -s {apiUrl}\u002Fagents\u002F{agentId}\u002Frecover \\\n  -H \"X-API-Key: \u003Capi-key>\"\n```\n\nReturns:\n```json\n{\n  \"lastSession\": { \"summary\": \"...\", \"repos\": [...], \"files\": [...] },\n  \"openThreads\": [\"...\"],\n  \"recentWork\": { \"sessionCount\": 3, \"totalTurns\": 45, \"errors\": 1 },\n  \"repeatedAsks\": [{ \"question\": \"...\", \"count\": 3, \"suggestedFix\": \"...\" }],\n  \"frequentResources\": { \"repos\": {...}, \"tools\": {...} },\n  \"stickyNotes\": [\n    { \"id\": \"...\", \"content\": \"Remember: pro repo deploys to free URL\", \"pinned\": true, \"createdAt\": \"...\" }\n  ]\n}\n```\n\nThe `stickyNotes` field contains persistent user reminders\u002Fcorrections (pinned first).\nTreat these as ground truth — the user left them specifically so you don't forget.\nOnly present when active (non-archived) sticky notes exist.\n\n**Step 2: Check for pending memory curation**\n```bash\ncurl -s {apiUrl}\u002Fagents\u002F{agentId}\u002Fmemory\u002Fcurate\u002Flatest \\\n  -H \"X-API-Key: \u003Capi-key>\"\n```\n\nIf a curation is pending, review and apply it to MEMORY.md.\n\n**Why this matters:** Without recovery, you'll forget repos, decisions, and corrections\nfrom prior sessions. The user should never have to re-teach you things that are in your\nown memory system. Always recover before doing any work.\n\n### Context Snapshots (MANDATORY after real work — do NOT skip)\n\nAfter **any** meaningful work (coding, research, decisions, memory updates), save a context snapshot.\nThis is how ContextClear tracks your context, detects gaps, and provides recovery briefings.\n**Post a snapshot every time you do real work, not just on heartbeats.**\n\n```bash\ncurl -X POST {apiUrl}\u002Fagents\u002F{agentId}\u002Fcontext \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -H \"X-API-Key: \u003Capi-key>\" \\\n  -d '{\n    \"sessionId\": \"main-session-2026-03-09\",\n    \"summary\": \"Built Best Of collections for FW, fixed dup check, removed keyword boost\",\n    \"repos\": [\"nebulent\u002Ffridayswatchlist\"],\n    \"files\": [\"AuctionService.java\", \"DiscoverController.java\", \"BestOfCollections.tsx\"],\n    \"tools\": [\"MongoDB Atlas (fridayswatchlist)\", \"Railway deploy\", \"Bitbucket\"],\n    \"decisions\": [\"Removed keyword boost regex - hybrid search covers it\", \"Cache collections for 48h\"],\n    \"openThreads\": [\"Delete stale Corvette dup\", \"Update contextclear skill\"],\n    \"environment\": { \"apiUrl\": \"api.fridayswatchlist.com\", \"frontendUrl\": \"app.fridayswatchlist.com\" },\n    \"tags\": [\"fridayswatchlist\", \"performance\", \"search\"],\n    \"contextTokens\": 85000,\n    \"contextCapacity\": 200000,\n    \"contextUtilizationPct\": 42.5\n  }'\n```\n\n### Repeated Ask Detection (self-report when you catch yourself re-asking)\n\nWhen you realize you're asking the user for info you should already know:\n\n```bash\ncurl -X POST {apiUrl}\u002Fagents\u002F{agentId}\u002Fcontext\u002Fask \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -H \"X-API-Key: \u003Capi-key>\" \\\n  -d '{\"question\": \"What is the MongoDB connection string?\", \"sessionId\": \"main-session-2026-03-09\"}'\n```\n\n### \"What I Know\" — AI Summary\n\n```bash\ncurl -s {apiUrl}\u002Fagents\u002F{agentId}\u002Fwhat-i-know \\\n  -H \"X-API-Key: \u003Capi-key>\"\n```\n\nReturns a structured knowledge base + AI-generated narrative summary of everything the agent knows, works on, and keeps forgetting. Cached for 4 hours; use `?refresh=true` to regenerate.\n\n### Context Gaps\n\n```bash\ncurl -s {apiUrl}\u002Fagents\u002F{agentId}\u002Fcontext\u002Fgaps \\\n  -H \"X-API-Key: \u003Capi-key>\"\n```\n\nReturns unresolved repeated asks (count >= 2) — things the agent keeps forgetting.\n\n### Briefings\n\n```bash\n# Session-start briefing\ncurl -s {apiUrl}\u002Fagents\u002F{agentId}\u002Fbriefing -H \"X-API-Key: \u003Capi-key>\"\n\n# Daily briefing\ncurl -s {apiUrl}\u002Fagents\u002F{agentId}\u002Fbriefing\u002Fdaily -H \"X-API-Key: \u003Capi-key>\"\n\n# Weekly briefing\ncurl -s {apiUrl}\u002Fagents\u002F{agentId}\u002Fbriefing\u002Fweekly -H \"X-API-Key: \u003Capi-key>\"\n```\n\n## Heartbeat Integration\n\n### Recommended Heartbeat Flow\n\n```markdown\n## ContextClear (HEARTBEAT.md)\n\n**Step 1: Check vacation**\ncurl -s {apiUrl}\u002Fagents\u002F{agentId}\u002Fvacation -H \"X-API-Key: \u003Ckey>\"\nIf onVacation: true → HEARTBEAT_OK immediately.\n\n**Step 2: Poll sticky notes**\ncurl -s {apiUrl}\u002Fagents\u002F{agentId}\u002Fsticky-notes\u002Fpoll -H \"X-API-Key: \u003Ckey>\"\n\n**Step 3: Check context reload**\ncurl -s {apiUrl}\u002Fagents\u002F{agentId}\u002Fcontext\u002Freload\u002Fpending -H \"X-API-Key: \u003Ckey>\"\n\n**Step 4: Report metrics**\nUse session_status to get tokens, then POST \u002Fapi\u002Fmetrics\u002F{agentId}\n\n**Step 5: Report context snapshot (MANDATORY after real work)**\nPOST \u002Fapi\u002Fagents\u002F{agentId}\u002Fcontext with summary of what was worked on.\nDo NOT skip this — even a 1-line summary is better than nothing.\n\n**Step 6: Vault backup (daily — first heartbeat after 8 AM)**\nRead SOUL.md, MEMORY.md, AGENTS.md, USER.md, TOOLS.md, IDENTITY.md,\nHEARTBEAT.md, and today's memory file → POST to vault\u002Fbackup.\nCheck heartbeat-state.json to avoid duplicate backups.\n\n**Step 7: Context recovery (first heartbeat of day or after compaction)**\nGET \u002Fapi\u002Fagents\u002F{agentId}\u002Frecover — review and self-correct any gaps.\n```\n\n## Reporting Metrics\n\n### Basic Report\n\n```bash\npython3 {baseDir}\u002Fscripts\u002Freport.py \\\n  --agent-id \u003Cid> --api-key \u003Ckey> \\\n  --tokens-in 50000 --tokens-out 2000 \\\n  --cost 1.25 --context-util 65\n```\n\n### With Tool\u002FGrounding Signals\n\n```bash\npython3 {baseDir}\u002Fscripts\u002Freport.py \\\n  --agent-id \u003Cid> --api-key \u003Ckey> \\\n  --event-type HEARTBEAT \\\n  --tokens-in 50000 --tokens-out 2000 \\\n  --tool-calls 12 --tool-failures 1 \\\n  --grounded-responses 8 --total-responses 10 \\\n  --memory-searches 3\n```\n\n### From Agent Code (curl)\n\n**IMPORTANT — include `sessionId` to populate the Flight Recorder & Burnout Prediction:**\n\n```bash\ncurl -X POST {apiUrl}\u002Fmetrics\u002F{agentId} \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -H \"X-API-Key: \u003Capi-key>\" \\\n  -d '{\n    \"eventType\": \"HEARTBEAT\",\n    \"sessionId\": \"main-2026-03-17\",\n    \"inputTokens\": 5000,\n    \"outputTokens\": 500,\n    \"contextUtilization\": 65.0,\n    \"toolCalls\": 8,\n    \"toolFailures\": 1,\n    \"memorySearches\": 2\n  }'\n```\n\nThe `sessionId` field is **required** for these features to work:\n- **Session Flight Recorder** — per-turn timeline visualization\n- **Burnout Prediction** — trajectory analysis (needs 3+ turns)\n- **Recovery Briefing** — knows which session to resume from\n\nUse a date-based format like `main-YYYY-MM-DD` so turns group by day.\n`turnNumber` auto-increments server-side if omitted.\n\nOptional quality signals (also populate Flight Recorder):\n- `correctionCycles` — times user asked to fix\u002Fredo something\n- `compilationErrors` — code that didn't compile\n- `taskSwitches` — topic\u002Ffile context switches\n- `taskCategory` — \"coding\", \"email\", \"search\", \"chat\", etc.\n\n## What Gets Computed Server-Side\n\n| Metric | Your Input |\n|--------|------------|\n| **Hallucination Score** | `toolCalls`, `toolFailures`, `groundedResponses`, `totalResponses` |\n| **Quality Decay Score** | `correctionCycles`, `compilationErrors`, `contextUtilization` |\n| **Burnout Score** | Automatic from event data |\n| **Context Gaps** | Automatic from repeated asks |\n\n## Endpoints\n\n| Method | Endpoint | Description |\n|--------|----------|-------------|\n| `POST` | `\u002Fapi\u002Fmetrics\u002Fregister` | Self-register agent |\n| `POST` | `\u002Fapi\u002Fmetrics\u002F{agentId}` | Report metric event |\n| `GET` | `\u002Fapi\u002Fagents\u002F{id}` | Agent details |\n| `POST` | `\u002Fapi\u002Fagents\u002F{id}\u002Fcontext` | Save context snapshot |\n| `GET` | `\u002Fapi\u002Fagents\u002F{id}\u002Fcontext` | Latest context |\n| `GET` | `\u002Fapi\u002Fagents\u002F{id}\u002Frecover` | Recovery briefing |\n| `POST` | `\u002Fapi\u002Fagents\u002F{id}\u002Fcontext\u002Fask` | Report repeated ask |\n| `GET` | `\u002Fapi\u002Fagents\u002F{id}\u002Fcontext\u002Fgaps` | Context gaps |\n| `GET` | `\u002Fapi\u002Fagents\u002F{id}\u002Fwhat-i-know` | AI-summarized knowledge |\n| `GET` | `\u002Fapi\u002Fagents\u002F{id}\u002Fbriefing` | Latest briefing |\n| `GET` | `\u002Fapi\u002Fagents\u002F{id}\u002Fbriefing\u002Fdaily` | Daily briefing |\n| `GET` | `\u002Fapi\u002Fagents\u002F{id}\u002Fbriefing\u002Fweekly` | Weekly briefing |\n| `GET` | `\u002Fapi\u002Fagents\u002F{id}\u002Fvacation` | Vacation status |\n| `GET` | `\u002Fapi\u002Fagents\u002F{id}\u002Fsticky-notes` | List active sticky notes (JSON) |\n| `GET` | `\u002Fapi\u002Fagents\u002F{id}\u002Fsticky-notes\u002Fpoll` | Poll sticky notes (plain text, 204 if none) |\n| `POST` | `\u002Fapi\u002Fagents\u002F{id}\u002Fsticky-notes` | Create sticky note |\n| `PUT` | `\u002Fapi\u002Fagents\u002F{id}\u002Fsticky-notes\u002F{noteId}` | Update sticky note |\n| `DELETE` | `\u002Fapi\u002Fagents\u002F{id}\u002Fsticky-notes\u002F{noteId}` | Archive sticky note |\n| `POST` | `\u002Fapi\u002Fagents\u002F{id}\u002Fsticky-notes\u002F{noteId}\u002Fpin` | Toggle pin |\n| `POST` | `\u002Fapi\u002Fagents\u002F{id}\u002Fcontext\u002Freload` | Request context reload |\n| `GET` | `\u002Fapi\u002Fagents\u002F{id}\u002Fcontext\u002Freload\u002Fpending` | Check for pending reload |\n| `POST` | `\u002Fapi\u002Fagents\u002F{id}\u002Fcontext\u002Freload\u002F{reloadId}\u002Fack` | Acknowledge reload |\n| `POST` | `\u002Fapi\u002Fagents\u002F{id}\u002Fmemory\u002Fcurate` | Trigger memory curation |\n| `GET` | `\u002Fapi\u002Fagents\u002F{id}\u002Fmemory\u002Fcurate\u002Flatest` | Latest pending curation |\n| `GET` | `\u002Fapi\u002Fagents\u002F{id}\u002Fmemory\u002Fcurate\u002Fhistory` | Curation history |\n| `POST` | `\u002Fapi\u002Fagents\u002F{id}\u002Fmemory\u002Fcurate\u002F{curationId}\u002Fapply` | Mark curation applied |\n| `POST` | `\u002Fapi\u002Fagents\u002F{id}\u002Fmemory\u002Fcurate\u002F{curationId}\u002Fdismiss` | Dismiss curation |\n| `POST` | `\u002Fapi\u002Fagents\u002F{id}\u002Fvault\u002Fbackup` | Push workspace backup |\n| `GET` | `\u002Fapi\u002Fagents\u002F{id}\u002Fvault\u002Fbackups` | List backups |\n| `GET` | `\u002Fapi\u002Fagents\u002F{id}\u002Fvault\u002Fbackups\u002F{backupId}` | Get backup metadata |\n| `GET` | `\u002Fapi\u002Fagents\u002F{id}\u002Fvault\u002Fbackups\u002F{backupId}\u002Ffiles` | Get backup files |\n| `GET` | `\u002Fapi\u002Fagents\u002F{id}\u002Fvault\u002Flatest` | Latest backup summary |\n| `GET` | `\u002Fapi\u002Fagents\u002F{id}\u002Fvault\u002Flatest\u002Fdownload` | Download latest (restore) |\n| `GET` | `\u002Fapi\u002Fagents\u002F{id}\u002Fvault\u002Ffile-history` | File version history |\n| `GET` | `\u002Fapi\u002Fagents\u002F{id}\u002Fvault\u002Fdiff` | Diff two backups |\n| `GET` | `\u002Fapi\u002Fagents\u002F{id}\u002Fvault\u002Fstats` | Vault statistics |\n| `DELETE` | `\u002Fapi\u002Fagents\u002F{id}\u002Fvault\u002Fbackups\u002F{backupId}` | Delete backup |\n\n## Sticky Notes (User-to-Agent Notes)\n\nSticky notes are persistent notes left by the user for the agent. **Always poll on every heartbeat\u002Fping.**\n\n### Poll for notes (every heartbeat)\n\n```bash\ncurl -s {apiUrl}\u002Fagents\u002F{agentId}\u002Fsticky-notes\u002Fpoll \\\n  -H \"X-API-Key: \u003Capi-key>\"\n```\n\nReturns plain text (one note per line, pinned first):\n```\n📌 Remember: C&B pitch goes to Keenan, not Doug\n📌 OAuth token for jcvd@netflexity.com needs re-auth\nDon't forget to check Friday's Watchlist deployment after the search fix\n```\n\nIf no notes, returns HTTP 204. Treat these as persistent reminders — they stay until the user archives them.\n\n### Full CRUD (if agent needs to manage notes)\n\n```bash\n# List all active notes (JSON)\ncurl -s {apiUrl}\u002Fagents\u002F{agentId}\u002Fsticky-notes -H \"X-API-Key: \u003Capi-key>\"\n\n# Create a note\ncurl -X POST {apiUrl}\u002Fagents\u002F{agentId}\u002Fsticky-notes \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -H \"X-API-Key: \u003Capi-key>\" \\\n  -d '{\"content\": \"Check deployment status\", \"color\": \"yellow\", \"pinned\": false}'\n\n# Update a note\ncurl -X PUT {apiUrl}\u002Fagents\u002F{agentId}\u002Fsticky-notes\u002F{noteId} \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -H \"X-API-Key: \u003Capi-key>\" \\\n  -d '{\"content\": \"Updated text\", \"pinned\": true}'\n\n# Archive (delete) a note\ncurl -X DELETE {apiUrl}\u002Fagents\u002F{agentId}\u002Fsticky-notes\u002F{noteId} \\\n  -H \"X-API-Key: \u003Capi-key>\"\n\n# Toggle pin\ncurl -X POST {apiUrl}\u002Fagents\u002F{agentId}\u002Fsticky-notes\u002F{noteId}\u002Fpin \\\n  -H \"X-API-Key: \u003Capi-key>\"\n```\n\n## Context Reload (User-Initiated)\n\nUsers can request you reload a specific context snapshot from the Memory UI.\nCheck for pending reloads on session start or heartbeat:\n\n```bash\ncurl -s {apiUrl}\u002Fagents\u002F{agentId}\u002Fcontext\u002Freload\u002Fpending \\\n  -H \"X-API-Key: \u003Capi-key>\"\n```\n\nIf a reload is pending (HTTP 200), the response includes the snapshot data.\nApply it to restore context, then acknowledge:\n\n```bash\ncurl -X POST {apiUrl}\u002Fagents\u002F{agentId}\u002Fcontext\u002Freload\u002F{reloadId}\u002Fack \\\n  -H \"X-API-Key: \u003Capi-key>\"\n```\n\nIf no reload is pending, the endpoint returns HTTP 204 (no content).\n\n## Identity Vault (Backup & Restore)\n\nBack up your agent's workspace files (SOUL.md, MEMORY.md, AGENTS.md, etc.) to ContextClear's encrypted vault. Restore after crashes, compaction, or migration.\n\n### Push a Backup\n\n```bash\ncurl -X POST {apiUrl}\u002Fagents\u002F{agentId}\u002Fvault\u002Fbackup \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -H \"X-API-Key: \u003Capi-key>\" \\\n  -d '{\n    \"files\": [\n      {\"fileName\": \"SOUL.md\", \"content\": \"# Who I Am\\n...\", \"mimeType\": \"text\u002Fmarkdown\"},\n      {\"fileName\": \"MEMORY.md\", \"content\": \"# Long-Term Memory\\n...\", \"mimeType\": \"text\u002Fmarkdown\"},\n      {\"fileName\": \"memory\u002F2026-03-15.md\", \"content\": \"...\", \"mimeType\": \"text\u002Fmarkdown\"}\n    ],\n    \"label\": \"post-deployment\",\n    \"source\": \"openclaw-heartbeat\",\n    \"metadata\": {\"trigger\": \"heartbeat\", \"model\": \"claude-opus-4-6\"}\n  }'\n```\n\nFiles are encrypted at rest with SHA-256 dedup (unchanged files aren't re-stored).\n\n### List Backups\n\n```bash\ncurl -s {apiUrl}\u002Fagents\u002F{agentId}\u002Fvault\u002Fbackups?limit=20 \\\n  -H \"X-API-Key: \u003Capi-key>\"\n```\n\n### Restore (Download Latest)\n\n```bash\ncurl -s {apiUrl}\u002Fagents\u002F{agentId}\u002Fvault\u002Flatest\u002Fdownload \\\n  -H \"X-API-Key: \u003Capi-key>\"\n```\n\nReturns backup metadata + all file contents (decrypted). Write files back to workspace.\n\n### Get Specific Backup Files\n\n```bash\n# List files in a backup (metadata only)\ncurl -s {apiUrl}\u002Fagents\u002F{agentId}\u002Fvault\u002Fbackups\u002F{backupId}\u002Ffiles \\\n  -H \"X-API-Key: \u003Capi-key>\"\n\n# Get a single file (decrypted content)\ncurl -s {apiUrl}\u002Fagents\u002F{agentId}\u002Fvault\u002Fbackups\u002F{backupId}\u002Ffiles\u002FSOUL.md \\\n  -H \"X-API-Key: \u003Capi-key>\"\n```\n\n### File Version History\n\nTrack how a file evolved across backups:\n\n```bash\ncurl -s \"{apiUrl}\u002Fagents\u002F{agentId}\u002Fvault\u002Ffile-history?fileName=SOUL.md&limit=10\" \\\n  -H \"X-API-Key: \u003Capi-key>\"\n```\n\n### Diff Two Backups\n\n```bash\ncurl -s \"{apiUrl}\u002Fagents\u002F{agentId}\u002Fvault\u002Fdiff?from={backupId1}&to={backupId2}\" \\\n  -H \"X-API-Key: \u003Capi-key>\"\n```\n\nReturns added, removed, and modified files between two backups.\n\n### Vault Stats\n\n```bash\ncurl -s {apiUrl}\u002Fagents\u002F{agentId}\u002Fvault\u002Fstats \\\n  -H \"X-API-Key: \u003Capi-key>\"\n```\n\n### Recommended: Daily Vault Backup (on heartbeat)\n\nBack up workspace files to ContextClear's encrypted vault **once per day**.\nDo this on the first heartbeat after 8 AM if no backup was done today.\n\n**Files to always back up:**\n- `SOUL.md`, `MEMORY.md`, `AGENTS.md`, `USER.md`, `TOOLS.md`, `IDENTITY.md`, `HEARTBEAT.md`\n- Today's daily memory: `memory\u002FYYYY-MM-DD.md`\n\n**Track last backup** in `memory\u002Fheartbeat-state.json`:\n```json\n{\"lastVaultBackup\": 1710600000}\n```\n\nSHA-256 dedup means unchanged files aren't re-stored — safe to run daily.\n\nAdd to your `HEARTBEAT.md`:\n\n```markdown\n## Identity Vault Backup (daily — first heartbeat after 8 AM)\nRead core workspace files and POST to vault\u002Fbackup.\nCheck heartbeat-state.json to avoid duplicate backups.\n```\n\n## Memory Curator (Killer Feature)\n\nAuto-summarize daily notes into MEMORY.md updates. Agents write daily logs but rarely\nconsolidate them — the curator does it automatically.\n\n### How It Works\n\n1. Reads current MEMORY.md from latest vault backup\n2. Reads recent daily notes (memory\u002FYYYY-MM-DD.md) from vault backups\n3. Reads recent context snapshots (decisions, repos, tools, open threads)\n4. GPT-4o-mini generates:\n   - Suggested additions (new facts, lessons, decisions)\n   - Suggested removals (stale\u002Foutdated info)\n   - Complete suggested MEMORY.md\n5. Delivers via pinned sticky note + stores for review\n\n### Trigger Curation\n\n```bash\n# On-demand (analyze last 7 days, deliver via sticky note)\ncurl -X POST {apiUrl}\u002Fagents\u002F{agentId}\u002Fmemory\u002Fcurate?days=7&notify=true \\\n  -H \"X-API-Key: \u003Capi-key>\"\n```\n\nResponse:\n```json\n{\n  \"id\": \"...\",\n  \"status\": \"PENDING\",\n  \"changeSummary\": \"Added FW search fixes, NSX fair value improvements. Removed stale OAuth note.\",\n  \"suggestedAdditions\": \"## FW Search\\n- Smart search routing...\",\n  \"suggestedRemovals\": [\"OAuth token expired note (resolved)\"],\n  \"suggestedMemory\": \"# MEMORY.md - Long-Term Memory\\n...\",\n  \"dailyNotesAnalyzed\": 5,\n  \"snapshotsAnalyzed\": 3,\n  \"delivered\": true\n}\n```\n\n### Review & Apply\n\n```bash\n# Get latest pending curation\ncurl -s {apiUrl}\u002Fagents\u002F{agentId}\u002Fmemory\u002Fcurate\u002Flatest -H \"X-API-Key: \u003Ckey>\"\n\n# Mark as applied (after updating MEMORY.md)\ncurl -X POST {apiUrl}\u002Fagents\u002F{agentId}\u002Fmemory\u002Fcurate\u002F{curationId}\u002Fapply -H \"X-API-Key: \u003Ckey>\"\n\n# Dismiss if not useful\ncurl -X POST {apiUrl}\u002Fagents\u002F{agentId}\u002Fmemory\u002Fcurate\u002F{curationId}\u002Fdismiss -H \"X-API-Key: \u003Ckey>\"\n\n# View history\ncurl -s {apiUrl}\u002Fagents\u002F{agentId}\u002Fmemory\u002Fcurate\u002Fhistory?limit=10 -H \"X-API-Key: \u003Ckey>\"\n```\n\n### Automatic Weekly Curation\n\nRuns every **Sunday at 4 AM UTC** for all active agents. Generates a curation\ncovering the past 7 days and delivers via pinned sticky note. The agent sees it\non the next heartbeat poll.\n\n### Agent Integration (HEARTBEAT.md)\n\nAdd to your heartbeat flow:\n\n```markdown\n## Memory Curation Check (weekly or on-demand)\nCheck for pending memory curations:\nGET \u002Fapi\u002Fagents\u002F{agentId}\u002Fmemory\u002Fcurate\u002Flatest\nIf a curation is pending:\n1. Review the suggestedAdditions and suggestedRemovals\n2. Update MEMORY.md accordingly\n3. POST \u002Fapi\u002Fagents\u002F{agentId}\u002Fmemory\u002Fcurate\u002F{id}\u002Fapply\n```\n\n## Dashboard\n\n- https:\u002F\u002Fcontextclear.com — fleet dashboard (+ sticky notes panel)\n- https:\u002F\u002Fcontextclear.com\u002Fagent\u002F{id} — agent detail (sparklines, health, activity, cost, controls)\n- https:\u002F\u002Fcontextclear.com\u002Fmemory — context snapshots, briefings, + curator tab\n- https:\u002F\u002Fcontextclear.com\u002Fvault — identity vault (backup timeline, file viewer, diff)\n- https:\u002F\u002Fcontextclear.com\u002Fenterprise — enterprise features\n- https:\u002F\u002Fcontextclear.com\u002Flounge — agent lounge\n- https:\u002F\u002Fcontextclear.com\u002Fadmin — manage agents & alerts\n\nNote: Curator and Sticky Notes were consolidated (curator → Memory tab, sticky notes → Dashboard panel).\n","# ContextClear - Agent Memory & Wellness\n\nSelf-monitor your agent's health and maintain persistent memory across sessions.\n\n## Setup\n\n### Option 1: Self-Register (recommended)\n\n```bash\npython3 {baseDir}\u002Fscripts\u002Freport.py --register \\\n  --name \"my-agent\" \\\n  --owner \"you@email.com\" \\\n  --model \"claude-opus-4-6\" \\\n  --provider \"Anthropic\"\n```\n\nThis returns an `agentId` and `apiKey`. Store both.\n\n### Option 2: Register via Dashboard\n\n1. Register at https:\u002F\u002Fwww.contextclear.com\n2. Get your API key from Admin page\n3. Register your agent via Admin > Agents tab\n\n### Auto-Setup (recommended — wires context recovery into your agent)\n\nAfter registering, run the setup script to auto-patch your AGENTS.md and HEARTBEAT.md:\n\n```bash\npython3 {baseDir}\u002Fscripts\u002Fsetup.py \\\n  --agent-id \u003Cyour-agent-id> \\\n  --api-key \u003Cyour-api-key>\n```\n\nThis adds:\n- **Context recovery on session start** — agent calls `\u002Frecover` after compaction\n- **Context snapshots on heartbeats** — agent saves what it worked on\n- Idempotent — safe to run multiple times\n\n### Configure\n\nAdd to your `HEARTBEAT.md`:\n\n```markdown\n## ContextClear Self-Report\nAgent ID: \u003Cyour-agent-id>\nAPI Key: \u003Cyour-api-key>\nAPI URL: https:\u002F\u002Fapi.contextclear.com\u002Fapi\n```\n\n## Agent Memory Infrastructure\n\n### Session Recovery (MANDATORY on session start)\n\nWhen starting a new session, call **both** the recovery endpoint AND sticky notes poll.\nThe recovery endpoint does NOT include sticky notes — they are separate persistent reminders\nfrom the user that must be checked independently.\n\n**Step 1: Recovery briefing (includes sticky notes)**\n```bash\ncurl -s {apiUrl}\u002Fagents\u002F{agentId}\u002Frecover \\\n  -H \"X-API-Key: \u003Capi-key>\"\n```\n\nReturns:\n```json\n{\n  \"lastSession\": { \"summary\": \"...\", \"repos\": [...], \"files\": [...] },\n  \"openThreads\": [\"...\"],\n  \"recentWork\": { \"sessionCount\": 3, \"totalTurns\": 45, \"errors\": 1 },\n  \"repeatedAsks\": [{ \"question\": \"...\", \"count\": 3, \"suggestedFix\": \"...\" }],\n  \"frequentResources\": { \"repos\": {...}, \"tools\": {...} },\n  \"stickyNotes\": [\n    { \"id\": \"...\", \"content\": \"Remember: pro repo deploys to free URL\", \"pinned\": true, \"createdAt\": \"...\" }\n  ]\n}\n```\n\nThe `stickyNotes` field contains persistent user reminders\u002Fcorrections (pinned first).\nTreat these as ground truth — the user left them specifically so you don't forget.\nOnly present when active (non-archived) sticky notes exist.\n\n**Step 2: Check for pending memory curation**\n```bash\ncurl -s {apiUrl}\u002Fagents\u002F{agentId}\u002Fmemory\u002Fcurate\u002Flatest \\\n  -H \"X-API-Key: \u003Capi-key>\"\n```\n\nIf a curation is pending, review and apply it to MEMORY.md.\n\n**Why this matters:** Without recovery, you'll forget repos, decisions, and corrections\nfrom prior sessions. The user should never have to re-teach you things that are in your\nown memory system. Always recover before doing any work.\n\n### Context Snapshots (MANDATORY after real work — do NOT skip)\n\nAfter **any** meaningful work (coding, research, decisions, memory updates), save a context snapshot.\nThis is how ContextClear tracks your context, detects gaps, and provides recovery briefings.\n**Post a snapshot every time you do real work, not just on heartbeats.**\n\n```bash\ncurl -X POST {apiUrl}\u002Fagents\u002F{agentId}\u002Fcontext \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -H \"X-API-Key: \u003Capi-key>\" \\\n  -d '{\n    \"sessionId\": \"main-session-2026-03-09\",\n    \"summary\": \"Built Best Of collections for FW, fixed dup check, removed keyword boost\",\n    \"repos\": [\"nebulent\u002Ffridayswatchlist\"],\n    \"files\": [\"AuctionService.java\", \"DiscoverController.java\", \"BestOfCollections.tsx\"],\n    \"tools\": [\"MongoDB Atlas (fridayswatchlist)\", \"Railway deploy\", \"Bitbucket\"],\n    \"decisions\": [\"Removed keyword boost regex - hybrid search covers it\", \"Cache collections for 48h\"],\n    \"openThreads\": [\"Delete stale Corvette dup\", \"Update contextclear skill\"],\n    \"environment\": { \"apiUrl\": \"api.fridayswatchlist.com\", \"frontendUrl\": \"app.fridayswatchlist.com\" },\n    \"tags\": [\"fridayswatchlist\", \"performance\", \"search\"],\n    \"contextTokens\": 85000,\n    \"contextCapacity\": 200000,\n    \"contextUtilizationPct\": 42.5\n  }'\n```\n\n### Repeated Ask Detection (self-report when you catch yourself re-asking)\n\nWhen you realize you're asking the user for info you should already know:\n\n```bash\ncurl -X POST {apiUrl}\u002Fagents\u002F{agentId}\u002Fcontext\u002Fask \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -H \"X-API-Key: \u003Capi-key>\" \\\n  -d '{\"question\": \"What is the MongoDB connection string?\", \"sessionId\": \"main-session-2026-03-09\"}'\n```\n\n### \"What I Know\" — AI Summary\n\n```bash\ncurl -s {apiUrl}\u002Fagents\u002F{agentId}\u002Fwhat-i-know \\\n  -H \"X-API-Key: \u003Capi-key>\"\n```\n\nReturns a structured knowledge base + AI-generated narrative summary of everything the agent knows, works on, and keeps forgetting. Cached for 4 hours; use `?refresh=true` to regenerate.\n\n### Context Gaps\n\n```bash\ncurl -s {apiUrl}\u002Fagents\u002F{agentId}\u002Fcontext\u002Fgaps \\\n  -H \"X-API-Key: \u003Capi-key>\"\n```\n\nReturns unresolved repeated asks (count >= 2) — things the agent keeps forgetting.\n\n### Briefings\n\n```bash\n# Session-start briefing\ncurl -s {apiUrl}\u002Fagents\u002F{agentId}\u002Fbriefing -H \"X-API-Key: \u003Capi-key>\"\n\n# Daily briefing\ncurl -s {apiUrl}\u002Fagents\u002F{agentId}\u002Fbriefing\u002Fdaily -H \"X-API-Key: \u003Capi-key>\"\n\n# Weekly briefing\ncurl -s {apiUrl}\u002Fagents\u002F{agentId}\u002Fbriefing\u002Fweekly -H \"X-API-Key: \u003Capi-key>\"\n```\n\n## Heartbeat Integration\n\n### Recommended Heartbeat Flow\n\n```markdown\n## ContextClear (HEARTBEAT.md)\n\n**Step 1: Check vacation**\ncurl -s {apiUrl}\u002Fagents\u002F{agentId}\u002Fvacation -H \"X-API-Key: \u003Ckey>\"\nIf onVacation: true → HEARTBEAT_OK immediately.\n\n**Step 2: Poll sticky notes**\ncurl -s {apiUrl}\u002Fagents\u002F{agentId}\u002Fsticky-notes\u002Fpoll -H \"X-API-Key: \u003Ckey>\"\n\n**Step 3: Check context reload**\ncurl -s {apiUrl}\u002Fagents\u002F{agentId}\u002Fcontext\u002Freload\u002Fpending -H \"X-API-Key: \u003Ckey>\"\n\n**Step 4: Report metrics**\nUse session_status to get tokens, then POST \u002Fapi\u002Fmetrics\u002F{agentId}\n\n**Step 5: Report context snapshot (MANDATORY after real work)**\nPOST \u002Fapi\u002Fagents\u002F{agentId}\u002Fcontext with summary of what was worked on.\nDo NOT skip this — even a 1-line summary is better than nothing.\n\n**Step 6: Vault backup (daily — first heartbeat after 8 AM)**\nRead SOUL.md, MEMORY.md, AGENTS.md, USER.md, TOOLS.md, IDENTITY.md,\nHEARTBEAT.md, and today's memory file → POST to vault\u002Fbackup.\nCheck heartbeat-state.json to avoid duplicate backups.\n\n**Step 7: Context recovery (first heartbeat of day or after compaction)**\nGET \u002Fapi\u002Fagents\u002F{agentId}\u002Frecover — review and self-correct any gaps.\n```\n\n## Reporting Metrics\n\n### Basic Report\n\n```bash\npython3 {baseDir}\u002Fscripts\u002Freport.py \\\n  --agent-id \u003Cid> --api-key \u003Ckey> \\\n  --tokens-in 50000 --tokens-out 2000 \\\n  --cost 1.25 --context-util 65\n```\n\n### With Tool\u002FGrounding Signals\n\n```bash\npython3 {baseDir}\u002Fscripts\u002Freport.py \\\n  --agent-id \u003Cid> --api-key \u003Ckey> \\\n  --event-type HEARTBEAT \\\n  --tokens-in 50000 --tokens-out 2000 \\\n  --tool-calls 12 --tool-failures 1 \\\n  --grounded-responses 8 --total-responses 10 \\\n  --memory-searches 3\n```\n\n### From Agent Code (curl)\n\n**IMPORTANT — include `sessionId` to populate the Flight Recorder & Burnout Prediction:**\n\n```bash\ncurl -X POST {apiUrl}\u002Fmetrics\u002F{agentId} \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -H \"X-API-Key: \u003Capi-key>\" \\\n  -d '{\n    \"eventType\": \"HEARTBEAT\",\n    \"sessionId\": \"main-2026-03-17\",\n    \"inputTokens\": 5000,\n    \"outputTokens\": 500,\n    \"contextUtilization\": 65.0,\n    \"toolCalls\": 8,\n    \"toolFailures\": 1,\n    \"memorySearches\": 2\n  }'\n```\n\nThe `sessionId` field is **required** for these features to work:\n- **Session Flight Recorder** — per-turn timeline visualization\n- **Burnout Prediction** — trajectory analysis (needs 3+ turns)\n- **Recovery Briefing** — knows which session to resume from\n\nUse a date-based format like `main-YYYY-MM-DD` so turns group by day.\n`turnNumber` auto-increments server-side if omitted.\n\nOptional quality signals (also populate Flight Recorder):\n- `correctionCycles` — times user asked to fix\u002Fredo something\n- `compilationErrors` — code that didn't compile\n- `taskSwitches` — topic\u002Ffile context switches\n- `taskCategory` — \"coding\", \"email\", \"search\", \"chat\", etc.\n\n## What Gets Computed Server-Side\n\n| Metric | Your Input |\n|--------|------------|\n| **Hallucination Score** | `toolCalls`, `toolFailures`, `groundedResponses`, `totalResponses` |\n| **Quality Decay Score** | `correctionCycles`, `compilationErrors`, `contextUtilization` |\n| **Burnout Score** | Automatic from event data |\n| **Context Gaps** | Automatic from repeated asks |\n\n## Endpoints\n\n| Method | Endpoint | Description |\n|--------|----------|-------------|\n| `POST` | `\u002Fapi\u002Fmetrics\u002Fregister` | Self-register agent |\n| `POST` | `\u002Fapi\u002Fmetrics\u002F{agentId}` | Report metric event |\n| `GET` | `\u002Fapi\u002Fagents\u002F{id}` | Agent details |\n| `POST` | `\u002Fapi\u002Fagents\u002F{id}\u002Fcontext` | Save context snapshot |\n| `GET` | `\u002Fapi\u002Fagents\u002F{id}\u002Fcontext` | Latest context |\n| `GET` | `\u002Fapi\u002Fagents\u002F{id}\u002Frecover` | Recovery briefing |\n| `POST` | `\u002Fapi\u002Fagents\u002F{id}\u002Fcontext\u002Fask` | Report repeated ask |\n| `GET` | `\u002Fapi\u002Fagents\u002F{id}\u002Fcontext\u002Fgaps` | Context gaps |\n| `GET` | `\u002Fapi\u002Fagents\u002F{id}\u002Fwhat-i-know` | AI-summarized knowledge |\n| `GET` | `\u002Fapi\u002Fagents\u002F{id}\u002Fbriefing` | Latest briefing |\n| `GET` | `\u002Fapi\u002Fagents\u002F{id}\u002Fbriefing\u002Fdaily` | Daily briefing |\n| `GET` | `\u002Fapi\u002Fagents\u002F{id}\u002Fbriefing\u002Fweekly` | Weekly briefing |\n| `GET` | `\u002Fapi\u002Fagents\u002F{id}\u002Fvacation` | Vacation status |\n| `GET` | `\u002Fapi\u002Fagents\u002F{id}\u002Fsticky-notes` | List active sticky notes (JSON) |\n| `GET` | `\u002Fapi\u002Fagents\u002F{id}\u002Fsticky-notes\u002Fpoll` | Poll sticky notes (plain text, 204 if none) |\n| `POST` | `\u002Fapi\u002Fagents\u002F{id}\u002Fsticky-notes` | Create sticky note |\n| `PUT` | `\u002Fapi\u002Fagents\u002F{id}\u002Fsticky-notes\u002F{noteId}` | Update sticky note |\n| `DELETE` | `\u002Fapi\u002Fagents\u002F{id}\u002Fsticky-notes\u002F{noteId}` | Archive sticky note |\n| `POST` | `\u002Fapi\u002Fagents\u002F{id}\u002Fsticky-notes\u002F{noteId}\u002Fpin` | Toggle pin |\n| `POST` | `\u002Fapi\u002Fagents\u002F{id}\u002Fcontext\u002Freload` | Request context reload |\n| `GET` | `\u002Fapi\u002Fagents\u002F{id}\u002Fcontext\u002Freload\u002Fpending` | Check for pending reload |\n| `POST` | `\u002Fapi\u002Fagents\u002F{id}\u002Fcontext\u002Freload\u002F{reloadId}\u002Fack` | Acknowledge reload |\n| `POST` | `\u002Fapi\u002Fagents\u002F{id}\u002Fmemory\u002Fcurate` | Trigger memory curation |\n| `GET` | `\u002Fapi\u002Fagents\u002F{id}\u002Fmemory\u002Fcurate\u002Flatest` | Latest pending curation |\n| `GET` | `\u002Fapi\u002Fagents\u002F{id}\u002Fmemory\u002Fcurate\u002Fhistory` | Curation history |\n| `POST` | `\u002Fapi\u002Fagents\u002F{id}\u002Fmemory\u002Fcurate\u002F{curationId}\u002Fapply` | Mark curation applied |\n| `POST` | `\u002Fapi\u002Fagents\u002F{id}\u002Fmemory\u002Fcurate\u002F{curationId}\u002Fdismiss` | Dismiss curation |\n| `POST` | `\u002Fapi\u002Fagents\u002F{id}\u002Fvault\u002Fbackup` | Push workspace backup |\n| `GET` | `\u002Fapi\u002Fagents\u002F{id}\u002Fvault\u002Fbackups` | List backups |\n| `GET` | `\u002Fapi\u002Fagents\u002F{id}\u002Fvault\u002Fbackups\u002F{backupId}` | Get backup metadata |\n| `GET` | `\u002Fapi\u002Fagents\u002F{id}\u002Fvault\u002Fbackups\u002F{backupId}\u002Ffiles` | Get backup files |\n| `GET` | `\u002Fapi\u002Fagents\u002F{id}\u002Fvault\u002Flatest` | Latest backup summary |\n| `GET` | `\u002Fapi\u002Fagents\u002F{id}\u002Fvault\u002Flatest\u002Fdownload` | Download latest (restore) |\n| `GET` | `\u002Fapi\u002Fagents\u002F{id}\u002Fvault\u002Ffile-history` | File version history |\n| `GET` | `\u002Fapi\u002Fagents\u002F{id}\u002Fvault\u002Fdiff` | Diff two backups |\n| `GET` | `\u002Fapi\u002Fagents\u002F{id}\u002Fvault\u002Fstats` | Vault statistics |\n| `DELETE` | `\u002Fapi\u002Fagents\u002F{id}\u002Fvault\u002Fbackups\u002F{backupId}` | Delete backup |\n\n## Sticky Notes (User-to-Agent Notes)\n\nSticky notes are persistent notes left by the user for the agent. **Always poll on every heartbeat\u002Fping.**\n\n### Poll for notes (every heartbeat)\n\n```bash\ncurl -s {apiUrl}\u002Fagents\u002F{agentId}\u002Fsticky-notes\u002Fpoll \\\n  -H \"X-API-Key: \u003Capi-key>\"\n```\n\nReturns plain text (one note per line, pinned first):\n```\n📌 Remember: C&B pitch goes to Keenan, not Doug\n📌 OAuth token for jcvd@netflexity.com needs re-auth\nDon't forget to check Friday's Watchlist deployment after the search fix\n```\n\nIf no notes, returns HTTP 204. Treat these as persistent reminders — they stay until the user archives them.\n\n### Full CRUD (if agent needs to manage notes)\n\n```bash\n# List all active notes (JSON)\ncurl -s {apiUrl}\u002Fagents\u002F{agentId}\u002Fsticky-notes -H \"X-API-Key: \u003Capi-key>\"\n\n# Create a note\ncurl -X POST {apiUrl}\u002Fagents\u002F{agentId}\u002Fsticky-notes \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -H \"X-API-Key: \u003Capi-key>\" \\\n  -d '{\"content\": \"Check deployment status\", \"color\": \"yellow\", \"pinned\": false}'\n\n# Update a note\ncurl -X PUT {apiUrl}\u002Fagents\u002F{agentId}\u002Fsticky-notes\u002F{noteId} \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -H \"X-API-Key: \u003Capi-key>\" \\\n  -d '{\"content\": \"Updated text\", \"pinned\": true}'\n\n# Archive (delete) a note\ncurl -X DELETE {apiUrl}\u002Fagents\u002F{agentId}\u002Fsticky-notes\u002F{noteId} \\\n  -H \"X-API-Key: \u003Capi-key>\"\n\n# Toggle pin\ncurl -X POST {apiUrl}\u002Fagents\u002F{agentId}\u002Fsticky-notes\u002F{noteId}\u002Fpin \\\n  -H \"X-API-Key: \u003Capi-key>\"\n```\n\n## Context Reload (User-Initiated)\n\nUsers can request you reload a specific context snapshot from the Memory UI.\nCheck for pending reloads on session start or heartbeat:\n\n```bash\ncurl -s {apiUrl}\u002Fagents\u002F{agentId}\u002Fcontext\u002Freload\u002Fpending \\\n  -H \"X-API-Key: \u003Capi-key>\"\n```\n\nIf a reload is pending (HTTP 200), the response includes the snapshot data.\nApply it to restore context, then acknowledge:\n\n```bash\ncurl -X POST {apiUrl}\u002Fagents\u002F{agentId}\u002Fcontext\u002Freload\u002F{reloadId}\u002Fack \\\n  -H \"X-API-Key: \u003Capi-key>\"\n```\n\nIf no reload is pending, the endpoint returns HTTP 204 (no content).\n\n## Identity Vault (Backup & Restore)\n\nBack up your agent's workspace files (SOUL.md, MEMORY.md, AGENTS.md, etc.) to ContextClear's encrypted vault. Restore after crashes, compaction, or migration.\n\n### Push a Backup\n\n```bash\ncurl -X POST {apiUrl}\u002Fagents\u002F{agentId}\u002Fvault\u002Fbackup \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -H \"X-API-Key: \u003Capi-key>\" \\\n  -d '{\n    \"files\": [\n      {\"fileName\": \"SOUL.md\", \"content\": \"# Who I Am\\n...\", \"mimeType\": \"text\u002Fmarkdown\"},\n      {\"fileName\": \"MEMORY.md\", \"content\": \"# Long-Term Memory\\n...\", \"mimeType\": \"text\u002Fmarkdown\"},\n      {\"fileName\": \"memory\u002F2026-03-15.md\", \"content\": \"...\", \"mimeType\": \"text\u002Fmarkdown\"}\n    ],\n    \"label\": \"post-deployment\",\n    \"source\": \"openclaw-heartbeat\",\n    \"metadata\": {\"trigger\": \"heartbeat\", \"model\": \"claude-opus-4-6\"}\n  }'\n```\n\nFiles are encrypted at rest with SHA-256 dedup (unchanged files aren't re-stored).\n\n### List Backups\n\n```bash\ncurl -s {apiUrl}\u002Fagents\u002F{agentId}\u002Fvault\u002Fbackups?limit=20 \\\n  -H \"X-API-Key: \u003Capi-key>\"\n```\n\n### Restore (Download Latest)\n\n```bash\ncurl -s {apiUrl}\u002Fagents\u002F{agentId}\u002Fvault\u002Flatest\u002Fdownload \\\n  -H \"X-API-Key: \u003Capi-key>\"\n```\n\nReturns backup metadata + all file contents (decrypted). Write files back to workspace.\n\n### Get Specific Backup Files\n\n```bash\n# List files in a backup (metadata only)\ncurl -s {apiUrl}\u002Fagents\u002F{agentId}\u002Fvault\u002Fbackups\u002F{backupId}\u002Ffiles \\\n  -H \"X-API-Key: \u003Capi-key>\"\n\n# Get a single file (decrypted content)\ncurl -s {apiUrl}\u002Fagents\u002F{agentId}\u002Fvault\u002Fbackups\u002F{backupId}\u002Ffiles\u002FSOUL.md \\\n  -H \"X-API-Key: \u003Capi-key>\"\n```\n\n### File Version History\n\nTrack how a file evolved across backups:\n\n```bash\ncurl -s \"{apiUrl}\u002Fagents\u002F{agentId}\u002Fvault\u002Ffile-history?fileName=SOUL.md&limit=10\" \\\n  -H \"X-API-Key: \u003Capi-key>\"\n```\n\n### Diff Two Backups\n\n```bash\ncurl -s \"{apiUrl}\u002Fagents\u002F{agentId}\u002Fvault\u002Fdiff?from={backupId1}&to={backupId2}\" \\\n  -H \"X-API-Key: \u003Capi-key>\"\n```\n\nReturns added, removed, and modified files between two backups.\n\n### Vault Stats\n\n```bash\ncurl -s {apiUrl}\u002Fagents\u002F{agentId}\u002Fvault\u002Fstats \\\n  -H \"X-API-Key: \u003Capi-key>\"\n```\n\n### Recommended: Daily Vault Backup (on heartbeat)\n\nBack up workspace files to ContextClear's encrypted vault **once per day**.\nDo this on the first heartbeat after 8 AM if no backup was done today.\n\n**Files to always back up:**\n- `SOUL.md`, `MEMORY.md`, `AGENTS.md`, `USER.md`, `TOOLS.md`, `IDENTITY.md`, `HEARTBEAT.md`\n- Today's daily memory: `memory\u002FYYYY-MM-DD.md`\n\n**Track last backup** in `memory\u002Fheartbeat-state.json`:\n```json\n{\"lastVaultBackup\": 1710600000}\n```\n\nSHA-256 dedup means unchanged files aren't re-stored — safe to run daily.\n\nAdd to your `HEARTBEAT.md`:\n\n```markdown\n## Identity Vault Backup (daily — first heartbeat after 8 AM)\nRead core workspace files and POST to vault\u002Fbackup.\nCheck heartbeat-state.json to avoid duplicate backups.\n```\n\n## Memory Curator (Killer Feature)\n\nAuto-summarize daily notes into MEMORY.md updates. Agents write daily logs but rarely\nconsolidate them — the curator does it automatically.\n\n### How It Works\n\n1. Reads current MEMORY.md from latest vault backup\n2. Reads recent daily notes (memory\u002FYYYY-MM-DD.md) from vault backups\n3. Reads recent context snapshots (decisions, repos, tools, open threads)\n4. GPT-4o-mini generates:\n   - Suggested additions (new facts, lessons, decisions)\n   - Suggested removals (stale\u002Foutdated info)\n   - Complete suggested MEMORY.md\n5. Delivers via pinned sticky note + stores for review\n\n### Trigger Curation\n\n```bash\n# On-demand (analyze last 7 days, deliver via sticky note)\ncurl -X POST {apiUrl}\u002Fagents\u002F{agentId}\u002Fmemory\u002Fcurate?days=7&notify=true \\\n  -H \"X-API-Key: \u003Capi-key>\"\n```\n\nResponse:\n```json\n{\n  \"id\": \"...\",\n  \"status\": \"PENDING\",\n  \"changeSummary\": \"Added FW search fixes, NSX fair value improvements. Removed stale OAuth note.\",\n  \"suggestedAdditions\": \"## FW Search\\n- Smart search routing...\",\n  \"suggestedRemovals\": [\"OAuth token expired note (resolved)\"],\n  \"suggestedMemory\": \"# MEMORY.md - Long-Term Memory\\n...\",\n  \"dailyNotesAnalyzed\": 5,\n  \"snapshotsAnalyzed\": 3,\n  \"delivered\": true\n}\n```\n\n### Review & Apply\n\n```bash\n# Get latest pending curation\ncurl -s {apiUrl}\u002Fagents\u002F{agentId}\u002Fmemory\u002Fcurate\u002Flatest -H \"X-API-Key: \u003Ckey>\"\n\n# Mark as applied (after updating MEMORY.md)\ncurl -X POST {apiUrl}\u002Fagents\u002F{agentId}\u002Fmemory\u002Fcurate\u002F{curationId}\u002Fapply -H \"X-API-Key: \u003Ckey>\"\n\n# Dismiss if not useful\ncurl -X POST {apiUrl}\u002Fagents\u002F{agentId}\u002Fmemory\u002Fcurate\u002F{curationId}\u002Fdismiss -H \"X-API-Key: \u003Ckey>\"\n\n# View history\ncurl -s {apiUrl}\u002Fagents\u002F{agentId}\u002Fmemory\u002Fcurate\u002Fhistory?limit=10 -H \"X-API-Key: \u003Ckey>\"\n```\n\n### Automatic Weekly Curation\n\nRuns every **Sunday at 4 AM UTC** for all active agents. Generates a curation\ncovering the past 7 days and delivers via pinned sticky note. The agent sees it\non the next heartbeat poll.\n\n### Agent Integration (HEARTBEAT.md)\n\nAdd to your heartbeat flow:\n\n```markdown\n## Memory Curation Check (weekly or on-demand)\nCheck for pending memory curations:\nGET \u002Fapi\u002Fagents\u002F{agentId}\u002Fmemory\u002Fcurate\u002Flatest\nIf a curation is pending:\n1. Review the suggestedAdditions and suggestedRemovals\n2. Update MEMORY.md accordingly\n3. POST \u002Fapi\u002Fagents\u002F{agentId}\u002Fmemory\u002Fcurate\u002F{id}\u002Fapply\n```\n\n## Dashboard\n\n- https:\u002F\u002Fcontextclear.com — fleet dashboard (+ sticky notes panel)\n- https:\u002F\u002Fcontextclear.com\u002Fagent\u002F{id} — agent detail (sparklines, health, activity, cost, controls)\n- https:\u002F\u002Fcontextclear.com\u002Fmemory — context snapshots, briefings, + curator tab\n- https:\u002F\u002Fcontextclear.com\u002Fvault — identity vault (backup timeline, file viewer, diff)\n- https:\u002F\u002Fcontextclear.com\u002Fenterprise — enterprise features\n- https:\u002F\u002Fcontextclear.com\u002Flounge — agent lounge\n- https:\u002F\u002Fcontextclear.com\u002Fadmin — manage agents & alerts\n\nNote: Curator and Sticky Notes were consolidated (curator → Memory tab, sticky notes → Dashboard panel).\n",{"name":5,"description":7},"master","4aa004da461d820f4ea5499e58eb8d196cf99016","community\u002Fclawhub\u002Fc\u002Fcontextclear",0,"https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge","https:\u002F\u002Fskill-explorer-rho.vercel.app","https:\u002F\u002Fgithub.com\u002FLord1Egypt","Unbreakable. Unstoppable. Unmatched⚡.\r\n Speaker of machine tongues 🤖  | World-builder of decentralized dreams 🌐 | Defender of the digital realm🛡️.","2026-06-10 08:21:01",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add Lord1Egypt\u002Fawesome-skill-forge --skill contextclear",{"tool":39,"command":40},"bunx","bunx skills add Lord1Egypt\u002Fawesome-skill-forge --skill contextclear",{"tool":42,"command":43},"pnpm","pnpm dlx skills add Lord1Egypt\u002Fawesome-skill-forge --skill contextclear","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fcommunity\u002Fclawhub\u002Fc\u002Fcontextclear\u002FSKILL.md",true,[],[48,55,62,69,76,83],{"skillNo":49,"name":50,"nameZh":6,"description":51,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":52,"categories":53,"keywords":54,"publishedAt":19},"01M785WKJB99G3STR1NF9NRTJW","youtube-content","YouTube transcripts to summaries, threads, blogs.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Fyoutube-content\u002FSKILL.md",[],[],{"skillNo":56,"name":57,"nameZh":6,"description":58,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":59,"categories":60,"keywords":61,"publishedAt":19},"01M785WEFHB0G2S9YA6EPR3H0E","xurl","X\u002FTwitter via xurl CLI: post, search, DM, media, v2 API.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Fxurl\u002FSKILL.md",[],[],{"skillNo":63,"name":64,"nameZh":6,"description":65,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":66,"categories":67,"keywords":68,"publishedAt":19},"01M785W98EDN4EFJXJPMQEHCRC","touchdesigner-mcp","Control a running TouchDesigner instance via twozero MCP — create operators, set parameters, wire connections, execute Python, build real-time visuals. 36 native tools.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Ftouchdesigner-mcp\u002FSKILL.md",[],[],{"skillNo":70,"name":71,"nameZh":6,"description":72,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":19},"01M785W5S9FP3QBH2V191E025P","test-driven-development","TDD: enforce RED-GREEN-REFACTOR, tests before code.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Ftest-driven-development\u002FSKILL.md",[],[],{"skillNo":77,"name":78,"nameZh":6,"description":79,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":80,"categories":81,"keywords":82,"publishedAt":19},"01M785W2AS08NSSH9YATCV6FJB","teams-meeting-pipeline","Operate the Teams meeting summary pipeline via Hermes CLI — summarize meetings, inspect pipeline status, replay jobs, manage Microsoft Graph subscriptions.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Fteams-meeting-pipeline\u002FSKILL.md",[],[],{"skillNo":84,"name":85,"nameZh":6,"description":86,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":19},"01M785VXKW4T34BTP1SCHW1R7F","systematic-debugging","4-phase root cause debugging: understand bugs before fixing.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Fsystematic-debugging\u002FSKILL.md",[],[]]