openclaw-tracking

An activity tracker for OpenClaw, an AI-agent system, that combines live gateway messages with its session log files. It captures events the gateway does not send, including file and command activity.

In plain words
What is it for?
Use it to monitor agent sessions, record commands and file operations, and detect approval requests or session errors.
Why use it?
It gives a fuller record of what an OpenClaw agent did than the gateway connection alone can provide.

Agent for Claude Code

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/dinomorphica/safeclaw/openclaw-tracking
Clone the repo
git clone --depth 1 https://github.com/DinoMorphica/safeclaw

Made for: Claude Code.

Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,320 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.01320
Opus 5 $0.00000 $0.00660
Sonnet 5 $0.00000 $0.00264
Haiku 4.5 $0.00000 $0.00132

Measured 3d ago against content hash 2df0466b30ba, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

openclaw-tracking scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/agents/openclaw-tracking.md · 118 lines

How it starts

The opening of the file, as written. The whole thing — 118 lines — stays where its author put it; the contents beside it link to each section on GitHub.

OpenClaw Activity Tracking Architecture

Overview

SafeClaw tracks OpenClaw AI agent activities using a dual-source approach because the gateway WebSocket does NOT broadcast tool call events.

Event Sources

Source 1: Gateway WebSocket (real-time, limited)

Connects to ws://127.0.0.1:{port} (default 18789) using Ed25519 device auth.

Events received:

  • agent with stream=lifecycle — session start/end (phase: start/end/error)
  • agent with stream=assistant — LLM text streaming (skipped, not security-relevant)
  • chat — final message delivery (WhatsApp, agent responses)
  • exec.approval.requested — command approval requests
  • tick — keepalive
  • presence — online status

Events NOT received:

  • agent with stream=tool — tool invocations (file reads, writes, shell commands). These are processed internally by the [agent/embedded] subsystem but never broadcast to WebSocket clients. This was confirmed via gateway log analysis.

Source 2: Session JSONL Files (complete, file-tailed)

OpenClaw stores complete interaction histories at:

~/.openclaw/agents/{agentName}/sessions/{sessionId}.jsonl

Active sessions are listed in:

~/.openclaw/agents/{agentName}/sessions/sessions.json

JSONL entry types:

{"type":"session","id":"...","timestamp":"...","cwd":"..."}
{"type":"model_change","id":"...","modelId":"claude-haiku-4-5"}
{"type":"message","id":"...","parentId":"...","message":{"role":"user","content":[{"type":"text","text":"..."}]}}
{"type":"message","id":"...","parentId":"...","message":{"role":"assistant","content":[{"type":"toolCall","id":"toolu_...","name":"read","arguments":{"file_path":"/path"}}]}}
{"type":"message","id":"...","parentId":"...","message":{"role":"toolResult","toolCallId":"toolu_...","content":[{"type":"text","text":"FULL FILE CONTENT"}]}}

The parentId chain creates a tree structure. Each role: "user" message starts a new interaction run.

Architecture

┌─────────────────┐     ┌──────────────────┐
│ Gateway WS      │     │ Session JSONL     │
│ (chat/lifecycle)│     │ (tool calls+content)│
└────────┬────────┘     └────────┬───────────┘
         │                       │
    OpenClawClient         SessionWatcher
         │                       │
         └───────┬───────────────┘
                 │
         OpenClawMonitor
         ├── analyzeActivityThreat() → classifyActivity()
         │   ├── 10 threat category analyzers (see threat-classification.md)
         │   └── scanForSecrets() (via TC-SEC analyzer)
         ├── DB insert (agent_activities + threat_findings JSON)
         └── Socket.IO emit → React dashboard

Read the full file on GitHub · 118 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 118 lines · 0 tokens per session scan A 2df0466b30ba

Subscribe to this mod's changes

openclaw-tracking is an agent published in the GitHub repository DinoMorphica/safeclaw (21 stars, last pushed 6mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,320 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.