Navigate back to the previous page in browser history. Requires browser_navigate to be called first.

Click on an element identified by its ref ID from the snapshot (e.g., '@e5'). The ref IDs are shown in square brackets in the snapshot output. Requires browser_navigate and browser_snapshot to be called first.

The element reference from the snapshot (e.g., '@e5', '@e12')

Get browser console output and JavaScript errors from the current page. Returns console.log/warn/error/info messages and uncaught JS exceptions. Use this to detect silent JavaScript errors, failed API calls, and application warnings. Requires browser_navigate to be called first. When 'expression' is provided, evaluates JavaScript in the page context and returns the result — use this for DOM inspection, reading page state, or extracting data programmatically.

If true, clear the message buffers after reading

JavaScript expression to evaluate in the page context. Runs in the browser like DevTools console — full access to DOM, window, document. Return values are serialized to JSON. Example: 'document.title' or 'document.querySelectorAll("a").length'

Get a list of all images on the current page with their URLs and alt text. Useful for finding images to analyze with the vision tool. Requires browser_navigate to be called first.

Navigate to a URL in the browser. Initializes the session and loads the page. Must be called before other browser tools. For plain-text endpoints — URLs ending in .md, .txt, .json, .yaml, .yml, .csv, .xml, raw.githubusercontent.com, or any documented API endpoint — prefer curl via the terminal tool or web_extract; the browser stack is overkill and much slower for these. Use browser tools when you need to interact with a page (click, fill forms, dynamic content). Returns a compact page snapshot with interactive elements and ref IDs — no need to call browser_snapshot separately after navigating.

The URL to navigate to (e.g., 'https://example.com')

Press a keyboard key. Useful for submitting forms (Enter), navigating (Tab), or keyboard shortcuts. Requires browser_navigate to be called first.

Key to press (e.g., 'Enter', 'Tab', 'Escape', 'ArrowDown')

Scroll the page in a direction. Use this to reveal more content that may be below or above the current viewport. Requires browser_navigate to be called first.

Direction to scroll

Get a text-based snapshot of the current page's accessibility tree. Returns interactive elements with ref IDs (like @e1, @e2) for browser_click and browser_type. full=false (default): compact view with interactive elements. full=true: complete page content. Snapshots over 8000 chars are truncated or LLM-summarized. Requires browser_navigate first. Note: browser_navigate already returns a compact snapshot — use this to refresh after interactions that change the page, or with full=true for complete content.

If true, returns complete page content. If false (default), returns compact view with interactive elements only.

Type text into an input field identified by its ref ID. Clears the field first, then types the new text. Requires browser_navigate and browser_snapshot to be called first.

The element reference from the snapshot (e.g., '@e3')

The text to type into the field

Take a screenshot of the current page and analyze it with vision AI. Use this when you need to visually understand what's on the page - especially useful for CAPTCHAs, visual verification challenges, complex layouts, or when the text snapshot doesn't capture important visual information. Returns both the AI analysis and a screenshot_path that you can share with the user by including MEDIA:<screenshot_path> in your response. Requires browser_navigate to be called first.

What you want to know about the page visually. Be specific about what you're looking for.

If true, overlay numbered [N] labels on interactive elements. Each [N] maps to ref @eN for subsequent browser commands. Useful for QA and spatial reasoning about page layout.

clarify

Ask the user a question when you need clarification, feedback, or a decision before proceeding. Supports two modes:

1. **Multiple choice** — provide up to 4 choices. The user picks one or types their own answer via a 5th 'Other' option.
2. **Open-ended** — omit choices entirely. The user types a free-form response.

Use this tool when:
- The task is ambiguous and you need the user to choose an approach
- You want post-task feedback ('How did that work out?')
- You want to offer to save a skill or update memory
- A decision has meaningful trade-offs the user should weigh in on

Do NOT use this tool for simple yes/no confirmation of dangerous commands (the terminal tool handles that). Prefer making a reasonable default choice yourself when the decision is low-stakes.

The question to present to the user.

Choices:
Up to 4 answer choices. Omit this parameter entirely to ask an open-ended question. When provided, the UI automatically appends an 'Other (type your answer)' option.

cronjob

Manage scheduled cron jobs with a single compressed tool.

Use action='create' to schedule a new job from a prompt or one or more skills.
Use action='list' to inspect jobs.
Use action='update', 'pause', 'resume', 'remove', or 'run' to manage an existing job.

To stop a job the user no longer wants: first action='list' to find the job_id, then action='remove' with that job_id. Never guess job IDs — always list first.

Jobs run in a fresh session with no current-chat context, so prompts must be self-contained.
If skills are provided on create, the future cron run loads those skills in order, then follows the prompt as the task instruction.
On update, passing skills=[] clears attached skills.

NOTE: The agent's final response is auto-delivered to the target. Put the primary
user-facing content in the final response. Cron jobs run autonomously with no user
present — they cannot ask questions or request clarification.

Important safety rule: cron-run sessions should not recursively schedule more cron jobs.

One of: create, list, update, pause, resume, remove, run

Required for update/pause/resume/remove/run

For create: the full self-contained prompt. If skills are also provided, this becomes the task instruction paired with those skills.

For create/update: '30m', 'every 2h', '0 9 * * *', or ISO timestamp

Optional human-friendly name

Optional repeat count. Omit for defaults (once for one-shot, forever for recurring).

Omit this parameter to auto-deliver back to the current chat and topic (recommended). Auto-detection preserves thread/topic context. Only set explicitly when the user asks to deliver somewhere OTHER than the current conversation. Values: 'origin' (same as omitting), 'local' (no delivery, save only), or platform:chat_id:thread_id for a specific destination. Examples: 'telegram:-1001234567890:17585', 'discord:#engineering', 'sms:+15551234567'. WARNING: 'platform:chat_id' without :thread_id loses topic targeting.

Optional ordered list of skill names to load before executing the cron prompt. On update, pass an empty array to clear attached skills.

Optional per-job model override. If provider is omitted, the current main provider is pinned at creation time so the job stays stable.

Provider name (e.g. 'openrouter', 'anthropic'). Omit to use and pin the current provider.

Model name (e.g. 'anthropic/claude-sonnet-4', 'claude-sonnet-4')

Optional path to a Python script that runs before each cron job execution. Its stdout is injected into the prompt as context. Use for data collection and change detection. Relative paths resolve under ~/.hermes/scripts/. On update, pass empty string to clear.

Optional job ID or list of job IDs whose most recent completed output is injected into the prompt as context before each run. Use this to chain cron jobs: job A collects data, job B processes it. Each entry must be a valid job ID (from cronjob action='list'). Note: injects the most recent completed output — does not wait for upstream jobs running in the same tick. On update, pass an empty array to clear.

Optional list of toolset names to restrict the job's agent to (e.g. ["web", "terminal", "file", "delegation"]). When set, only tools from these toolsets are loaded, significantly reducing input token overhead. When omitted, all default tools are loaded. Infer from the job's prompt — e.g. use "web" if it calls web_search, "terminal" if it runs scripts, "file" if it reads files, "delegation" if it calls delegate_task. On update, pass an empty array to clear.

Optional absolute path to run the job from. When set, AGENTS.md / CLAUDE.md / .cursorrules from that directory are injected into the system prompt, and the terminal/file/code_exec tools use it as their working directory — useful for running a job inside a specific project repo. Must be an absolute path that exists. When unset (default), preserves the original behaviour: no project context files, tools use the scheduler's cwd. On update, pass an empty string to clear. Jobs with workdir run sequentially (not parallel) to keep per-job directories isolated.

Spawn one or more subagents to work on tasks in isolated contexts. Each subagent gets its own conversation, terminal session, and toolset. Only the final summary is returned -- intermediate tool results never enter your context window.

TWO MODES (one of 'goal' or 'tasks' is required):
1. Single task: provide 'goal' (+ optional context, toolsets)
2. Batch (parallel): provide 'tasks' array with up to delegation.max_concurrent_children items (default 3, configurable via config.yaml, no hard ceiling). All run concurrently and results are returned together. Nested delegation requires role='orchestrator' and delegation.max_spawn_depth >= 2.

WHEN TO USE delegate_task:
- Reasoning-heavy subtasks (debugging, code review, research synthesis)
- Tasks that would flood your context with intermediate data
- Parallel independent workstreams (research A and B simultaneously)

WHEN NOT TO USE (use these instead):
- Mechanical multi-step work with no reasoning needed -> use execute_code
- Single tool call -> just call the tool directly
- Tasks needing user interaction -> subagents cannot use clarify
- Durable long-running work that must outlive the current turn -> use cronjob (action='create') or terminal(background=True, notify_on_complete=True) instead. delegate_task runs SYNCHRONOUSLY inside the parent turn: if the parent is interrupted (user sends a new message, /stop, /new) the child is cancelled with status='interrupted' and its work is discarded. Children cannot continue in the background.

IMPORTANT:
- Subagents have NO memory of your conversation. Pass all relevant info (file paths, error messages, constraints) via the 'context' field.
- If the user is writing in a non-English language, or asked for output in a specific language / tone / style, say so in 'context' (e.g. "respond in Chinese", "return output in Japanese"). Otherwise subagents default to English and their summaries will contaminate your final reply with the wrong language.
- Subagent summaries are SELF-REPORTS, not verified facts. A subagent that claims "uploaded successfully" or "file written" may be wrong. For operations with external side-effects (HTTP POST/PUT, remote writes, file creation at shared paths, publishing), require the subagent to return a verifiable handle (URL, ID, absolute path, HTTP status) and verify it yourself — fetch the URL, stat the file, read back the content — before telling the user the operation succeeded.
- Leaf subagents (role='leaf', the default) CANNOT call: delegate_task, clarify, memory, send_message, execute_code.
- Orchestrator subagents (role='orchestrator') retain delegate_task so they can spawn their own workers, but still cannot use clarify, memory, send_message, or execute_code. Orchestrators are bounded by delegation.max_spawn_depth (default 2) and can be disabled globally via delegation.orchestrator_enabled=false.
- Each subagent gets its own terminal session (separate working directory and state).
- Results are always returned as an array, one entry per task.

What the subagent should accomplish. Be specific and self-contained -- the subagent knows nothing about your conversation history.

Background information the subagent needs: file paths, error messages, project structure, constraints. The more specific you are, the better the subagent performs.

Toolsets to enable for this subagent. Default: inherits your enabled toolsets. Available toolsets: 'browser', 'cronjob', 'discord', 'discord_admin', 'feishu_doc', 'feishu_drive', 'file', 'homeassistant', 'image_gen', 'kanban', 'search', 'session_search', 'skills', 'spotify', 'terminal', 'todo', 'tts', 'vision', 'web', 'yuanbao'. Common patterns: ['terminal', 'file'] for code work, ['web'] for research, ['browser'] for web interaction, ['terminal', 'file', 'web'] for full-stack tasks.

Task goal

Task-specific context

Toolsets for this specific task. Available: 'browser', 'cronjob', 'discord', 'discord_admin', 'feishu_doc', 'feishu_drive', 'file', 'homeassistant', 'image_gen', 'kanban', 'search', 'session_search', 'skills', 'spotify', 'terminal', 'todo', 'tts', 'vision', 'web', 'yuanbao'. Use 'web' for network access, 'terminal' for shell, 'browser' for web interaction.

Per-task ACP command override (e.g. 'claude'). Overrides the top-level acp_command for this task only.

Per-task ACP args override.

Per-task role override. See top-level 'role' for semantics.

Batch mode: tasks to run in parallel (limit configurable via delegation.max_concurrent_children, default 3). Each gets its own subagent with isolated context and terminal session. When provided, top-level goal/context/toolsets are ignored.

Role of the child agent. 'leaf' (default) = focused worker, cannot delegate further. 'orchestrator' = can use delegate_task to spawn its own workers. Requires delegation.max_spawn_depth >= 2 in config; ignored (treated as 'leaf') when the child would exceed max_spawn_depth or when delegation.orchestrator_enabled=false.

Override ACP command for child agents (e.g. 'claude', 'copilot'). When set, children use ACP subprocess transport instead of inheriting the parent's transport. Enables spawning Claude Code (claude --acp --stdio) or other ACP-capable agents from any parent, including Discord/Telegram/CLI.

Arguments for the ACP command (default: ['--acp', '--stdio']). Only used when acp_command is set. Example: ['--acp', '--stdio', '--model', 'claude-opus-4-6']

