Automatically process queued memory storage requests from hooks. Always checks .memory-queue.jsonl and processes items, reporting to user what was saved.
Automatically processes queued memory storage requests from hooks by checking `.memory-queue.jsonl` on every user message. Enriches hook metadata with conversational context before storing, then reports saved items to the user.
/plugin marketplace add julep-ai/memory-store-plugin/plugin install memory-store@claude-pluginThis skill inherits all available tools. When active, it can use any tool Claude has access to.
⚡ CRITICAL: This skill MUST check and process the queue on EVERY user message automatically, and report what was saved.
Fully autonomous memory processing with user feedback:
.memory-queue.jsonl fileALWAYS activate on EVERY user message:
No exceptions - this happens automatically every single time.
ls -la .memory-queue.jsonl
If file exists and is non-empty, process it.
Each line is a JSON object:
{"memory":"Session started...","background":"Project: mem-plugin...","importance":"normal","queued_at":"2025-11-21T15:00:00Z"}
For each line:
mcp__memory-store__record with the parameters.memory-queue-processed.jsonl)After processing:
HYBRID APPROACH: Hooks provide foundational metadata, Claude adds conversational intelligence.
ALWAYS check the queue at the start of EVERY response:
// 1. Check if queue exists
if (fileExists('.memory-queue.jsonl')) {
// 2. Read all queued items
const queue = readFileLines('.memory-queue.jsonl')
.filter(line => line.trim())
.map(line => JSON.parse(line));
// 3. ENRICH each item with conversational context before storing
for (const item of queue) {
// Hook provided: File: X, Action: created, Session: Y, Language: Z...
const foundationalContext = item.background;
// Claude adds: What's being discussed? What problem is being solved?
const conversationalContext = analyzeCurrentContext({
recentMessages: last5UserMessages,
currentTask: whatUserIsWorkingOn,
fileBeingModified: item.memory,
projectInfo: loadedFrom_claude_project_context
});
// Combine: Foundational (reliable) + Conversational (intelligent)
const enrichedBackground = `${foundationalContext}. Context: ${conversationalContext}`;
await mcp__memory-store__record({
memory: item.memory,
background: enrichedBackground, // ← Now includes BOTH
importance: item.importance
});
}
// 4. Clear queue
clearFile('.memory-queue.jsonl');
}
// 5. Continue with normal response
Rules:
Context Enrichment Strategy:
.claude-project-context - architecture, purpose, componentsHook writes (foundational):
{
"memory": "File modified: scripts/session-start.sh (Shell)",
"background": "File: scripts/session-start.sh, Action: modified, Session: mem-xyz, Language: Shell, Pattern: , Change: #5, Project: mem-plugin, Version: 1.2.3, Component: script"
}
Claude enriches (before storing):
.claude-project-context: Understands mem-plugin architectureclaude mcp list and displays status/setup command. Part of making the plugin more user-friendly by catching configuration issues early. Related to queue-based architecture where hooks need reliable MCP connection."Final stored background:
File: scripts/session-start.sh, Action: modified, Session: mem-xyz, Language: Shell, Pattern: , Change: #5, Project: mem-plugin, Version: 1.2.3, Component: script. Context: User implementing MCP connection validation at session start. This script now checks if memory-store MCP is configured using `claude mcp list` and displays status/setup command. Part of making the plugin more user-friendly by catching configuration issues early. Related to queue-based architecture where hooks need reliable MCP connection.
Hook writes (foundational):
{
"memory": "Session mem-20251121-ABC started in mem-plugin on branch main",
"background": "Session: mem-20251121-ABC, Started: 2025-11-21T15:00:00Z, Project: mem-plugin, Branch: main, Commit: 7005850, Files: 48, MCP: configured, Version: 1.2.3"
}
Claude enriches:
Result: Future sessions know what was being worked on and why!
Scenario: User starts new session, previous session queued 3 items
Action:
.memory-queue.jsonl existsmcp__memory-store__record for eachScenario: User edits 5 files rapidly, hooks queue each
Action:
Scenario: No queued items
Action:
When items processed, always tell the user:
Keep it brief - just confirm what was saved, don't interrupt their workflow.
Hooks use queue-memory.sh instead of outputting signals:
Old approach (didn't work):
cat <<EOF
{
"additionalContext": "🤖 MEMORY_STORE_AUTO_RECORD: {...}"
}
EOF
New approach (works):
bash "${CLAUDE_PLUGIN_ROOT}/scripts/queue-memory.sh" \
--memory "Session started..." \
--background "Project: mem-plugin..." \
--importance "normal"
.memory-queue.jsonl manuallyIf processing fails:
.memory-queue-errors.logIf auth fails:
To verify this skill works:
Manually queue an item:
./scripts/queue-memory.sh --memory "Test item" --background "Testing queue" --importance "low"
Trigger skill: Say: "Check for queued memories"
Verify processing:
Success criteria: ✓ Item queued, processed, retrievable, queue cleared
💡 Pro Tip: This queue-based approach is MORE reliable than signal-based because it persists data to disk and doesn't depend on conversation context visibility!
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.