Skip to content

feat: add memory field to AgentDefinition#618

Open
Br1an67 wants to merge 1 commit intoanthropics:mainfrom
Br1an67:feat/issue-586-agent-memory-field
Open

feat: add memory field to AgentDefinition#618
Br1an67 wants to merge 1 commit intoanthropics:mainfrom
Br1an67:feat/issue-586-agent-memory-field

Conversation

@Br1an67
Copy link

@Br1an67 Br1an67 commented Mar 1, 2026

Summary

The AgentDefinition dataclass is missing the memory field that the Claude Code CLI supports in the --agents flag and file-based subagent frontmatter. This prevents programmatic subagents from using persistent cross-session learning.

Fixes #586

Changes

  • Added optional memory field to AgentDefinition accepting 'user', 'project', or 'local'
  • Defaults to None (backward-compatible — existing code is unaffected)
  • The field is automatically serialized via dataclasses.asdict() and sent in the initialize request, consistent with existing fields
  • Added tests for default behavior and memory field serialization

Testing

  • All 162 tests pass (160 existing + 2 new)
  • ruff check passes with no issues

Add an optional `memory` field to `AgentDefinition` that accepts
'user', 'project', or 'local' to enable persistent cross-session
learning for subagents, matching the CLI's --agents frontmatter support.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Add memory field support to AgentDefinition #585

1 participant