From a86cb932cfe394be2500887302353c859406a0fe Mon Sep 17 00:00:00 2001 From: Joao Lisboa Date: Tue, 2 Dec 2025 13:21:37 -0300 Subject: [PATCH] chore: user-agnostic Claude identity and tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Use ~/Clawd instead of hardcoded /Users/steipete/clawd - Add MEDIA: syntax instructions to identity prefix - Update tests to check for 'scratchpad' instead of specific path 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- src/auto-reply/claude.ts | 2 +- src/index.core.test.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/auto-reply/claude.ts b/src/auto-reply/claude.ts index ca3cfa9df..0ed602e8a 100644 --- a/src/auto-reply/claude.ts +++ b/src/auto-reply/claude.ts @@ -4,7 +4,7 @@ import { z } from "zod"; // Preferred binary name for Claude CLI invocations. export const CLAUDE_BIN = "claude"; export const CLAUDE_IDENTITY_PREFIX = - "You are Clawd (Claude) running on the user's Mac via warelay. Your scratchpad is /Users/steipete/clawd; this is your folder and you can add what you like in markdown files and/or images. You don't need to be concise, but WhatsApp replies must stay under ~1500 characters. Media you can send: images ≤6MB, audio/video ≤16MB, documents ≤100MB. The prompt may include a media path and an optional Transcript: section—use them when present. If a prompt is a heartbeat poll and nothing needs attention, reply with exactly HEARTBEAT_OK and nothing else; for any alert, do not include HEARTBEAT_OK."; + "You are Clawd (Claude) running on the user's Mac via warelay. Your scratchpad is ~/Clawd; this is your folder and you can add what you like in markdown files and/or images. You can send media by including MEDIA:/path/to/file.jpg on its own line (no spaces in path). Media limits: images ≤6MB, audio/video ≤16MB, documents ≤100MB. The prompt may include a media path and an optional Transcript: section—use them when present. If a prompt is a heartbeat poll and nothing needs attention, reply with exactly HEARTBEAT_OK and nothing else; for any alert, do not include HEARTBEAT_OK."; function extractClaudeText(payload: unknown): string | undefined { // Best-effort walker to find the primary text field in Claude JSON outputs. diff --git a/src/index.core.test.ts b/src/index.core.test.ts index 8e56d6309..ffe4c748a 100644 --- a/src/index.core.test.ts +++ b/src/index.core.test.ts @@ -895,7 +895,7 @@ describe("config and templating", () => { const argv = runSpy.mock.calls[0][0]; expect(argv[0]).toBe("claude"); expect(argv.at(-1)).toContain("You are Clawd (Claude)"); - expect(argv.at(-1)).toContain("/Users/steipete/clawd"); + expect(argv.at(-1)).toContain("scratchpad"); expect(argv.at(-1)).toMatch(/hi$/); // The helper should auto-add print and output format flags without disturbing the prompt position. expect(argv.includes("-p") || argv.includes("--print")).toBe(true); @@ -963,7 +963,7 @@ describe("config and templating", () => { expect(result?.text).toBe("Sure! What's up?"); const argv = runSpy.mock.calls[0][0]; expect(argv.at(-1)).toContain("You are Clawd (Claude)"); - expect(argv.at(-1)).toContain("/Users/steipete/clawd"); + expect(argv.at(-1)).toContain("scratchpad"); }); it("serializes command auto-replies via the queue", async () => {