From b3f5814f4832bc664d2abfdb49796fa163311959 Mon Sep 17 00:00:00 2001 From: Gavriel Cohen Date: Mon, 9 Feb 2026 09:28:25 +0200 Subject: [PATCH] feat: move to Claude's native memory management Enable CLAUDE_CODE_DISABLE_AUTO_MEMORY=0 and CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD=1 in container env so agents use Claude Code's built-in persistent memory instead of manually editing CLAUDE.md. Remove instructions that told agents to write context into CLAUDE.md files. Co-Authored-By: Claude Opus 4.6 --- groups/global/CLAUDE.md | 15 +++++++++++---- groups/main/CLAUDE.md | 7 +++---- src/container-runner.ts | 12 +++++++++++- 3 files changed, 25 insertions(+), 9 deletions(-) diff --git a/groups/global/CLAUDE.md b/groups/global/CLAUDE.md index 89026fc..28e97a7 100644 --- a/groups/global/CLAUDE.md +++ b/groups/global/CLAUDE.md @@ -38,8 +38,6 @@ When working as a sub-agent or teammate, only use `send_message` if instructed t Files you create are saved in `/workspace/group/`. Use this for notes, research, or anything that should persist. -Your `CLAUDE.md` file in that folder is your memory - update it with important context you want to remember. - ## Memory The `conversations/` folder contains searchable history of past conversations. Use this to recall context from previous sessions. @@ -47,5 +45,14 @@ The `conversations/` folder contains searchable history of past conversations. U When you learn something important: - Create files for structured data (e.g., `customers.md`, `preferences.md`) - Split files larger than 500 lines into folders -- Add recurring context directly to this CLAUDE.md -- Always index new memory files at the top of CLAUDE.md +- Keep an index in your memory for the files you create + +## Message Formatting + +NEVER use markdown. Only use WhatsApp/Telegram formatting: +- *single asterisks* for bold (NEVER **double asterisks**) +- _underscores_ for italic +- • bullet points +- ```triple backticks``` for code + +No ## headings. No [links](url). No **double stars**. diff --git a/groups/main/CLAUDE.md b/groups/main/CLAUDE.md index f34f67b..ea56441 100644 --- a/groups/main/CLAUDE.md +++ b/groups/main/CLAUDE.md @@ -41,13 +41,12 @@ The `conversations/` folder contains searchable history of past conversations. U When you learn something important: - Create files for structured data (e.g., `customers.md`, `preferences.md`) - Split files larger than 500 lines into folders -- Add recurring context directly to this CLAUDE.md -- Always index new memory files at the top of CLAUDE.md +- Keep an index in your memory for the files you create -## WhatsApp Formatting +## WhatsApp Formatting (and other messaging apps) Do NOT use markdown headings (##) in WhatsApp messages. Only use: -- *Bold* (asterisks) +- *Bold* (single asterisks) (NEVER **double asterisks**) - _Italic_ (underscores) - • Bullets (bullet points) - ```Code blocks``` (triple backticks) diff --git a/src/container-runner.ts b/src/container-runner.ts index bfa3af3..b6b47f4 100644 --- a/src/container-runner.ts +++ b/src/container-runner.ts @@ -108,7 +108,17 @@ function buildVolumeMounts( const settingsFile = path.join(groupSessionsDir, 'settings.json'); if (!fs.existsSync(settingsFile)) { fs.writeFileSync(settingsFile, JSON.stringify({ - env: { CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS: '1' }, + env: { + // Enable agent swarms (subagent orchestration) + // https://code.claude.com/docs/en/agent-teams#orchestrate-teams-of-claude-code-sessions + CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS: '1', + // Load CLAUDE.md from additional mounted directories + // https://code.claude.com/docs/en/memory#load-memory-from-additional-directories + CLAUDE_CODE_ADDITIONAL_DIRECTORIES_CLAUDE_MD: '1', + // Enable Claude's memory feature (persists user preferences between sessions) + // https://code.claude.com/docs/en/memory#manage-auto-memory + CLAUDE_CODE_DISABLE_AUTO_MEMORY: '0', + }, }, null, 2) + '\n'); }