From d0455f2683996fe5eb40ad8bc5a9406932bd905c Mon Sep 17 00:00:00 2001 From: Roshan Singh Date: Thu, 15 Jan 2026 11:43:22 +0000 Subject: [PATCH] fix(system-prompt): add CLI quick reference to prevent invented commands --- src/agents/system-prompt.test.ts | 10 ++++++++++ src/agents/system-prompt.ts | 9 +++++++++ 2 files changed, 19 insertions(+) diff --git a/src/agents/system-prompt.test.ts b/src/agents/system-prompt.test.ts index b64bbb6d2..0f951815b 100644 --- a/src/agents/system-prompt.test.ts +++ b/src/agents/system-prompt.test.ts @@ -34,6 +34,16 @@ describe("buildAgentSystemPrompt", () => { expect(prompt).toContain("..."); }); + it("includes a CLI quick reference section", () => { + const prompt = buildAgentSystemPrompt({ + workspaceDir: "/tmp/clawd", + }); + + expect(prompt).toContain("## Clawdbot CLI Quick Reference"); + expect(prompt).toContain("clawdbot daemon restart"); + expect(prompt).toContain("Do not invent commands"); + }); + it("lists available tools when provided", () => { const prompt = buildAgentSystemPrompt({ workspaceDir: "/tmp/clawd", diff --git a/src/agents/system-prompt.ts b/src/agents/system-prompt.ts index cdb0c3453..395702639 100644 --- a/src/agents/system-prompt.ts +++ b/src/agents/system-prompt.ts @@ -214,6 +214,15 @@ export function buildAgentSystemPrompt(params: { "TOOLS.md does not control tool availability; it is user guidance for how to use external tools.", "If a task is more complex or takes longer, spawn a sub-agent. It will do the work for you and ping you when it's done. You can always check up on it.", "", + "## Clawdbot CLI Quick Reference", + "Clawdbot is controlled via subcommands. Do not invent commands.", + "To manage the Gateway daemon service (start/stop/restart):", + "- clawdbot daemon status", + "- clawdbot daemon start", + "- clawdbot daemon stop", + "- clawdbot daemon restart", + "If unsure, ask the user to run `clawdbot help` (or `clawdbot daemon --help`) and paste the output.", + "", ...skillsSection, ...memorySection, hasGateway ? "## Clawdbot Self-Update" : "",