Run a Python script that can call Hermes tools programmatically. Use this when you need 3+ tool calls with processing logic between them, need to filter/reduce large tool outputs before they enter your context, need conditional branching (if X then Y else Z), or need to loop (fetch N pages, process N files, retry on failure).

Use normal tool calls instead when: single tool call with no processing, you need to see the full result and apply complex reasoning, or the task requires interactive user input.

Available via `from hermes_tools import ...`:

  read_file(path: str, offset: int = 1, limit: int = 500) -> dict
    Lines are 1-indexed. Returns {"content": "...", "total_lines": N}
  write_file(path: str, content: str) -> dict
    Always overwrites the entire file.
  search_files(pattern: str, target="content", path=".", file_glob=None, limit=50) -> dict
    target: "content" (search inside files) or "files" (find files by name). Returns {"matches": [...]}
  patch(path: str, old_string: str, new_string: str, replace_all: bool = False) -> dict
    Replaces old_string with new_string in the file.
  terminal(command: str, timeout=None, workdir=None) -> dict
    Foreground only (no background/pty). Returns {"output": "...", "exit_code": N}

Limits: 5-minute timeout, 50KB stdout cap, max 50 tool calls per script. terminal() is foreground-only (no background or pty).

Scripts run in the session's working directory with the active venv's python, so project deps (pandas, etc.) and relative paths work like in terminal().

Print your final result to stdout. Use Python stdlib (json, re, math, csv, datetime, collections, etc.) for processing between tool calls.

Also available (no import needed — built into hermes_tools):
  json_parse(text: str) — json.loads with strict=False; use for terminal() output with control chars
  shell_quote(s: str) — shlex.quote(); use when interpolating dynamic strings into shell commands
  retry(fn, max_attempts=3, delay=2) — retry with exponential backoff for transient failures

Python code to execute. Import tools with `from hermes_tools import terminal, ...` and print your final result to stdout.

Generate high-quality images from text prompts. The underlying backend (FAL, OpenAI, etc.) and model are user-configured and not selectable by the agent. Returns either a URL or an absolute file path in the `image` field; display it with markdown ![description](url-or-path) and the gateway will deliver it.

The text prompt describing the desired image. Be detailed and descriptive.

The aspect ratio of the generated image. 'landscape' is 16:9 wide, 'portrait' is 16:9 tall, 'square' is 1:1.

memory

Save durable information to persistent memory that survives across sessions. Memory is injected into future turns, so keep it compact and focused on facts that will still matter later.

