Skip to content

feat: system prompt injection for memory MCP - #69

Merged
IceRhymers merged 2 commits into
masterfrom
issue-68-system-prompt
Mar 31, 2026
Merged

feat: system prompt injection for memory MCP#69
IceRhymers merged 2 commits into
masterfrom
issue-68-system-prompt

Conversation

@IceRhymers

Copy link
Copy Markdown
Owner

Summary

  • Add build_system_prompt(config) to claw/core/agent.py — returns instructions for Claude to use read_memory()/write_memory() from the claw-memory MCP server
  • Wire it into create_client() via the system_prompt field on ClaudeAgentOptions
  • Add CLAUDE.md at repo root as belt-and-suspenders (auto-discovered via cwd=repo_root)
  • 8 new tests (274 total, 0 failures)

Closes #68

Test plan

  • TestBuildSystemPrompt (5 tests): validates prompt content includes read_memory, write_memory, filesystem warning, structured sections
  • TestSystemPromptInCreateClient (1 test): verifies system_prompt is set in ClaudeAgentOptions
  • TestClaudeMd (2 tests): verifies CLAUDE.md exists and contains memory instructions
  • Full suite: uv run pytest --tb=short -q → 274 passed

🤖 Generated with Claude Code

IceRhymers and others added 2 commits March 31, 2026 09:43
Add build_system_prompt() to claw/core/agent.py and pass it via the
system_prompt field on ClaudeAgentOptions in create_client(). Also add
CLAUDE.md at repo root as belt-and-suspenders (picked up via cwd).

Instructs Claude to use read_memory()/write_memory() from the
claw-memory MCP server and warns against local filesystem persistence.

Closes #68

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ystem prompt

Replaces plain string system_prompt with SystemPromptPreset(type="preset",
preset="claude_code", append=...) so skills, MCP descriptions, and default
Claude Code behavior are preserved. Memory instructions are appended only.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@IceRhymers
IceRhymers merged commit e71fe01 into master Mar 31, 2026
1 check passed
@IceRhymers
IceRhymers deleted the issue-68-system-prompt branch April 3, 2026 14:37
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.

feat: system prompt injection — tell Claude about memory MCP

1 participant