From 0240f48751914a3ab648245fbaec7d4f38b7da76 Mon Sep 17 00:00:00 2001 From: NanoClaw User Date: Wed, 25 Mar 2026 14:43:08 +0000 Subject: [PATCH] fix: use main template for isMain groups in runtime registration Main groups (e.g. telegram_main) should get the full main template with Admin Context section, not the minimal global template. Co-Authored-By: Claude Opus 4.6 (1M context) --- src/index.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index f78d8e9..b3746f8 100644 --- a/src/index.ts +++ b/src/index.ts @@ -138,7 +138,11 @@ function registerGroup(jid: string, group: RegisteredGroup): void { // identity and instructions from the first run. (Fixes #1391) const groupMdFile = path.join(groupDir, 'CLAUDE.md'); if (!fs.existsSync(groupMdFile)) { - const templateFile = path.join(GROUPS_DIR, 'global', 'CLAUDE.md'); + const templateFile = path.join( + GROUPS_DIR, + group.isMain ? 'main' : 'global', + 'CLAUDE.md', + ); if (fs.existsSync(templateFile)) { let content = fs.readFileSync(templateFile, 'utf-8'); if (ASSISTANT_NAME !== 'Andy') {