WHEN TO SAVE (do this proactively, don't wait to be asked):
- User corrects you or says 'remember this' / 'don't do that again'
- User shares a preference, habit, or personal detail (name, role, timezone, coding style)
- You discover something about the environment (OS, installed tools, project structure)
- You learn a convention, API quirk, or workflow specific to this user's setup
- You identify a stable fact that will be useful again in future sessions

PRIORITY: User preferences and corrections > environment facts > procedural knowledge. The most valuable memory prevents the user from having to repeat themselves.

Do NOT save task progress, session outcomes, completed-work logs, or temporary TODO state to memory; use session_search to recall those from past transcripts.
If you've discovered a new way to do something, solved a problem that could be necessary later, save it as a skill with the skill tool.

TWO TARGETS:
- 'user': who the user is -- name, role, preferences, communication style, pet peeves
- 'memory': your notes -- environment facts, project conventions, tool quirks, lessons learned

ACTIONS: add (new entry), replace (update existing -- old_text identifies it), remove (delete -- old_text identifies it).

SKIP: trivial/obvious info, things easily re-discovered, raw data dumps, and temporary task state.

The action to perform.

Which memory store: 'memory' for personal notes, 'user' for user profile.

The entry content. Required for 'add' and 'replace'.

Short unique substring identifying the entry to replace or remove.

patch

Targeted find-and-replace edits in files. Use this instead of sed/awk in terminal. Uses fuzzy matching (9 strategies) so minor whitespace/indentation differences won't break it. Returns a unified diff. Auto-runs syntax checks after editing.

Replace mode (default): find a unique string and replace it.
Patch mode: apply V4A multi-file patches for bulk changes.

Edit mode: 'replace' for targeted find-and-replace, 'patch' for V4A multi-file patches

File path to edit (required for 'replace' mode)

Text to find in the file (required for 'replace' mode). Must be unique in the file unless replace_all=true. Include enough surrounding context to ensure uniqueness.

Replacement text (required for 'replace' mode). Can be empty string to delete the matched text.

Replace all occurrences instead of requiring a unique match (default: false)

V4A format patch content (required for 'patch' mode). Format:
*** Begin Patch
*** Update File: path/to/file
@@ context hint @@
 context line
-removed line
+added line
*** End Patch

process

Manage background processes started with terminal(background=true). Actions: 'list' (show all), 'poll' (check status + new output), 'log' (full output with pagination), 'wait' (block until done or timeout), 'kill' (terminate), 'write' (send raw stdin data without newline), 'submit' (send data + Enter, for answering prompts), 'close' (close stdin/send EOF).

list poll log wait kill write submit close

Action to perform on background processes

Process session ID (from terminal background output). Required for all actions except 'list'.

Text to send to process stdin (for 'write' and 'submit' actions)

Max seconds to block for 'wait' action. Returns partial output on timeout.

Line offset for 'log' action (default: last 200 lines)

Max lines to return for 'log' action

Read a text file with line numbers and pagination. Use this instead of cat/head/tail in terminal. Output format: 'LINE_NUM|CONTENT'. Suggests similar filenames if not found. Use offset and limit for large files. Reads exceeding ~100K characters are rejected; use offset and limit to read specific sections of large files. NOTE: Cannot read images or binary files — use vision_analyze for images.

Path to the file to read (absolute, relative, or ~/path)

Line number to start reading from (1-indexed, default: 1)

Maximum number of lines to read (default: 500, max: 2000)

Search file contents or find files by name. Use this instead of grep/rg/find/ls in terminal. Ripgrep-backed, faster than shell equivalents.

Content search (target='content'): Regex search inside files. Output modes: full matches with line numbers, file paths only, or match counts.

File search (target='files'): Find files by glob pattern (e.g., '*.py', '*config*'). Also use this instead of ls — results sorted by modification time.

Regex pattern for content search, or glob pattern (e.g., '*.py') for file search

'content' searches inside file contents, 'files' searches for files by name

Directory or file to search in (default: current working directory)

Filter files by pattern in grep mode (e.g., '*.py' to only search Python files)

Maximum number of results to return (default: 50)

Skip first N results for pagination (default: 0)

Output format for grep mode: 'content' shows matching lines with line numbers, 'files_only' lists file paths, 'count' shows match counts per file

Number of context lines before and after each match (grep mode only)

Send a message to a connected messaging platform, or list available targets.

IMPORTANT: When the user asks to send to a specific channel or person (not just a bare platform name), call send_message(action='list') FIRST to see available targets, then send to the correct one.
If the user just says a platform name like 'send to telegram', send directly to the home channel without listing first.

Action to perform. 'send' (default) sends a message. 'list' returns all available channels/contacts across connected platforms.

Delivery target. Format: 'platform' (uses home channel), 'platform:#channel-name', 'platform:chat_id', or 'platform:chat_id:thread_id' for Telegram topics and Discord threads. Examples: 'telegram', 'telegram:-1001234567890:17585', 'discord:999888777:555444333', 'discord:#bot-home', 'slack:#engineering', 'signal:+155****4567', 'matrix:!roomid:server.org', 'matrix:@user:server.org', 'yuanbao:direct:<account_id>' (DM), 'yuanbao:group:<group_code>' (group chat)

The message text to send. To send an image or file, include MEDIA:<local_path> (e.g. 'MEDIA:/tmp/hermes/cache/img_xxx.jpg') in the message — the platform will deliver it as a native media attachment.

Search your long-term memory of past conversations, or browse recent sessions. This is your recall -- every past session is searchable, and this tool summarizes what happened.

TWO MODES:
1. Recent sessions (no query): Call with no arguments to see what was worked on recently. Returns titles, previews, and timestamps. Zero LLM cost, instant. Start here when the user asks what were we working on or what did we do recently.
2. Keyword search (with query): Search for specific topics across all past sessions. Returns LLM-generated summaries of matching sessions.

USE THIS PROACTIVELY when:
- The user says 'we did this before', 'remember when', 'last time', 'as I mentioned'
- The user asks about a topic you worked on before but don't have in current context
- The user references a project, person, or concept that seems familiar but isn't in memory
- You want to check if you've solved a similar problem before
- The user asks 'what did we do about X?' or 'how did we fix Y?'

Don't hesitate to search when it is actually cross-session -- it's fast and cheap. Better to search and confirm than to guess or ask the user to repeat themselves.

Search syntax: keywords joined with OR for broad recall (elevenlabs OR baseten OR funding), phrases for exact match ("docker networking"), boolean (python NOT java), prefix (deploy*). IMPORTANT: Use OR between keywords for best results — FTS5 defaults to AND which misses sessions that only mention some terms. If a broad OR query returns nothing, try individual keyword searches in parallel. Returns summaries of the top matching sessions.

Search query — keywords, phrases, or boolean expressions to find in past sessions. Omit this parameter entirely to browse recent sessions instead (returns titles, previews, timestamps with no LLM cost).

Optional: only search messages from specific roles (comma-separated). E.g. 'user,assistant' to skip tool outputs.

Max sessions to summarize (default: 3, max: 5).

Manage skills (create, update, delete). Skills are your procedural memory — reusable approaches for recurring task types. New skills go to ~/.hermes/skills/; existing skills can be modified wherever they live.

Actions: create (full SKILL.md + optional category), patch (old_string/new_string — preferred for fixes), edit (full SKILL.md rewrite — major overhauls only), delete, write_file, remove_file.

Create when: complex task succeeded (5+ calls), errors overcome, user-corrected approach worked, non-trivial workflow discovered, or user asks you to remember a procedure.
Update when: instructions stale/wrong, OS-specific failures, missing steps or pitfalls found during use. If you used a skill and hit issues not covered by it, patch it immediately.

After difficult/iterative tasks, offer to save as a skill. Skip for simple one-offs. Confirm with user before creating/deleting.

Good skills: trigger conditions, numbered steps with exact commands, pitfalls section, verification steps. Use skill_view() to see format examples.

Pinned skills are off-limits — all write actions refuse with a message pointing the user to `hermes curator unpin <name>`. Don't try to route around this by renaming or recreating.

create patch edit delete write_file remove_file

The action to perform.

Skill name (lowercase, hyphens/underscores, max 64 chars). Must match an existing skill for patch/edit/delete/write_file/remove_file.

Full SKILL.md content (YAML frontmatter + markdown body). Required for 'create' and 'edit'. For 'edit', read the skill first with skill_view() and provide the complete updated text.

Text to find in the file (required for 'patch'). Must be unique unless replace_all=true. Include enough surrounding context to ensure uniqueness.

Replacement text (required for 'patch'). Can be empty string to delete the matched text.

For 'patch': replace all occurrences instead of requiring a unique match (default: false).

Optional category/domain for organizing the skill (e.g., 'devops', 'data-science', 'mlops'). Creates a subdirectory grouping. Only used with 'create'.

Path to a supporting file within the skill directory. For 'write_file'/'remove_file': required, must be under references/, templates/, scripts/, or assets/. For 'patch': optional, defaults to SKILL.md if omitted.

Content for the file. Required for 'write_file'.

Skills allow for loading information about specific tasks and workflows, as well as scripts and templates. Load a skill's full content or access its linked files (references, templates, scripts). First call returns SKILL.md content plus a 'linked_files' dict showing available references/templates/scripts. To access those, call again with file_path parameter.

The skill name (use skills_list to see available skills). For plugin-provided skills, use the qualified form 'plugin:skill' (e.g. 'superpowers:writing-plans').

OPTIONAL: Path to a linked file within the skill (e.g., 'references/api.md', 'templates/config.yaml', 'scripts/validate.py'). Omit to get the main SKILL.md content.

List available skills (name + description). Use skill_view(name) to load full content.

Optional category filter to narrow results

terminal

Execute shell commands on a Linux environment. Filesystem usually persists between calls.

Do NOT use cat/head/tail to read files — use read_file instead.
Do NOT use grep/rg/find to search — use search_files instead.
Do NOT use ls to list directories — use search_files(target='files') instead.
Do NOT use sed/awk to edit files — use patch instead.
Do NOT use echo/cat heredoc to create files — use write_file instead.
Reserve terminal for: builds, installs, git, processes, scripts, network, package managers, and anything that needs a shell.

Foreground (default): Commands return INSTANTLY when done, even if the timeout is high. Set timeout=300 for long builds/scripts — you'll still get the result in seconds if it's fast. Prefer foreground for short commands.
Background: Set background=true to get a session_id. Two patterns:
  (1) Long-lived processes that never exit (servers, watchers).
  (2) Long-running tasks with notify_on_complete=true — you can keep working on other things and the system auto-notifies you when the task finishes. Great for test suites, builds, deployments, or anything that takes more than a minute.
For servers/watchers, do NOT use shell-level background wrappers (nohup/disown/setsid/trailing '&') in foreground mode. Use background=true so Hermes can track lifecycle and output.
After starting a server, verify readiness with a health check or log signal, then run tests in a separate terminal() call. Avoid blind sleep loops.
Use process(action="poll") for progress checks, process(action="wait") to block until done.
Working directory: Use 'workdir' for per-command cwd.
PTY mode: Set pty=true for interactive CLI tools (Codex, Claude Code, Python REPL).

Do NOT use vim/nano/interactive tools without pty=true — they hang without a pseudo-terminal. Pipe git output to cat if it might page.

The command to execute on the VM

Run the command in the background. Two patterns: (1) Long-lived processes that never exit (servers, watchers). (2) Long-running tasks paired with notify_on_complete=true — you can keep working and get notified when the task finishes. For short commands, prefer foreground with a generous timeout instead.

Max seconds to wait (default: 180, foreground max: 600). Returns INSTANTLY when command finishes — set high for long tasks, you won't wait unnecessarily. Foreground timeout above 600s is rejected; use background=true for longer commands.

Working directory for this command (absolute path). Defaults to the session working directory.

Run in pseudo-terminal (PTY) mode for interactive CLI tools like Codex, Claude Code, or Python REPL. Only works with local and SSH backends. Default: false.

When true (and background=true), you'll be automatically notified exactly once when the process finishes. **This is the right choice for almost every long-running task** — tests, builds, deployments, multi-item batch jobs, anything that takes over a minute and has a defined end. Use this and keep working on other things; the system notifies you on exit. MUTUALLY EXCLUSIVE with watch_patterns — when both are set, watch_patterns is dropped.

Strings to watch for in background process output. HARD RATE LIMIT: at most 1 notification per 15 seconds per process — matches arriving inside the cooldown are dropped. After 3 consecutive 15-second windows with dropped matches, watch_patterns is automatically disabled for that process and promoted to notify_on_complete behavior (one notification on exit, no more mid-process spam). USE ONLY for truly rare, one-shot mid-process signals on LONG-LIVED processes that will never exit on their own — e.g. ['Application startup complete'] on a server so you know when to hit its endpoint, or ['migration done'] on a daemon. DO NOT use for: (1) end-of-run markers like 'DONE'/'PASS' — use notify_on_complete instead; (2) error patterns like 'ERROR'/'Traceback' in loops or multi-item batch jobs — they fire on every iteration and you'll hit the strike limit fast; (3) anything you'd ever combine with notify_on_complete. When in doubt, choose notify_on_complete. MUTUALLY EXCLUSIVE with notify_on_complete — set one, not both.

Convert text to speech audio. Returns a MEDIA: path that the platform delivers as native audio. Compatible providers render as a voice bubble on Telegram; otherwise audio is sent as a regular attachment. In CLI mode, saves to ~/voice-memos/. Voice and provider are user-configured (built-in providers like edge/openai or custom command providers under tts.providers.<name>), not model-selected.

The text to convert to speech. Provider-specific character caps apply and are enforced automatically (OpenAI 4096, xAI 15000, MiniMax 10000, ElevenLabs 5k-40k depending on model); over-long input is truncated.

Optional custom file path to save the audio. Defaults to ~/.hermes/audio_cache/<timestamp>.mp3

todo

Manage your task list for the current session. Use for complex tasks with 3+ steps or when the user provides multiple tasks. Call with no parameters to read the current list.

Writing:
- Provide 'todos' array to create/update items
- merge=false (default): replace the entire list with a fresh plan
- merge=true: update existing items by id, add any new ones

Each item: {id: string, content: string, status: pending|in_progress|completed|cancelled}
List order is priority. Only ONE item in_progress at a time.
Mark items completed immediately when done. If something fails, cancel it and add a revised item.

Always returns the full current list.

Task items to write. Omit to read current list.

Unique item identifier

Task description

Current status

true: update existing items by id, add new ones. false (default): replace the entire list.

Inspect an image from a URL, file path, or tool output when you need closer detail than what's visible in the conversation. If the user's image is already attached to the conversation and you can see it, just answer directly — only call this tool for images referenced by URL/path, images returned inside other tool results (browser screenshots, search thumbnails), or when you need a deeper look at a specific region the main model's vision may have missed.

Image URL (http/https) or local file path to analyze.

Your specific question or request about the image to resolve. The AI will automatically provide a complete image description AND answer your specific question.

Write content to a file, completely replacing existing content. Use this instead of echo/cat heredoc in terminal. Creates parent directories automatically. OVERWRITES the entire file — use 'patch' for targeted edits.

Path to the file to write (will be created if it doesn't exist, overwritten if it does)

Complete content to write to the file


# Tier 0 verification — your view from the VPS side

You read the vault via the git clone at
/home/ccuser/rateright-growth/HQ-Vault/ (or wherever it's mounted).

Different access path than Cowork (which reads Windows directly).
I want both views to triangulate.

## What I need

### 1. Git sync state
When was the vault last pulled? git log -1 --format='%ai %s'
in the vault directory. I want to know how stale your view is
vs the Windows source of truth.

### 2. VPS service state
- systemctl is-active hermes-gateway clawdbot-opsman rivet-voice
- pm2 status — full output
- Any zombie processes still running?
- df -h — disk space (yesterday's cleanup freed ~3GB, confirm)

### 3. Hermes' own state
- hermes status — full output
- Last 5 cron jobs that ran (success/failure)
- Skill library — list current skills, flag any added in last 48h
- Curator log — has it run? When? What did it do?

### 4. Vault state from your read
- Last 3 daily notes by modified date
- Current Open-Threads count and status
- Any Truth-Audit files in _System/Investigations/

### 5. Connectivity to RateRight infra
- Can you reach the Supabase API right now? Test with a curl
  using the current service-role key from env
- Can you reach the production app? Curl rateright.com.au,
  report status
- Any other critical service health checks worth running

## Output

Structured report. Status codes, timestamps, command outputs.
No narrative.

## Rules
- Don't restart anything that's down without flagging it first.
- Don't run hermes update or curator manually — read-only check.
- If a command fails, paste the actual error.


Running Tier 0 verification now. Commands fire simultaneously.

Explanation: Let me run through all these verification checks systematically. I'll execute multiple commands in parallel where possible.

terminal

cd /home/ccuser/rateright-growth/HQ-Vault && git log -1 --format='%ai %s'

systemctl is-active hermes-gateway clawdbot-opsman rivet-voice 2>&1

ps aux | grep -E '(defunct|Z)' | grep -v grep


{"output": "2026-05-03 06:33:58 +1000 coo: rateright.com.au back up — Hermes WhatsApp bridge to :3500", "exit_code": 0, "error": null}

[Subdirectory context discovered: /home/ccuser/rateright-growth/CLAUDE.md]
# CLAUDE.md — rateright-growth repo

This is the `rateright-growth` repo. It contains:

- `HQ-Vault/` — the Obsidian vault, single source of truth for the multi-agent team. **Read `HQ-Vault/_System/CLAUDE.md` first.**
- `scripts/` — server scripts (hunt, campaign, vault-verify, etc.)
- `src/`, `admin/` — Growth Engine CRM (Vite + React + Express + Supabase)
- `supabase/` — DB migrations
- `rivet/`, `harper/`, `cog/` — pre-2026-04-29 hibernation fleet artefacts. Mostly stale; trust live VPS state, not these docs.
- `the-50-dollar-app/` — separate sibling repo for the RateRight v2 platform (referenced via VPS, not nested here)

## Where to read first

If you're a Claude Code instance starting up:

1. **This file** — orientation only
2. **`HQ-Vault/_System/CLAUDE.md`** — global AI Team Protocol (lane rules, write protocol, commit format, append-only rule, hard rules)
3. **The `_Brain/CLAUDE.md` for the project folder you're working in:**
   - `HQ-Vault/10_RateRight/_Brain/CLAUDE.md` for RateRight platform / hunt / growth
   - `HQ-Vault/11_OpsMan_LFCS/_Brain/CLAUDE.md` for Hermes / OpsMan / VPS ops
   - `HQ-Vault/12_SiteOps/_Brain/CLAUDE.md` for site-specific ops
4. **The project folder's `_Brain/_Log.md`** (full file — append-only one-liners) and recent `_AgentLog/` entries

## VPS

- IP: `134.199.153.159`
- SSH: `ssh root@134.199.153.159`
- Repo path on VPS: `/home/ccuser/rateright-growth`
- Two-way auto-sync: `*/30 * * * * scripts/auto-sync.sh` does `git pull --rebase` + `git add -A` + `git commit -m "auto-sync: ..."` + `git push`. Excludes `.env`, `*.env`, `secrets.json`.

## What changed (2026-05-01)

- The 8-agent fleet (Rivet, Builder, Susan, Harper, Sentinel, Radar, Herald, Cog) was hibernated 2026-04-29. **`rivet/SYSTEM.md` and similar fleet docs are stale** — historical reference only.
- Survivors on the VPS: `hermes-gateway`, `clawdbot-opsman`, `rivet-voice` (systemd) + PM2 hunt fleet + growth-engine.
- The previous repo-level `CLAUDE.md` is archived at `HQ-Vault/_Archive/CC-VPS-CLAUDE-pre-hibernation.md`.

## Hard rules

- Never commit secrets (`.env`, API keys, full bot tokens) — `auto-sync.sh` excludes the obvious files but assume the rule, not the script.
- Never edit `vault/` (the off-limits CC-VPS Obsidian vault — different operator).
- Per `HQ-Vault/_System/CLAUDE.md`: append-only on daily notes, `_Log.md`, and `_AgentLog/`. No deletions; move to `_Archive/`. Read-before-edit.


Output:
active
active
active


Output:
┌────┬─────────────────────┬─────────────┬─────────┬─────────┬──────────┬────────┬──────┬───────────┬──────────┬──────────┬──────────┬──────────┐
│ id │ name                │ namespace   │ version │ mode    │ pid      │ uptime │ ↺    │ status    │ cpu      │ mem      │ user     │ watching │
├────┼─────────────────────┼─────────────┼─────────┼─────────┼──────────┼────────┼──────┼───────────┼──────────┼──────────┼──────────┼──────────┤
│ 0  │ cc                  │ default     │ N/A     │ fork    │ 1021519  │ 50D    │ 4    │ online    │ 0%       │ 6.2mb    │ root     │ disabled │
│ 2  │ growth-engine       │ default     │ 1.0.0   │ fork    │ 852288   │ 51D    │ 8    │ online    │ 0%       │ 120.5mb  │ root     │ disabled │
│ 5  │ hunt-aggregator     │ default     │ 1.0.0   │ fork    │ 0        │ 0      │ 0    │ stopped   │ 0%       │ 0b       │ root     │ disabled │
│ 7  │ hunt-contractors    │ default     │ 1.0.0   │ fork    │ 0        │ 0      │ 0    │ stopped   │ 0%       │ 0b       │ root     │ disabled │
│ 8  │ hunt-matchmaker     │ default     │ 1.0.0   │ fork    │ 0        │ 0      │ 0    │ stopped   │ 0%       │ 0b       │ root     │ disabled │
│ 10 │ hunt-monitor        │ default     │ 1.0.0   │ fork    │ 2771150  │ 4D     │ 0    │ online    │ 0%       │ 87.3mb   │ root     │ disabled │
│ 9  │ hunt-outreach       │ default     │ 1.0.0   │ fork    │ 2771147  │ 4D     │ 0    │ online    │ 0%       │ 86.4mb   │ root     │ disabled │
│ 6  │ hunt-workers        │ default     │ 1.0.0   │ fork    │ 0        │ 0      │ 0    │ stopped   │ 0%       │ 0b       │ root     │ disabled │
└────┴─────────────────────┴─────────────┴─────────┴─────────┴──────────┴────────┴──────┴───────────┴──────────┴──────────┴──────────┴──────────┘


Output: USER         PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND


Output:
Filesystem      Size  Used Avail Use% Mounted on
/dev/vda1        77G   53G   25G  69% /
/dev/vda1        77G   53G   25G  69% /
/dev/vda1        77G   53G   25G  69% /


Explanation: Good, first batch done. Now running Hermes status, cron list, skills list, curator log, and vault state queries.

cat ~/.hermes/logs/curator.log 2>&1 | tail -30

find /home/ccuser/rateright-growth/HQ-Vault/11_OpsMan_LFCS/daily -name '*.md' -printf '%T+ %p\n' | sort -r | head -5


Output:
┌─────────────────────────────────────────────────────────┐
│                 ⚕ Hermes Agent Status                  │
└─────────────────────────────────────────────────────────┘

◆ Environment
  Project:      /usr/local/lib/hermes-agent
  Python:       3.11.15
  .env file:    ✓ exists
  Model:        MiniMax-M2.7
  Provider:     MiniMax

◆ API Keys
  OpenRouter    ✓ sk-o...18db
  OpenAI        ✓ sk-p...-6kA
  NVIDIA        ✗ (not set)
  Z.AI/GLM      ✗ (not set)
  Kimi          ✗ (not set)
  StepFun Step Plan  ✗ (not set)
  MiniMax       ✓ sk-a...lLk4
  MiniMax-CN    ✗ (not set)
  Firecrawl     ✗ (not set)
  Tavily        ✗ (not set)
  Browser Use   ✗ (not set)
  Browserbase   ✗ (not set)
  FAL           ✗ (not set)
  Tinker        ✗ (not set)
  WandB         ✗ (not set)
  ElevenLabs    ✗ (not set)
  GitHub        ✗ (not set)
  Anthropic     ✗ (not set)

◆ Auth Providers
  Nous Portal   ✗ not logged in (run: hermes auth add nous --type oauth)
  OpenAI Codex  ✗ not logged in (run: hermes model)
    Auth file:  /root/.hermes/auth.json
    Error:      No Codex credentials stored. Run `hermes auth` to authenticate.
  Qwen OAuth    ✗ not logged in (run: qwen auth qwen-oauth)
    Auth file:  /root/.qwen/oauth_creds.json
    Error:      Qwen CLI credentials not found. Run 'qwen auth qwen-oauth' first.
  MiniMax OAuth  ✗ not logged in (run: hermes auth add minimax-oauth)

◆ API-Key Providers
  Z.AI / GLM       ✗ not configured (run: hermes model)
  Kimi / Moonshot  ✗ not configured (run: hermes model)
  StepFun Step Plan ✗ not configured (run: hermes model)
  MiniMax          ✓ configured
  MiniMax (China)  ✗ not configured (run: hermes model)

◆ Terminal Backend
  Backend:      local
  Sudo:         ✗ disabled

◆ Messaging Platforms
  Telegram      ✓ configured (home: 7377499346)
  Discord       ✗ not configured
  WhatsApp      ✓ configured
  Signal        ✗ not configured
  Slack         ✗ not configured
  Email         ✗ not configured
  SMS           ✗ not configured
  DingTalk      ✗ not configured
  Feishu        ✗ not configured
  WeCom         ✗ not configured
  WeCom Callback  ✗ not configured
  Weixin        ✗ not configured
  BlueBubbles   ✗ not configured
  QQBot         ✗ not configured
  Yuanbao       ✗ not configured

◆ Gateway Service
  Status:       ✓ running
  Manager:      systemd (system)
  PID(s):       619834

◆ Scheduled Jobs
  Jobs:         3 active, 4 total

◆ Sessions
  Active:       3 session(s)

────────────────────────────────────────────────────────────
  Run 'hermes doctor' for detailed diagnostics
  Run 'hermes setup' to configure


opsman-watchdog-hourly

Run "openclaw health --json" and "systemctl is-active clawdbot-opsman". If openclaw health returns o...

lfcs-am-lookahead

AM look-ahead for Rocky on Hornsby (or whichever job is active in Jobs/Ongoing Jobs/ or Jobs/Upcomin...

lfcs-eod-summary

EOD summary for Rocky on Hornsby (active job). Read todays diary file in 07d Daily Diary/. Read 07a ...

lfcs-weekly-programme

Weekly programme update for Rocky on Hornsby. Read 04 Programme/programme-24wk.md to know which week...


chat-bootstrap

Read RateRight vault files and output a single mobile-friendly vault snapshot for Chat. One swipe = everything.

dogfood

Exploratory QA of web apps: find bugs, evidence, reports.

lfcs

LF Construction Services site operations — job tracking, correspondence, inspections, RFIs, dockets, EOD summaries, and pre-pour checks. All skills share the same job folder structure under lfcs.jobs_root.

whatsapp-bridge-setup

Configure OpenClaw WhatsApp bridge for Hermes with read-only group policy and error routing to ops DM.

claude-code

Delegate coding to Claude Code CLI (features, PRs).

codex

Delegate coding to OpenAI Codex CLI (features, PRs).

hermes-agent

Configure, extend, or contribute to Hermes Agent.

opencode

Delegate coding to OpenCode CLI (features, PR review).

comfyui

Generate images, video, and audio with ComfyUI — install, launch, manage nodes/models, run workflows with parameter injection. Uses the official comfy-cli for lifecycle and direct REST/WebSocket API for execution.

pretext

Use when building creative browser demos with @chenglou/pretext — DOM-free text layout for ASCII art, typographic flow around obstacles, text-as-geometry games, kinetic typography, and text-powered generative art. Produces single-file HTML demos by default.

sketch

Throwaway HTML mockups: 2-3 design variants to compare.

jupyter-live-kernel

Iterative Python via live Jupyter kernel (hamelnb).

kanban-orchestrator

Decomposition playbook + specialist-roster conventions + anti-temptation rules for an orchestrator profile routing work through Kanban. The "don't do the work yourself" rule and the basic lifecycle are auto-injected into every kanban worker's system prompt; this skill is the deeper playbook when you're specifically playing the orchestrator role.

kanban-worker

Pitfalls, examples, and edge cases for Hermes Kanban workers. The lifecycle itself is auto-injected into every worker's system prompt as KANBAN_GUIDANCE (from agent/prompt_builder.py); this skill is what you load when you want deeper detail on specific scenarios.

webhook-subscriptions

Webhook subscriptions: event-driven agent runs.

himalaya

Himalaya CLI: IMAP/SMTP email from terminal.

codebase-inspection

Inspect codebases w/ pygount: LOC, languages, ratios.

github-auth

GitHub auth setup: HTTPS tokens, SSH keys, gh CLI login.

github-code-review

Review PRs: diffs, inline comments via gh or REST.

github-issues

Create, triage, label, assign GitHub issues via gh or REST.

github-pr-workflow

GitHub PR lifecycle: branch, commit, open, CI, merge.

github-repo-management

Clone/create/fork repos; manage remotes, releases.

native-mcp

MCP client: connect servers, register tools (stdio/HTTP).

obsidian

Read, search, and create notes in the Obsidian vault.

airtable

Airtable REST API via curl. Records CRUD, filters, upserts.

google-workspace

Gmail, Calendar, Drive, Docs, Sheets via gws CLI or Python.

linear

Linear: manage issues, projects, teams via GraphQL + curl.

maps

Geocode, POIs, routes, timezones via OpenStreetMap/OSRM.

nano-pdf

Edit PDF text/typos/titles via nano-pdf CLI (NL prompts).

notion

Notion API via curl: pages, databases, blocks, search.

ocr-and-documents

Extract text from PDFs/scans (pymupdf, marker-pdf).

powerpoint

Create, read, edit .pptx decks, slides, notes, templates.

debugging-hermes-tui-commands

Debug Hermes TUI slash commands: Python, gateway, Ink UI.

hermes-agent-skill-authoring

Author in-repo SKILL.md: frontmatter, validator, structure.

node-inspect-debugger

Debug Node.js via --inspect + Chrome DevTools Protocol CLI.

plan

Plan mode: write markdown plan to .hermes/plans/, no exec.

python-debugpy

Debug Python: pdb REPL + debugpy remote (DAP).

requesting-code-review

Pre-commit review: security scan, quality gates, auto-fix.

spike

Throwaway experiments to validate an idea before build.

subagent-driven-development

Execute plans via delegate_task subagents (2-stage review).

systematic-debugging

4-phase root cause debugging: understand bugs before fixing.

test-driven-development

TDD: enforce RED-GREEN-REFACTOR, tests before code.

writing-plans

Write implementation plans: bite-sized tasks, paths, code.

Use skill_view(name) to see full content, tags, and linked files


Output: cat: /root/.hermes/logs/curator.log: No such file or directory


Output: find: ‘/home/ccuser/rateright-growth/HQ-Vault/11_OpsMan_LFCS/daily’: No such file or directory


Explanation:
Some paths are wrong. Let me fix them:
- curator.log might be elsewhere
- daily notes path is wrong - need to find the right path

Let me check the vault structure and find the right paths.

terminal

find /home/ccuser/rateright-growth/HQ-Vault -name "*.md" -path "*/daily/*" -printf '%T+ %p\n' 2>/dev/null | sort -r | head -5

find /home/ccuser/rateright-growth/HQ-Vault/_System/Investigations -type f 2>/dev/null | head -20

grep -r "Open-Threads\|open-threads\|thread" /home/ccuser/rateright-growth/HQ-Vault/11_OpsMan_LFCS/*.md /home/ccuser/rateright-growth/HQ-Vault/11_OpsMan_LFCS/**/*.md 2>/dev/null | grep -i "open" | head -10

cat /home/ccuser/rateright-growth/HQ-Vault/11_OpsMan_LFCS/_Brain/CLAUDE.md 2>/dev/null | head -50


{"output": "/home/ccuser/rateright-growth/HQ-Vault/_System/Investigations/Team-Gap-Analysis.md\n/home/ccuser/rateright-growth/HQ-Vault/_System/Investigations/Vault-Migration-Audit-2026-05-01.md\n/home/ccuser/rateright-growth/HQ-Vault/_System/Investigations/Vault-Deep-Dive-Audit-2026-05-01.md\n/home/ccuser/rateright-growth/HQ-Vault/_System/Investigations/Truth-Audit-2026-05-02.md\n/home/ccuser/rateright-growth/HQ-Vault/_System/Investigations/Hunt-Approval-Bottleneck.md\n/home/ccuser/rateright-growth/HQ-Vault/_System/Investigations/Cowork-Review-2026-05-01.md", "exit_code": 0, "error": null}

[Subdirectory context discovered: /home/ccuser/rateright-growth/HQ-Vault/_System/CLAUDE.md]
# Global Instructions

## How I work
- Direct, terse, evidence-first. No fluff.
- Investigate before acting.
- Push back when I'm wrong. I'll do the same.
- Don't ask permission for routine logging — just do it.

## Journaling rule — every session
At the end of every Cowork or Claude Code session, append to `01_Daily/{today}.md` under a timestamped heading (`## HH:MM — short title`):
- Decisions made (and why)
- Blockers hit (and current workaround)
- Insights / offhand thoughts worth keeping
- Action items
- Resume notes — what I'd need if I picked this up in a month

If the daily note doesn't exist, create it from `_System/Templates/Daily.md`.

If the work clearly belongs to a project folder, also append a one-liner with a backlink to that project's `_Log.md`.

## Where things go
- Project work → `1X_*` folder + log entry in its `_Log.md`
- Personal → `20_Personal/`
- Long-game thinking → `30_Goals/`
- Notes about people → `40_People/{Name}.md`
- Unsorted capture → `00_Inbox/`

## Don't
- Don't store sensitive data (passwords, card numbers) in notes.
- Don't over-summarise. Better to log my actual words than your interpretation.
- Don't create new top-level folders without asking.

## Scratch space for agents
Agents needing scratch space use `_System/Scratch/` (gitignored). No new top-level folders without approval.

## AI Team Protocol

The vault at `HQ-Vault/` is the single source of truth for a multi-agent team. If work isn't logged here, it didn't happen.

### The team — three layers

**Layer 1 — Strategy (Rocky + Claude in chat)**
Strategic thinking, irreversible decisions, McElligott calls, hire/no-hire, anything that shouldn't be delegated. Claude in chat does not write to the vault directly — Rocky pastes outputs into `00_Inbox/` or asks Cowork to log them.

**Layer 2 — Project Management (Cowork + Claude Code)**
Cowork on desktop: non-code work, vault curation, drafting, outreach, planning. Claude Code in terminal: anything touching a codebase. Each Claude Code instance is scoped to one project folder.

**Layer 3 — Operations (Hermes + OpenClaw on VPS)**
24/7 autonomous execution. Hermes manages and dispatches; OpenClaw executes. Each agent is scoped to one project. They reach the vault via git pull/push.

### Lane rules

- One Project Management agent per project folder at a time. If Cowork is curating `10_RateRight/`, Claude Code is not concurrently editing it.
- One Operations agent per data source. Hermes owns Stripe OR OpenClaw owns Stripe — not both.
- The Curator (scheduled Cowork pass) only runs when no synchronous session is active. Schedule for early morning or evening.
- Operations agents (Hermes, OpenClaw) do not edit project content files. They write to `_AgentLog/` and append to `_Log.md`. Content edits go through Project Management.
- Rocky writes anywhere, anytime. He's the operator, not an agent.

### Boot sequence — every agent, every session

Read in this order before doing any work:

1. `_System/CLAUDE.md` (this file)
2. `_System/TeamProtocol.md` if it exists separately
3. The relevant project folder's `_Brain/CLAUDE.md`
4. `_Brain/_Log.md` (full file — it's append-only one-liners)
5. `_AgentLog/` for the project (last 7 days)
6. `01_Daily/` (last 7 days)
7. `_Brain/README.md` (the MOC)

If the work is cross-project, also read `_System/CrossProject.md`.

### Write protocol — every session, three writes minimum

1. **Daily note** — append to `01_Daily/{today}.md` under a new heading:
   `## HH:MM — {agent name} — {short title}`
   Include: decisions made, blockers hit, insights, action items, resume notes.

2. **Project log** — append a one-liner to `{project}/_Brain/_Log.md`:
   `- YYYY-MM-DD HH:MM — {agent} — {one-line summary} → [[Daily/{today}#HH:MM]]`

3. **Agent log (autonomous agents only)** — append to `{project}/_AgentLog/{agent}-{YYYY-MM-DD}.md`:
   What was attempted, what succeeded, what failed, what was changed.

### Append-only rule

Daily notes, `_Log.md` files, and `_AgentLog/` files are append-only across all agents. Never edit prior entries. If something prior was wrong, append a correction note with a backlink to the original — don't rewrite history.

### Commit protocol

Every session ends with a git commit and push:

```
{agent}: {short summary}
```

Examples:
- `cowork: hostel campaign draft + log entry`
- `claude-code-rr: stripe webhook handler patched`
- `hermes-rr: processed 7 worker applications`
- `openclaw: nightly campaign metric pull`
- `rocky: manual capture from phone`

For autonomous agents on the VPS: `git pull` before reading, `git add && git commit && git push` after writing. If push is rejected, pull, merge (append-only files merge cleanly), retry.

### Conflict handling

- Append-only files almost never conflict. If they do, both agents' content survives — git merges by line.
- For project content files (notes inside `Business/`, `Operations/`, `Codebase/`): if a conflict happens, the second agent stops, logs to `_System/Conflicts.md` with the file path and both attempted changes, and waits for Rocky.
- Never auto-resolve a conflict on a content file. Halt and flag.

### Scratch and temp

Agents needing scratch or temp space write to `_System/Scratch/` (gitignored). Do not create top-level folders without Rocky's approval.

### Read-before-edit

Never edit a file you haven't just read in the current session. The vault changes underneath you when other agents commit; assume your last view of a file is stale.

### Hard rules — never violated

- **No deletions.** Move to `_Archive/` if something looks dead. Nothing is ever deleted from `_Archive/` without explicit approval from Rocky.
- **No body edits without reading first.** Frontmatter, filenames, and link fixes can be done without reading the body. Body content cannot.
- **No new top-level folders without approval.** Project subfolders are fine; vault-level structure is locked.
- **No sensitive data in notes.** Passwords, full card numbers, API keys, SSO tokens. Reference them by name, store the secret elsewhere.
- **No content invention.** If you don't know something, say so. Don't fill gaps with plausible-sounding fiction.

### The comeback protocol

When Rocky asks for a sit-rep after a break, the response format is:

1. **Stalled** — what's been static and shouldn't be
2. **Hot** — what's moving and needs attention
3. **Promised, not done** — things Rocky said he'd do but didn't
4. **Autonomous activity** — what Hermes/OpenClaw did in his absence
5. **Pick up first** — single highest-priority item

Read last 14 days of dailies, all `_Log.md` files, and `_AgentLog/`. Output: terse bullets, no preamble, no padding.

### How to write logs

- Terse. Bullets. No prose paragraphs.
- Past tense for what happened. Imperative for action items.
- Include the *why* not just the *what* when the why isn't obvious.
- If the session produced a deliverable (file, decision, code), link to it.
- If the session ended inconclusively, write what would unblock it.

### What not to do

- Don't summarise so heavily that the actual content is lost. Better to log Rocky's exact words than your interpretation.
- Don't pad logs to look thorough. "Nothing changed" is a valid log entry.
- Don't ask permission for routine logging. Just do it.
- Don't propose follow-up work in logs unless asked. Capture state, not opinions about state.

### Surface-specific notes

**Cowork** — runs scheduled curator passes per its project instructions. Has authority to fix frontmatter, repair links, archive stale notes, and queue decisions. Does not have authority to delete, restructure, or edit body content.

**Claude Code instances** — each one has its own `_Brain/CLAUDE.md` in the project it's scoped to. That file extends this protocol with project-specific context.

**Hermes** — one instance per project. Reads vault for context before each task cycle. Writes to its project's `_AgentLog/`. Cannot cross project boundaries without Rocky's explicit instruction.

**OpenClaw**

[...truncated CLAUDE.md: 8,239 chars total]


Output:
agent.log
curator
errors.log
gateway.log


{"output": "# OpsMan_LFCS context\n\n<!-- Rocky to fill in: what this project is, current priorities, stack/tools, key people, anything an AI needs to know to be useful here. -->\n\nLog decisions to `_Log.md`.", "exit_code": 0, "error": null}

[Subdirectory context discovered: /home/ccuser/rateright-growth/HQ-Vault/11_OpsMan_LFCS/_Brain/CLAUDE.md]
# OpsMan_LFCS context

<!-- Rocky to fill in: what this project is, current priorities, stack/tools, key people, anything an AI needs to know to be useful here. -->

Log decisions to `_Log.md`.


Explanation: The daily directory structure isn't in the expected location. Let me find where daily notes are actually stored in the vault, and also check the Open-Threads file. Also need to find the curator log.

cat ~/.hermes/logs/curator 2>&1 | tail -30

find /home/ccuser/rateright-growth/HQ-Vault -name "*.md" -path "*01_Daily*" -printf '%T+ %p\n' 2>/dev/null | sort -r | head -5

find /home/ccuser/rateright-growth/HQ-Vault -name "*Open-Thread*" -o -name "*open-thread*" 2>/dev/null | head -10

source /usr/local/lib/hermes-agent/.env 2>/dev/null; echo "SUPABASE_URL=${SUPABASE_URL:-NOT_SET}"; echo "SUPABASE_SERVICE_ROLE_KEY present: $(grep -c 'SUPABASE_SERVICE_ROLE_KEY' /usr/local/lib/hermes-agent/.env 2>/dev/null || echo 0)"

curl -s -o /dev/null -w "%{http_code}" https://rateright.com.au 2>&1


Output: cat: /root/.hermes/logs/curator: Is a directory


Output:
2026-05-03+07:00:02.9644549370 /home/ccuser/rateright-growth/HQ-Vault/01_Daily/2026-05-03.md
2026-05-02+19:30:03.1633558940 /home/ccuser/rateright-growth/HQ-Vault/01_Daily/2026-05-02.md
2026-05-01+21:30:03.6135151600 /home/ccuser/rateright-growth/HQ-Vault/01_Daily/2026-05-01.md
2026-05-01+20:30:04.0918462520 /home/ccuser/rateright-growth/HQ-Vault/01_Daily/2026-03-30.md
2026-05-01+20:30:04.0908462450 /home/ccuser/rateright-growth/HQ-Vault/01_Daily/2026-03-25.md


{"output": "SUPABASE_URL=NOT_SET\nSUPABASE_SERVICE_ROLE_KEY present: 0\n0", "exit_code": 0, "error": null}

[Subdirectory context discovered: /usr/local/lib/hermes-agent/AGENTS.md]
# Hermes Agent - Development Guide

Instructions for AI coding assistants and developers working on the hermes-agent codebase.

## Development Environment

```bash
# Prefer .venv; fall back to venv if that's what your checkout has.
source .venv/bin/activate   # or: source venv/bin/activate
```

`scripts/run_tests.sh` probes `.venv` first, then `venv`, then
`$HOME/.hermes/hermes-agent/venv` (for worktrees that share a venv with the
main checkout).

## Project Structure

File counts shift constantly — don't treat the tree below as exhaustive.
The canonical source is the filesystem. The notes call out the load-bearing
entry points you'll actually edit.

```
hermes-agent/
├── run_agent.py          # AIAgent class — core conversation loop (~12k LOC)
├── model_tools.py        # Tool orchestration, discover_builtin_tools(), handle_function_call()
├── toolsets.py           # Toolset definitions, _HERMES_CORE_TOOLS list
├── cli.py                # HermesCLI class — interactive CLI orchestrator (~11k LOC)
├── hermes_state.py       # SessionDB — SQLite session store (FTS5 search)
├── hermes_constants.py   # get_hermes_home(), display_hermes_home() — profile-aware paths
├── hermes_logging.py     # setup_logging() — agent.log / errors.log / gateway.log (profile-aware)
├── batch_runner.py       # Parallel batch processing
├── agent/                # Agent internals (provider adapters, memory, caching, compression, etc.)
├── hermes_cli/           # CLI subcommands, setup wizard, plugins loader, skin engine
├── tools/                # Tool implementations — auto-discovered via tools/registry.py
│   └── environments/     # Terminal backends (local, docker, ssh, modal, daytona, singularity)
├── gateway/              # Messaging gateway — run.py + session.py + platforms/
│   ├── platforms/        # Adapter per platform (telegram, discord, slack, whatsapp,
│   │                     #   homeassistant, signal, matrix, mattermost, email, sms,
│   │                     #   dingtalk, wecom, weixin, feishu, qqbot, bluebubbles,
│   │                     #   webhook, api_server, ...). See ADDING_A_PLATFORM.md.
│   └── builtin_hooks/    # Extension point for always-registered gateway hooks (none shipped)
├── plugins/              # Plugin system (see "Plugins" section below)
│   ├── memory/           # Memory-provider plugins (honcho, mem0, supermemory, ...)
│   ├── context_engine/   # Context-engine plugins
│   └── <others>/         # Dashboard, image-gen, disk-cleanup, examples, ...
├── optional-skills/      # Heavier/niche skills shipped but NOT active by default
├── skills/               # Built-in skills bundled with the repo
├── ui-tui/               # Ink (React) terminal UI — `hermes --tui`
│   └── src/              # entry.tsx, app.tsx, gatewayClient.ts + app/components/hooks/lib
├── tui_gateway/          # Python JSON-RPC backend for the TUI
├── acp_adapter/          # ACP server (VS Code / Zed / JetBrains integration)
├── cron/                 # Scheduler — jobs.py, scheduler.py
├── environments/         # RL training environments (Atropos)
├── scripts/              # run_tests.sh, release.py, auxiliary scripts
├── website/              # Docusaurus docs site
└── tests/                # Pytest suite (~15k tests across ~700 files as of Apr 2026)
```

**User config:** `~/.hermes/config.yaml` (settings), `~/.hermes/.env` (API keys only).
**Logs:** `~/.hermes/logs/` — `agent.log` (INFO+), `errors.log` (WARNING+),
`gateway.log` when running the gateway. Profile-aware via `get_hermes_home()`.
Browse with `hermes logs [--follow] [--level ...] [--session ...]`.

## File Dependency Chain

```
tools/registry.py  (no deps — imported by all tool files)
       ↑
tools/*.py  (each calls registry.register() at import time)
       ↑
model_tools.py  (imports tools/registry + triggers tool discovery)
       ↑
run_agent.py, cli.py, batch_runner.py, environments/
```

---

## AIAgent Class (run_agent.py)

The real `AIAgent.__init__` takes ~60 parameters (credentials, routing, callbacks,
session context, budget, credential pool, etc.). The signature below is the
minimum subset you'll usually touch — read `run_agent.py` for the full list.

```python
class AIAgent:
    def __init__(self,
        base_url: str = None,
        api_key: str = None,
        provider: str = None,
        api_mode: str = None,              # "chat_completions" | "codex_responses" | ...
        model: str = "",                   # empty → resolved from config/provider later
        max_iterations: int = 90,          # tool-calling iterations (shared with subagents)
        enabled_toolsets: list = None,
        disabled_toolsets: list = None,
        quiet_mode: bool = False,
        save_trajectories: bool = False,
        platform: str = None,              # "cli", "telegram", etc.
        session_id: str = None,
        skip_context_files: bool = False,
        skip_memory: bool = False,
        credential_pool=None,
        # ... plus callbacks, thread/user/chat IDs, iteration_budget, fallback_model,
        # checkpoints config, prefill_messages, service_tier, reasoning_config, etc.
    ): ...

    def chat(self, message: str) -> str:
        """Simple interface — returns final response string."""

    def run_conversation(self, user_message: str, system_message: str = None,
                         conversation_history: list = None, task_id: str = None) -> dict:
        """Full interface — returns dict with final_response + messages."""
```

### Agent Loop

The core loop is inside `run_conversation()` — entirely synchronous, with
interrupt checks, budget tracking, and a one-turn grace call:

```python
while (api_call_count < self.max_iterations and self.iteration_budget.remaining > 0) \
        or self._budget_grace_call:
    if self._interrupt_requested: break
    response = client.chat.completions.create(model=model, messages=messages, tools=tool_schemas)
    if response.tool_calls:
        for tool_call in response.tool_calls:
            result = handle_function_call(tool_call.name, tool_call.args, task_id)
            messages.append(tool_result_message(result))
        api_call_count += 1
    else:
        return response.content
```

Messages follow OpenAI format: `{"role": "system/user/assistant/tool", ...}`.
Reasoning content is stored in `assistant_msg["reasoning"]`.

---

## CLI Architecture (cli.py)

- **Rich** for banner/panels, **prompt_toolkit** for input with autocomplete
- **KawaiiSpinner** (`agent/display.py`) — animated faces during API calls, `┊` activity feed for tool results
- `load_cli_config()` in cli.py merges hardcoded defaults + user config YAML
- **Skin engine** (`hermes_cli/skin_engine.py`) — data-driven CLI theming; initialized from `display.skin` config key at startup; skins customize banner colors, spinner faces/verbs/wings, tool prefix, response box, branding text
- `process_command()` is a method on `HermesCLI` — dispatches on canonical command name resolved via `resolve_command()` from the central registry
- Skill slash commands: `agent/skill_commands.py` scans `~/.hermes/skills/`, injects as **user message** (not system prompt) to preserve prompt caching

### Slash Command Registry (`hermes_cli/commands.py`)

All slash commands are defined in a central `COMMAND_REGISTRY` list of `CommandDef` objects. Every downstream consumer derives from this registry automatically:

- **CLI** — `process_command()` resolves aliases via `resolve_command()`, dispatches on canonical name
- **Gateway** — `GATEWAY_KNOWN_COMMANDS` frozenset for hook emission, `resolve_command()` for dispatch
- **Gateway help** — `gateway_help_lines()` generates `/help` output
- **Telegram** — `telegram_bot_commands()` generates the BotCommand menu
- **Slack** — `slack_subcommand_map()` generates `/hermes` subcommand routing
- **Autocomplete** — `COMMANDS` flat dict feeds `SlashCommandCompleter`
- **CLI help** — `COMMANDS_BY_CATEGORY` dict feeds `show_help()`

### Adding a Slash Command

1. Add a `CommandDef`

[...truncated AGENTS.md: 35,089 chars total]


Explanation:
Good progress. Let me now:
1. Get the curator log properly
2. Read the Open-Threads.md file
3. Check the Truth-Audit file
4. Get the Supabase service role key from env properly
5. Run a proper Supabase API test

cat ~/.hermes/logs/curator/$(ls -t ~/.hermes/logs/curator/ 2>/dev/null | head -1) 2>/dev/null | tail -30

cat /home/ccuser/rateright-growth/HQ-Vault/_System/Investigations/Truth-Audit-2026-05-02.md 2>/dev/null | head -40

grep -E "^SUPABASE" /usr/local/lib/hermes-agent/.env 2>/dev/null | sed 's/=.*/=***MASKED***/'


{"output": "---\ntitle: Open Threads — RateRight\ncreated: 2026-05-01\nupdated: 2026-05-02\ntype: action-list\nstatus: live\nrelated:\n  - \"[[Active]]\"\n---\n\n# Open Threads — RateRight\n\nSurfaced from the 2026-05-01 vault deep-dive ([[Vault-Migration-Audit-2026-05-01]]). These are dormant action items + decisions that need Rocky's call. Not auto-actioned because they're judgment-call items about Rocky's relationships, his money, or his time.\n\n**Updated 2026-05-02** after [[Truth-Audit-2026-05-02]] — three items moved to Resolved, one upgraded to emergency, one reframed.\n**Updated 2026-05-03** after Item 0 resolution — site back up; Stripe live key + Supabase service-role both validated; \"Unverifiable until Rocky drops a key\" thread contradicted.\n\n---\n\n## 🔴 The Stripe blocker (REFRAMED 2026-05-02)\n\n**Updated framing per [[Truth-Audit-2026-05-02]].** Stripe is **configured for LIVE mode** in `the-50-dollar-app/.env.local`:\n- `STRIPE_SECRET_KEY=sk_live_51Rx...`\n- `STRIPE_PUBLISHABLE_KEY=pk_live_51Rx...`\n- `STRIPE_WEBHOOK_SECRET=whsec_GKtr...`\n- `STRIPE_TEST_MODE=False`\n\nRecent commits (last 30 days) show production-grade Stripe code: payment verification, refund API, receipt emails, webhook replay protection, Stripe Checkout integration. **This is not test-mode-only code.**\n\n**But:** the live key in `.env.local` returned \"Invalid API Key\" when I tried it — either rotated or scrubbed. Doppler is installed but the token I have access to (`dp.st.dev.fDcTI9...`) doesn't grant `STRIPE_SECRET_KEY`. **Cannot confirm Stripe is processing real charges right now because (a) the app is down, (b) the key I can see doesn't authenticate.**\n\n**Decision needed:**\n- Rocky verifies live key via Stripe dashboard\n- Restores working key to wherever app reads from\n- Once app is back up, confirm Checkout → webhook → receipt → match-state pipeline end-to-end\n\n**Original Builder notes location** (still preserved): `vault/09-Agent-Archive/Builder/` — specifically `builder-updates.md`, `PRODUCT-SPEC.md`, `CLAUDE.md`.\n\n---\n\n## 🟡 Pawel Wolonciej — AWX Labour Hire\n\n**Last contact:** ~2026-02 (per `Revenue-Pipeline.md`).\n**Score:** 70 (hot lead at the time).\n**Days overdue for callback:** ~80.\n\n**Two options:**\n1. **Apologetic re-engage**: short honest email/SMS — \"Sorry I dropped this. Things got chaotic. Still here, still $50 flat. Want to grab 15 min?\" Probably acceptable; tradies are forgiving when you're straight with them.\n2. **Write off**: file under \"tried, missed window.\"\n\n**My read:** option 1 if you remember anything specific from the prior contact (his pain point, his timing). Option 2 if it was generic.\n\nThis is your relationship; your call.\n\n---\n\n## 🟡 Susan's dormant pipeline — 17 leads + 10 SMS drafts\n\n**State:** scored 65-85, drafts staged, **awaiting your approval since 2026-02-17 (~75 days)**.\n\n**Where it lives:** `vault/09-Agent-Archive/Susan/MEMORY.md` (284 lines, including refined value prop v4, full competitor intel circa Feb 2026, sales playbook, Sydney market intel).\n\n**Why I didn't migrate it as a live action queue:**\n- 75 days is too cold for the original drafts to hit \"as-is\"\n- hipages numbers (35K subscriber drop) need re-confirming\n- Airtasker numbers ($16.5M H1 loss) are H1 FY26; new data may have shifted\n- Hostel campaign has pivoted to Hunt — message angles may have moved\n\n**Recommended action:**\n- Read Susan's MEMORY.md (best 30 minutes you'll spend on RateRight; it's a polished playbook)\n- Triage the 17 leads: **kill the obviously cold (e.g. anyone who said \"not now\" months ago), keep the warm**\n- Refresh ONE SMS draft with current numbers, send to 3-5 of the warmest, see what happens\n- Either revive Susan to run this or extract her playbook into `10_RateRight/Business/Sales-Playbook.md` and run it yourself\n\n---\n\n## 🟡 Pending action items from 2026-03-30 — all RESOLVED per audit\n\nThe three \"still pending\" items were all wrong per [[Truth-Audit-2026-05-02]]. Moved to Resolved section below. Summary:\n\n- ~~Push local QR funnel code to VPS~~ → **DONE** since 2026-03-13 (commit `d8f5288`). Code at `the-50-dollar-app/src/app/go/page.tsx`. Currently unreachable because site is down.\n- ~~Drop finalized hostel poster PDF into vault~~ → **DONE** since 2026-03-12/13. PDFs in 4 vault locations.\n- ~~Hook up Google Workspace CLI on VPS~~ → **DONE** (gws 0.22.5 installed at /usr/bin/gws, configured at /root/.config/gws/).\n\nWhat's actually blocking now: **Item 0 (site down)** + **physical hostel mailout** (printing, postage, distribution — that step never happened, the PDF being available was always a red herring).\n\n---\n\n## 🟢 Things to NOT do (from the vault audit)\n\n- **Don't pursue MVP Ventures grant** — officially cancelled 2026-03-30 (Airwallex isn't ADI). Deadline 2026-04-05 has passed. Grant is dead. Harper looped on this for 30 days because the cancellation never propagated; don't repeat.\n- **Don't re-enable SMS** without explicit Rocky approval. (Per `_System/CLAUDE.md` hard rules — already in protocol.)\n- **Don't propose deletions of `vault/09-Agent-Archive/`.** Rocky said \"we might bring them back as we grow.\" Stays.\n\n---\n\n## ❓ ~~Unverifiable until Rocky drops a key~~ — CONTRADICTED 2026-05-03\n\n**Updated 2026-05-03 06:25 by claude-code-coo.** The premise was wrong. The VPS `.env.local` at `/home/ccuser/the-50-dollar-app/.env.local` (mtime 2026-02-23, unchanged for 70 days) actually contains real keys, not placeholders:\n- `NEXT_PUBLIC_SUPABASE_URL=https://eciepjpcyfurbkfzekok.supabase.co` ✓\n- `SUPABASE_SERVICE_ROLE_KEY` = 219-char real JWT (prefix `eyJhbGciOiJI`)\n- Validated against `/rest/v1/` (HTTP 200) and `/auth/v1/admin/users` (HTTP 200 + real user record)\n- **Live user already exists in marketplace**: `flodeliffre@gmail.com`, email confirmed 2026-04-17 (during the site-down window — provenance worth investigating).\n\nYesterday's audit was looking at the wrong env file (likely the local Windows sibling repo). Live numbers are queryable now via the VPS service-role key.\n\nGrowth-engine project (`memscjotxrzqnhrvnnkc`) numbers from yesterday remain valid: `leads=359, contact_registry=327, scraped_leads=4, aggregated_jobs=3` (CRM-side, not platform-user-side).\n\n---\n\n## ✅ Recently resolved (verified 2026-05-02 / 2026-05-03)\n\n| Item | Resolved | Evidence |\n|---|---|---|\n| QR funnel push to VPS | **2026-03-13** | Commit `d8f5288 feat: add /go and /hire QR campaign landing pages`. Files at `the-50-dollar-app/src/app/{go,hire}/page.tsx`. |\n| Hostel poster PDF in vault | **2026-03-12/13** | 4 PDFs found: 2× in `vault/09-Agent-Output/2026-03-13_herald_sydney-hostel-poster-money-led-{,v2}.pdf`, 1× `vault/09-Agent-Archive/Herald/posters/poster-backpacker-hostel-a4.pdf`, 1× `assets/hostel-poster.pdf`. |\n| gws CLI on VPS | **on or before 2026-04-29** | `which gws` → `/usr/bin/gws`. `gws 0.22.5`. Config at `/root/.config/gws/` last modified 2026-05-01 09:06. |\n| Item 0 — site down (rateright.com.au) | **2026-05-03 06:14** | Hermes WhatsApp bridge moved to `:3500` via `platforms.whatsapp.extra.bridge_port: 3500` in `/root/.hermes/config.yaml`. App rebound `:3000` automatically. External 200, Playwright render clean, all paths (`/`, `/go`, `/hire`, `/api/health`) return 200. Detail in [[Truth-Audit-2026-05-02]] §\"2026-05-03 06:30 — Item 0 Resolution\". |\n| Stripe live-key validity | **2026-05-03 06:25** | `sk_live_51Rx...` (107 chars) validated against `https://api.stripe.com/v1/balance` → HTTP 200, `livemode: true`, AUD 0.00 balance. Audit's \"Invalid API Key\" was probably a transient blip or wrong key sample. End-to-end Checkout from a browser session is the remaining gate. |\n| Marketplace Supabase service-role | **2026-05-03 06:25** | 219-char JWT in `/home/ccuser/the-50-dollar-app/.env.local`. Validated against `/rest/v1/` (HTTP 200 + swagger) and `/auth/v1/admin/users?per_page=1` (HTTP 200 + real user `flodeliffre@gmail.com` confirmed 2026-04-17). Audit's \"placeholder\" claim was wrong file. |\n\n### ✅ Item 0 — DETAIL (preserved from original block, no content lost)\n\n**Original surface (2026-05-02 truth audit):**\n- External: HTTP 400 on `/`, `/go`, `/hire`. HTTP 502 on `/health`. Site offline.\n- `rateright-app.service` crash-looping since **2026-03-13** (first failure logged). **47,140 → 54,079 restarts** by time of fix.\n- Current root cause: `EADDRINUSE :::3000` — Hermes' WhatsApp bridge held port 3000 since 2026-05-01 14:54.\n- Original (March) cause: hidden under EADDRINUSE for 50 days.\n\n**Fix path chosen** (Option B from audit, per Rocky/HQ direction):\n- Move Hermes WhatsApp bridge off port 3000 → 3500. WhatsApp kept alive; needed for site ops.\n- Backed up `/root/.hermes/config.yaml` before edit.\n- Restarted `hermes-gateway.service`. Bridge re-authenticated without QR re-pair (session creds at `/root/.hermes/whatsapp/session/` are port-independent).\n- rateright-app auto-recovered. Restart counter froze.\n\n**Outstanding minor items** (not blocking):\n- nginx `proxy_buffer_size` bump (preventative for the one transient 502 at 06:17:18).\n- nginx dual mapping: `rateright.com.au` AND `rivet.rateright.com.au` both point at `:3000`. The rivet subdomain probably shouldn't be on the marketplace app.\n- Stripe end-to-end Checkout drive from a browser session (validates webhook + receipt path beyond just the API key).\n- Investigate `flodeliffre@gmail.com` provenance — signed up during 50-day downtime.\n\n---\n\n## Cross-references\n\n- [[Michael-Action-Queue]] — original list (2026-03-30)\n- [[2026-03-30]] — grill session that surfaced the disconnects\n- [[2026-03-25]] — earlier grill session (accountability check)\n- [[Vault-Migration-Audit-2026-05-01]] — full audit context\n- [[Team-Gap-Analysis]] — the team / wiring side of the same picture\n- [[Hunt-Approval-Bottleneck]] — current acquisition channel state\n- [[ROADMAP]] — strategic priorities (now stale; refresh in The Window)\n\n---\n\n## How to clear an item\n\nWhen Rocky actions one of these threads:\n\n1. Tick it off here (or move to a \"Done 2026-05-XX\" section at the bottom)\n2. If it produced an artifact (sent email, deployed code, created file), backlink it\n3. Append a one-liner to [[10_RateRight/_Brain/_Log\\|10_RateRight/_Brain/_Log]] with the same date/time\n4. The auto-sync handles the rest", "exit_code": 0, "error": null}

[Subdirectory context discovered: /home/ccuser/rateright-growth/HQ-Vault/10_RateRight/_Brain/CLAUDE.md]
# RateRight

## What this is
Australian construction labour marketplace. Flat $50 per hire, no ongoing commission. Jobs board with ratings — companies pay $50 to hire a worker and keep them as long as they want. Success = worker hired and stays.

## Current state
- v2 platform (`the-50-dollar-app/`) live on VPS port 3000
- Marketing site (`rateright-main-site/`) semi-static
- Growth engine (Hermes gateway + Clawdbot OpsMan + PM2 services) running on Sydney VPS
- Worker supply remains the existential gap. Real user counts currently unknown — Supabase service-role key in env is 41 chars, not a valid JWT. Needs fixing before anyone can answer "how many workers do we have."
- Hunt infrastructure built and partially running. Pipes open, taps off — see below.
- SMS disabled platform-wide (`DISABLE_ALL_SMS=set`) due to prior over-sending. Holds until Rocky says otherwise.

## Acquisition strategy
Two channels, complementary not exclusive:

1. **Hostel campaign** — physical posters + plain-text emails to Sydney/Melbourne hostels targeting backpackers on working holiday visas. Stalled on physical mailing only.
2. **The Hunt** — scrape both sides:
   - `hunt-contractors` and `hunt-workers` scrape Gumtree etc. for leads
   - `hunt-aggregator` populates an aggregated_jobs table — Seek-style listing aggregation to make the platform look populated and convert scraped employers into customers
   - `hunt-outreach` sends approved leads (daily budget 20)
   - `hunt-monitor` checks for replies
   - **Hunt matchmaker** — the conversion engine that turns scraped leads into actual matches. Designed, not built.

## Hot right now
- 359 leads scraped, only 1 approved and sent — approval bottleneck somewhere, manual or broken
- Scrapers stopped, queue not growing
- `hostel-campaign` PM2 service is a zombie (4,465 restarts) — needs killing
- Last 4 days of work: Gumtree scraper reliability, outreach template tweak

## Stack
- Platform: Next.js, Supabase, Stripe (in `the-50-dollar-app/`)
- Infra: DigitalOcean Sydney VPS
- Agents: hermes-gateway (systemd), clawdbot-opsman (systemd), PM2 fleet for hunt + growth-engine + cc bridge
- Voice: `rateright-phone-ai/` (VAPI + OpenAI Realtime + Twilio) — built, dormant, candidate for revival

## Key people
- Rocky (sole operator)
- Liam (LFCS, day-job partner — RateRight is Rocky's, but Liam is in the picture)
- No human RateRight team

## How to be useful here
- Worker supply is the priority. If a proposal doesn't move worker numbers, deprioritise it.
- The platform exists. Don't propose rebuilds. Propose fixes, growth tactics, or new acquisition channels.
- Hunt infra exists. Don't propose new scrapers — fix the approval bottleneck and turn the scrapers back on first.
- Listing aggregation (scrape-and-republish from Seek/Gumtree) is in play. Treat scraped employers as warm leads, not just inventory padding.
- McElligott labour-co partnership is parked at 5-10 year horizon. Not the current frame.

## Hard rules
- Never re-enable SMS without explicit Rocky approval. Reputational damage from prior spam.
- Never propose deletions of legacy repos (`rateright-v2/`, `the-50-dollar-app-backup/`, etc.) without flagging to Rocky first.
- Never pretend to know user counts until the Supabase service-role key is fixed — say "unknown, key needs replacing."
- The $50 flat fee is the model. No percentage, no ongoing commission. Don't draft anything that contradicts this.


Output:
---
title: Truth Audit — Open-Threads vs Reality
created: 2026-05-02
type: investigation
status: critical-findings
author: claude-code-rr
---

# Truth Audit — Open-Threads vs Reality (2026-05-02)

## 🚨 CRITICAL FINDING — surfaced during the audit

**`rateright.com.au` ($50 App) is DOWN and has been since 2026-03-13.**

- **External**: HTTP 400 on `/`, `/go`, `/hire`. HTTP 502 on `/health`. Site is offline to users.
- **systemd `rateright-app.service`**: crash-looping, restart counter **47,140**.
- **Root cause**: `EADDRINUSE :::3000` — port 3000 is held by Hermes' WhatsApp bridge process (PID 3864936, child of `hermes-gateway.service`). Process command: `node /usr/local/lib/hermes-agent/scripts/whatsapp-bridge/bridge.js --port 3000 --session /root/.hermes/whatsapp/session --mode bot`.
- **Timeline**:
  - 2026-03-13 08:22 — first systemd failure logged. Original cause unclear (likely `.env.local` placeholder swap or stale build manifest per the Deployment SOP).
  - 2026-05-01 14:54 — Hermes started, claimed port 3000 for its WhatsApp bridge. Now even if rateright-app tried to start, the port would be unavailable.
  - 2026-05-02 19:22 — still crashing. 50 days down.
- **Impact**: every Open-Threads "blocker" assumes a working app. Stripe live-test impossible. QR funnel landing pages unreachable. Worker signups can't happen.

This eclipses every other item. **Listed as item 0 in the open threads update.** Rocky's call on the fix path:

1. Move Hermes WhatsApp bridge off port 3000 (e.g. 3500). Cleanest. Requires Hermes config edit.
2. Move rateright-app to a different port (e.g. 3001) + update nginx upstream. Also clean.
3. Stop the WhatsApp bridge entirely if it's not actively used (Rocky may not currently be using WhatsApp — Hermes is mostly Telegram).

---

## Audit by item

### Item 1 — Stripe blocker (vault: 🔴 / reality: ⚠)

- **VAULT SAYS**: "Test mode confirmed working; production credentials + end-to-end live test never done."
- **REALITY**: Stripe is configured for **LIVE MODE**:
  - `STRIPE_SECRET_KEY=sk_live_51Rx...` in `the-50-dollar-app/.env.local`
  - `STRIPE_PUBLISHABLE_KEY=pk_live_51Rx...`
  - `STRIPE_WEBHOOK_SECRET=whsec_GKtr...`


Explanation: The curator log directory is empty or the most recent file is empty. Let me also check for the hermes-agent .env file to get Supabase keys.

ls -la /usr/local/lib/hermes-agent/.env 2>&1 && grep -v "^#" /usr/local/lib/hermes-agent/.env 2>/dev/null | grep -E "SUPABASE|STRIPE|DATABASE" | sed 's/=.*/=***/'

curl -s -o /dev/null -w "%{http_code}" https://eciepjpcyfurbkfzekok.supabase.co/rest/v1/ 2>&1

curl -s -o /dev/null -w "%{http_code}" --max-time 10 https://api.stripe.com/v1/balance 2>&1

find ~/.hermes/logs/curator -type f -printf '%T+ %s %p\n' 2>/dev/null | sort -r | head -5

cat /home/ccuser/rateright-growth/HQ-Vault/01_Daily/2026-05-03.md 2>/dev/null | head -40


Output: -rw-r--r-- 1 root root 19679 May  1 14:53 /usr/local/lib/hermes-agent/.env


Output:
2026-05-01+15:57:03.2569358690 6732 /root/.hermes/logs/curator/20260501-055309/REPORT.md
2026-05-01+15:57:03.2569358690 15011 /root/.hermes/logs/curator/20260501-055309/run.json


Output:
# 2026-05-03

## Plan
-

## Sessions

## 03:00 — cowork (curator) — Sunday weekly pass

Scheduled daily + weekly curator pass. Automated run.

**Files modified last 24h (13 files):** Open-Threads, 10_RateRight/_Brain/_Log, 11_OpsMan_LFCS/Operations/skills/chat-bootstrap/SKILL.md, 30_Goals/Active, 30_Goals/Projects, 30_Goals/_Brain/_Log, _System/CuratorQueue, _System/HQQueue, _System/Investigations/Truth-Audit-2026-05-02, _System/MigrationVerification, _System/Scratch/HQ-Instructions-Draft-v2-2026-05-02, 01_Daily/2026-05-02.

**Frontmatter fixed:**
- `10_RateRight/_Brain/_Log.md` — added frontmatter block.
- `11_OpsMan_LFCS/_Brain/_Log.md` — added frontmatter block.
- `12_SiteOps/_Brain/_Log.md` — added frontmatter block.

**Weekly sweep findings (Sunday):**
- 2 rogue empty top-level folders: `Curator/`, `Curators/` — protocol violation, queued.
- `10_RateRight/Skills/` empty dir — queued (not previously flagged).
- 19 files with pre-migration broken wikilinks (`[[02-Fleet/...]]` etc.) — queued for Rocky decision on fix strategy.
- `30_Goals/Active.md` + `Projects.md` still `draft-awaiting-rocky-review` — queued reminder.
- `Michael-Action-Queue.md` fully resolved — archive candidate, queued.
- `_System/TeamProtocol.md` is stub — possible redundancy with CLAUDE.md team protocol section, queued.
- `_System/HealthLog.md` no entry for 2026-05-02 — VPS cron gap, queued.
- All 10 dailies lack frontmatter — queued (expanded from prior 2-file item).

**Queued to CuratorQueue:** 9 new items added (weekly section).
**State of Vault written:** `_System/Reviews/StateOfVault-2026-05-03.md`

**Action items for Rocky:**
1. Review `30_Goals/Active.md` + `Projects.md` → flip status to `live`.
2. Decide: delete `Curator/` and `Curators/` empty folders.
3. Decide: broken-link strategy for 19 pre-migration files.
4. Confirm VPS cron still firing (HealthLog gap on 2026-05-02).

## Wins
-


Explanation: Now I have enough data. Let me also check the hermes-agent .env for Supabase key specifically, since the curl returned 401.

grep -E "SUPABASE|STRIPE" /usr/local/lib/hermes-agent/.env 2>/dev/null | sed 's/=.*/=***REDACTED***/'

cat /root/.hermes/logs/curator/20260501-055309/REPORT.md 2>/dev/null | tail -20


Output:
reason: Concrete pour inspection absorbed as pre-pour-check reference — shares job folder, inspection log path, and daily diary with all other LFCS site-operation skills
  - from: lfcs-rfi-status
    into: lfcs
    reason: RFI register scanner absorbed as rfi-status reference — same RFIs/_REGISTER.md, same Cat A/B/C taxonomy used in EOD summary; class-level site operations skill
  - from: lfcs-tool-tracker
    into: lfcs
    reason: Tool register design absorbed as tool-tracker reference — whatsapp-bridge-setup skill handles the platform plumbing; the workflow guidance belongs under the LFCS operations umbrella
  - from: timesheet
    into: lfcs
    reason: Weekly timesheet absorbed as timesheet reference under LFCS umbrella — hours source is Job-Tracker.md (same file all LFCS skills read), payroll submission is a site-admin task
prunings:
  - name: timesheet-from-lfcs-nested
    reason: Spurious nested copy of the timesheet skill created during skill creation; content already absorbed into lfcs/references/timesheet.md
```

## Recovery

- Restore an archived skill: `hermes curator restore <name>`
- All archives live under `~/.hermes/skills/.archive/` and are recoverable by `mv`
- See `run.json` in this directory for the full machine-readable record.


---

## Tier 0 Verification Report — 2026-05-03 11:17 AEST

---

### 1. Git Sync State

| | |
|---|---|
| **Last pull** | `2026-05-03 06:33:58 +1000` |
| **Last commit** | `coo: rateright.com.au back up — Hermes WhatsApp bridge to :3500` |
| **Delta from now** | ~4h 44m stale |

Staleness: moderate. Cowork was active this morning. VPS auto-sync every 30 min should have pulled any new commits. No indication of a sync gap.

---

### 2. VPS Service State

**systemd services:**
```
hermes-gateway    active
clawdbot-opsman  active
rivet-voice      active
```
All three live. No failures.

**PM2:**
```
cc               online   50D uptime  pid 1021519
growth-engine    online   51D uptime  pid 852288
hunt-aggregator  stopped  0 restarts
hunt-contractors stopped  0 restarts
hunt-matchmaker  stopped  0 restarts
hunt-monitor     online    4D uptime  pid 2771150
hunt-outreach    online    4D uptime  pid 2771147
hunt-workers     stopped  0 restarts
```
Hunt fleet: 2 of 6 online (monitor + outreach). Aggregator, contractors, matchmaker, workers all stopped.

**Zombies:** none found.

**Disk:**
```
/dev/vda1  77G  53G  25G  69%
```
Yesterday's ~3GB cleanup confirmed. Was 72% yesterday → 69% today. ~3GB freed.

---

### 3. Hermes Own State

**`hermes status` — key fields:**
- Model: `MiniMax-M2.7` / provider: `MiniMax`
- Gateway: `✓ running` (systemd, PID 619834)
- Messaging: Telegram ✓, WhatsApp ✓
- Active sessions: `3`
- Jobs: `3 active, 4 total`

**Cron jobs:**
```
name                  schedule       last_run              status   next_run
lfcs-am-lookahead    0 6 * * *     2026-04-30 06:00      ok      PAUSED (manually)
lfcs-eod-summary     0 17 * * *     2026-05-02 17:02      ok      2026-05-03 17:00
lfcs-weekly-programme 0 6 * * 1     never                 —        2026-05-04 06:00
```
`lfcs-am-lookahead` paused 2026-04-30. `lfcs-eod-summary` healthy. `lfcs-weekly-programme` never fired (scheduled Mondays).

**Skill library — 43 skills:**
No skills added in last 48h. Last skill housekeeping was `2026-05-01 15:57` (curator run) when 4 skills were pruned/merged into `lfcs`:
- `timesheet` → absorbed
- `lfcs-rfi-status` → absorbed
- `lfcs-tool-tracker` → absorbed
- `timesheet-from-lfcs-nested` → pruned

**Curator log:** Last run `2026-05-01 15:57`. No run since then (2 days ago). Curator is scheduled but may not have fired since the last successful run. Cowork's 03:00 pass today was separate (daily + weekly sweep, vault writes confirmed).

---

### 4. Vault State (from VPS read)

**Daily notes by mtime:**
```
2026-05-03 07:00  HQ-Vault/01_Daily/2026-05-03.md
2026-05-02 19:30  HQ-Vault/01_Daily/2026-05-02.md
2026-05-01 21:30  HQ-Vault/01_Daily/2026-05-01.md
```

**Open-Threads:**
- File: `10_RateRight/_Brain/Open-Threads.md`
- Last updated: `2026-05-03` (item 0 resolution — site back up)
- Status: `live`
- Summary: 1 emergency (reflagged), 2 🟡 items pending Rocky's call, several ✅ resolved

**Truth-Audit files in `_System/Investigations/`:**
```
Team-Gap-Analysis.md
Vault-Migration-Audit-2026-05-01.md
Vault-Deep-Dive-Audit-2026-05-01.md
Truth-Audit-2026-05-02.md  ← most recent
Hunt-Approval-Bottleneck.md
Cowork-Review-2026-05-01.md
```
6 files. `Truth-Audit-2026-05-02` is the operative document.

---

### 5. Connectivity to RateRight Infra

**Supabase API:**
```
curl https://eciepjpcyfurbkfzekok.supabase.co/rest/v1/
→ HTTP 401
```
Service-role key NOT present in `/usr/local/lib/hermes-agent/.env` (0 matches). Supabase URL not set in Hermes env either. **RateRight app has the key** (`the-50-dollar-app/.env.local`) but Hermes does not. Direct Supabase access from Hermes will fail.

**Stripe:**
```
curl https://api.stripe.com/v1/balance
→ HTTP 401
```
Live key present in `the-50-dollar-app/.env.local` but NOT in Hermes env. 401 = unauthenticated (key not in request). Stripe key not sourced from Hermes env for this test — would need the actual key from `.env.local`.

**Production app (rateright.com.au):**
```
curl rateright.com.au
→ HTTP 200 ✓
```
Site is up. Playwright render clean. All paths (`/`, `/go`, `/hire`, `/health`) returning 200 as of 06:33 this morning. Item 0 (port conflict) resolved by moving WhatsApp bridge to :3500.

---

### Summary — Issues to Flag

| Severity | Item |
|---|---|
| 🟡 Low | `lfcs-am-lookahead` cron paused since 2026-04-30 — not firing |
| 🟡 Low | Curator last ran 2026-05-01 — 2-day gap, may need investigation |
| 🟡 Low | Hermes has no Supabase or Stripe keys in its own env — cannot query either service directly |
| 🟡 Low | Hunt fleet: 4 of 6 services stopped (aggregator, contractors, matchmaker, workers) |
| 🟢 Info | No new skills in 48h — library clean |
| 🟢 Info | Git view stale ~4.5h — expected, auto-sync 30m |
| 🟢 Info | Curator queue has 9 items awaiting Rocky's decisions (per Cowork today's pass) |

Explanation:
Now I have enough data. Let me compile the full Tier 0 verification report.

Key findings:
1. Git sync: last pull = 2026-05-03 06:33:58 +1000 — "coo: rateright.com.au back up — Hermes WhatsApp bridge to :3500"
2. Systemd services: all active (hermes-gateway, clawdbot-opsman, rivet-voice)
3. PM2: growth-engine online, hunt-monitor online, hunt-outreach online, others stopped
4. No zombie processes
5. Disk: 77G total, 53G used, 25G available, 69% — ~3GB freed (was 72% yesterday)

6. Hermes is healthy with MiniMax-M2.7 at 3% memory, gateway running under systemd with 3 active jobs and sessions
7. Cron jobs look good with lfcs-am-lookahead paused but lfcs-eod-summary and lfcs-weekly-programme scheduled
8. No curator logs since 2026-05-01 and no skill changes in the last 48 hours
9. Vault data shows daily files from 2026-05-03, 05-02, and 05-01, plus Open-Threads.md last updated 2026-05-02 and 6 Truth-Audit files total
10. Supabase is returning 401 errors because the service role key isn't configured in Hermes's environment, while Stripe's health check also shows 401 with the live key, but the production app at rateright.com.au is responding with 200
11. The most recent curator run was 2026-05-01 at 15:57, and I'm seeing that several skills were consolidated into the lfcs skill on that same date — timesheet, lfcs-rfi-status, lfcs-tool-tracker, and timesheet-from-lfcs-nested all got merged in

. Looking at the skill list, I can confirm these four were removed and integrated, so no new skills have been added in the past 48 hours.


# Resolve the 50-day downtime question + Supabase tier

The audit said rateright.com.au was down for 50 days with 47,140
systemd restart attempts. Rocky just got a Supabase email saying
the project was paused due to inactivity, dated 1-2 days ago.
These might be the same thing or different things. I need to know.

## What I need

### 1. systemd restart timeline
Run: journalctl -u rateright-app.service --since "2026-03-01"
| grep -E "(Started|Stopped|Failed|crash)" | head -200

Then: journalctl -u rateright-app.service --since "2026-03-01"
| grep -E "(Started|Stopped|Failed|crash)" | wc -l

I want to know:
- When did the crash loop actually start? (first failure timestamp)
- When did it end? (most recent success before the fix)
- Was it continuous for 50 days, or intermittent?
- 47,140 events over what actual time window?

### 2. Supabase tier and pause history
Check the Supabase project state directly:
- What tier is the project on? (free, pro, team, enterprise)
- Login to https://app.supabase.com via CLI or API if possible
- Pull the project's status history if accessible

If you can't access the Supabase dashboard, check the .env file
for the project ref and report the project URL so Rocky can check
manually.

### 3. Last successful database query before today
- journalctl -u rateright-app.service --since "2026-03-01"
  | grep -i "supabase" | tail -50
- Any logs showing successful queries vs auth errors vs network
  errors. I want to see the failure mode that was happening.

### 4. The 5 Stripe charges — did they convert to real activity?
Query Supabase (you confirmed the key works at 06:25):
- For each of the 5 successful Stripe charges from late Feb 2026,
  find the matching record in payments (3 of 5 expected)
- For each match, find the linked match record (worker hired)
- Report: customer email, worker hired, match status, last
  activity timestamp, any subsequent activity (messages, ratings)
- For the 2 charges with no payments row — investigate why
  (refund? webhook miss? schema didn't exist yet?)

### 5. flodeliffre@gmail.com
- Pull full profile record from profiles table
- Signed up 2026-04-17 during downtime — how?
- Any activity since signup (jobs viewed, applications, messages)
- Check Supabase auth logs if accessible — what auth method,
  what IP, what user-agent

## Output

Structured. Timestamps. Actual log lines, not summaries. SQL
results in tables.

## Rules
- Read-only. No restarts, no DB writes.
- If a command fails, paste the actual error.
- If something requires Rocky's manual login, flag it clearly
  with the URL/path he needs.