Overview
Claude Code has added a Persistent Memory feature for sub-agents (docs).
This issue adds memory field configuration to both Sub Agent nodes and Sub Agent Flow nodes.
Background: Persistent Memory
Adding a memory field to a sub-agent's YAML frontmatter assigns a persistent directory that survives across conversations, allowing the sub-agent to build up knowledge over time.
---
name: code-reviewer
description: Reviews code for quality and best practices
memory: user
---
Memory Scopes
| Scope |
Storage Location |
Use Case |
user |
~/.claude/agent-memory/<name>/ |
Remember learnings across all projects |
project |
.claude/agent-memory/<name>/ |
Project-specific knowledge (VCS-trackable) |
local |
.claude/agent-memory-local/<name>/ |
Project-specific knowledge (not in VCS) |
Behavior When Enabled
- Sub-agent's system prompt includes instructions for reading/writing to the memory directory
- First 200 lines of
MEMORY.md in the memory directory are included in the system prompt
- Read, Write, and Edit tools are automatically enabled
Current State
SubAgentData (current fields)
// src/shared/types/workflow-definition.ts
export interface SubAgentData {
description: string;
prompt: string;
tools?: string;
model?: 'sonnet' | 'opus' | 'haiku' | 'inherit';
color?: 'red' | 'blue' | 'green' | 'yellow' | 'purple' | 'orange' | 'pink' | 'cyan';
outputPorts: number;
}
SubAgentFlowNodeData (current fields)
export interface SubAgentFlowNodeData {
subAgentFlowId: string;
label: string;
description?: string;
outputPorts: 1;
model?: 'sonnet' | 'opus' | 'haiku' | 'inherit';
tools?: string;
color?: keyof typeof SUB_AGENT_COLORS;
}
Neither type includes a memory field.
Implementation Tasks
1. Type Definitions
T1: src/shared/types/workflow-definition.ts
2. Webview UI
T2: src/webview/src/components/PropertyOverlay.tsx - SubAgent section
T3: src/webview/src/components/PropertyOverlay.tsx - SubAgentFlow section
T4: src/webview/src/components/nodes/SubAgentNode.tsx
T5: src/webview/src/components/nodes/SubAgentFlowNode.tsx
3. Schema & Validation
T6: resources/workflow-schema.json
T7: src/extension/utils/validate-workflow.ts
4. i18n
T8: Translation files
5. Testing
Modified Files
| File |
Changes |
src/shared/types/workflow-definition.ts |
Add MemoryScope type, add memory to SubAgentData / SubAgentFlowNodeData |
src/webview/src/components/PropertyOverlay.tsx |
Add Memory dropdown to both SubAgent and SubAgentFlow sections |
src/webview/src/components/nodes/SubAgentNode.tsx |
Memory badge display |
src/webview/src/components/nodes/SubAgentFlowNode.tsx |
Memory badge display |
resources/workflow-schema.json |
Add memory field definitions |
src/extension/utils/validate-workflow.ts |
Add memory validation |
src/webview/src/i18n/translations/*.json |
Add i18n entries |
Out of Scope
- Actual memory directory creation/management (workflow execution engine scope)
- MEMORY.md preview/edit UI
- Other unimplemented Claude Code Sub Agent frontmatter fields (
permissionMode, skills, hooks, disallowedTools)
Acceptance Criteria
References
Overview
Claude Code has added a Persistent Memory feature for sub-agents (docs).
This issue adds
memoryfield configuration to both Sub Agent nodes and Sub Agent Flow nodes.Background: Persistent Memory
Adding a
memoryfield to a sub-agent's YAML frontmatter assigns a persistent directory that survives across conversations, allowing the sub-agent to build up knowledge over time.Memory Scopes
user~/.claude/agent-memory/<name>/project.claude/agent-memory/<name>/local.claude/agent-memory-local/<name>/Behavior When Enabled
MEMORY.mdin the memory directory are included in the system promptCurrent State
SubAgentData (current fields)
SubAgentFlowNodeData (current fields)
Neither type includes a
memoryfield.Implementation Tasks
1. Type Definitions
T1:
src/shared/types/workflow-definition.tsMemoryScopetype:'user' | 'project' | 'local'memory?: MemoryScopefield toSubAgentDatamemory?: MemoryScopefield toSubAgentFlowNodeData2. Webview UI
T2:
src/webview/src/components/PropertyOverlay.tsx- SubAgent sectionuser,project,localT3:
src/webview/src/components/PropertyOverlay.tsx- SubAgentFlow sectionT4:
src/webview/src/components/nodes/SubAgentNode.tsxT5:
src/webview/src/components/nodes/SubAgentFlowNode.tsx3. Schema & Validation
T6:
resources/workflow-schema.jsonmemoryfield definition to SubAgent node typememoryfield definition to SubAgentFlow node typeT7:
src/extension/utils/validate-workflow.ts4. i18n
T8: Translation files
en.json: Add memory-related labels and help textja.json: Sameko.json: Samezh-CN.json: Samezh-TW.json: Same5. Testing
Modified Files
src/shared/types/workflow-definition.tsMemoryScopetype, addmemoryto SubAgentData / SubAgentFlowNodeDatasrc/webview/src/components/PropertyOverlay.tsxsrc/webview/src/components/nodes/SubAgentNode.tsxsrc/webview/src/components/nodes/SubAgentFlowNode.tsxresources/workflow-schema.jsonsrc/extension/utils/validate-workflow.tssrc/webview/src/i18n/translations/*.jsonOut of Scope
permissionMode,skills,hooks,disallowedTools)Acceptance Criteria
References