stukennedy/openclaw-starter-kit/context-memory
Claude Code and agent skill by stukennedy/openclaw-starter-kit
- community
Checking that the SKILL.md file is still in the repository.
Multi-threaded conversation memory organized by topic instead of by date. Enables seamless context switching, compaction resilience, and sub-agent tracking — all file-based, no code changes to OpenClaw. Use when you want your agent to maintain separate conversation threads per project/topic, survive context compaction without losing the thread, track sub-agent spawns with model/task/duration, and output a structured conversation-map.json for visualization clients.
Install
npx vskill@latest install stukennedy/openclaw-starter-kit/context-memorySKILL.md
Context Memory
Organize conversation memory by topic rather than by date. Each subject gets its own folder with a conversation thread, status summary, and artifacts. A master timeline tracks all context switches, compaction events, and sub-agent spawns.
Setup
Run the bootstrap script to create the directory structure:
Then add the context memory instructions to your AGENTS.md (see below).
Directory Structure
AGENTS.md Instructions
Add this section to your AGENTS.md under Memory:
Context Detection
Every message belongs to a context. Determine which:
- Explicit: "Let's talk about the job search" →
job-search - Implicit: "Any updates from Paradigm?" →
job-search - New topic: create new context folder with
mkdir -p memory/contexts/<name>/artifacts - Ambiguous: ask briefly — "Is this about [X] or something new?"
Context IDs
Every context switch gets a unique ID: ctx-{DD}-{seq} (e.g. ctx-08-001). Sub-agents inherit their parent: ctx-08-001-a1. Sequence resets daily.
On Every Message
- Determine the context (detect or continue current)
- If context changed: read
memory/contexts/<new>/STATUS.md, log switch tomemory/CONTEXT_LOG.md - After responding: append relevant exchange to THREAD.md, update STATUS.md if state changed
- Update
memory/conversation-map.jsonwith any new events
On Session Start / After Compaction
- Read
memory/CONTEXT_LOG.md(last ~30 entries) — understand what's been happening - Read
memory/session-state.mdif exists — compact recovery - Read the STATUS.md of the most recent context — resume where left off
On Spawning Sub-Agents
Log to both CONTEXT_LOG.md and conversation-map.json:
- Agent ID (ctx-XX-NNN-aN), model used, task description, parent context
- On completion: add duration, result summary, artifacts created
On Compaction
- Write
memory/session-state.mdwith current active context name - Ensure current context's THREAD.md and STATUS.md are up to date
- Log
[COMPACTION]to CONTEXT_LOG.md with list of active contexts
Naming Conventions
- Lowercase, hyphenated:
job-search,project-voxbench,htmx-4 - Prefix for clarity:
project-for code,client-for client work,biz-for business - No prefix for general topics
Maintenance (During Heartbeats)
- Contexts untouched >7 days → mark as dormant in conversation-map.json
- THREAD.md >200 lines → archive older entries to THREAD_ARCHIVE.md
- CONTEXT_LOG.md >200 lines → archive to CONTEXT_LOG_ARCHIVE.md
File Formats
CONTEXT_LOG.md
STATUS.md (per context)
THREAD.md (per context)
conversation-map.json
Integration
- Daily logs (memory/YYYY-MM-DD.md): Unchanged — still works for raw chronological record
- MEMORY.md: Unchanged — still for curated long-term facts
- Vector search (memory_search): Automatically indexes new files in memory/contexts/
- ClawClient: Optional visualization app that reads conversation-map.json (github.com/stukennedy/clawclient)
Token Efficiency
- STATUS.md files are <1KB each — cheap to load on context switch
- Only the active context's files are read, not all contexts
- THREAD.md read on-demand, not at startup
- CONTEXT_LOG.md is a lightweight index (~200 lines max)
- No new tools or API calls — just file reads/writes the model already does
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingclawd/skills/context-memory/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/stukennedy/openclaw-starter-kit/context-memory)