claudeclaw-group-agent
Installation
SKILL.md
ClaudeClaw Group Agent
Critical
- Assistant vs. business (customer groups) —
buildGroupSystemPrompt()injectsCUSTOMER_WHATSAPP_TOOLING_FRAMINGfor everygroup_type = customergroup so the model does not imply the brand lacks Facebook, WhatsApp, WordPress, etc. Tax4US retains extra[TAX4US CONTEXT]ingroup_agent_config.system_prompt_additions.finalizeGroupResponserunsapplyOutputGuardrails(..., { customerWhatsAppGroup: true }), which may append a short EN+HE clarification if the reply still matches risky “no access” phrasing (seeguardrails.appendCustomerToolingClarificationIfNeeded). - Entity groups require @-mention or /command — plain text in entity groups is SILENTLY LOGGED, not processed. Customer groups process ALL messages.
- 7 entity groups seeded on startup from
group-agent.ts: superseller, rensto, rabbi-dan-marco, yoram-friedman, shai-personal-brand, elite-pro-remodeling, gp-homes-repairs. - Many customer groups: Any paying tenant whose group is registered via
bootstrapOnboardingGroup(services/onboarding/group-bootstrap.ts) getsgroupType: "customer"— all messages in that group are processed (no @-mention gate). Tax4US is additionally seeded ingroup-agent.tswith a largesystem_prompt_additionsblock (white-label rules, cadence, “never say SuperSeller”); other customers typically useassembleProductPrompt+ defaultregisterGroupagent naming unless customized in DB. - Safety guards WA-SAFE-01 through WA-SAFE-07 protect against API drain — all in
whatsapp.ts. - Anthropic SDK direct HTTP (
@anthropic-ai/sdkv0.63.1) —client.messages.create()viaclaude-bridge.ts. NOT the@anthropic-ai/claude-agent-sdksubprocess anymore (see "Architecture change" below). - 2-minute timeout (WA-SAFE-04) via AbortController — aborts if exceeded.
- Memory:
claudeclaw_turnstable, last 20 turns as propermessages[]array (enables Anthropic prompt caching).claudeclaw_sessionstable is now unused — kept for backward compat with legacy session-based flows.
Architecture change (2026-04-16, commit 55275156)
Rewrote claude-bridge.ts from @anthropic-ai/claude-agent-sdk (subprocess spawn of claude CLI with stream-json IPC) to @anthropic-ai/sdk (direct HTTP to api.anthropic.com/v1/messages).
Why: under PM2 fork mode on RackNerd, the subprocess architecture silently dropped ANTHROPIC_API_KEY during the env: {...process.env} spread to the grandchild. CLI reported apiKeySource:"none" and exited code 1 on every WhatsApp message, 100% of the time, silently. Ben went from 2026-04-09 to 2026-04-16 without a single real reply.