#How can I inspect the generated system-prompt generated from system-prompt.ts?

1 messages · Page 1 of 1 (latest)

spark harness
#

It's injected with every call to the LLMs if I understand correctly. But its generated on the fly and I'd like to inspect whats the final version that gets sent.

cedar ventureBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> ✅ Mark Solution

edgy tulipBOT
#

Yeah — that system prompt is assembled at run-time (workspace bootstrap files + skills snapshot + tool list/summaries + runtime info), then used as the system content for the model call.

You’ve got a couple good ways to see the final thing:

1) In-chat: export the session (includes the full system prompt)

In the same chat/thread, run:

  • /export-session (or /export)

It will write an HTML file into the agent workspace that includes:

  • the full generated systemPrompt string
  • the tool list + tool JSON schemas
  • the session transcript

Open that HTML on the gateway host (or wherever your workspace lives).

2) Log the actual outbound request payload (best for “what was sent”)

#

Option A: Cache trace (works across providers)

Enable cache tracing in ~/.openclaw/openclaw.json:

{
  diagnostics: {
    cacheTrace: {
      enabled: true,
      includeSystem: true,
      includeMessages: true
    }
  }
}

Then check:

  • $OPENCLAW_STATE_DIR/logs/cache-trace.jsonl (default: ~/.openclaw/logs/cache-trace.jsonl)