The Best Interface for Configuring an AI Gateway Is Another AI

·5 min read
The Best Interface for Configuring an AI Gateway Is Another AI

The Best Interface for Configuring an AI Gateway Is Another AI

I run a self-hosted AI gateway on my home network called OpenClaw . It connects AI models — Claude, Grok, GPT-4o — to messaging channels like Telegram, Signal, and Mattermost. It runs agents on schedules, delivers morning briefings, monitors my homelab, and keeps a second brain indexed in vector memory. It’s become a genuinely useful piece of infrastructure.

Here’s the thing though: the best way I’ve found to configure it isn’t through its own interface. It’s through Claude Code — Anthropic’s CLI tool — running in a terminal on the same machine.

What OpenClaw Configuration Actually Looks Like

OpenClaw is configured through a set of JSON files. The main config (~/.openclaw/openclaw.json) handles model providers, channel credentials, and agent routing. Cron jobs — scheduled tasks the agents run — live in a separate jobs.json, each one a JSON object with a schedule expression, a payload containing a prompt, delivery settings, and state tracking.

A single cron job might look simple on the surface. In practice, writing a good one involves:

  • Getting the cron expression right for the timezone
  • Writing a prompt that produces the output you actually want
  • Choosing the right model (Grok 4 for real-time web searches, Claude for reasoning tasks)
  • Setting a timeout that matches the task’s expected runtime
  • Wiring up the delivery channel and recipient ID correctly

When I want to change how a job works — say, splitting one large morning briefing into four focused updates delivered ten minutes apart — there’s a lot to get right simultaneously. Schedules, IDs, prompt rewrites, timeout tuning, delivery config, log file paths. It’s not hard exactly, but it’s detail-heavy work where small mistakes break things silently.

Enter Claude Code

Claude Code running in a terminal

Claude Code is Anthropic’s CLI-based coding assistant. It reads files, edits them precisely, runs shell commands, and maintains context across a conversation. I originally started using it for software development tasks. At some point I realized it was also the most natural way to configure OpenClaw.

The workflow is simple: I describe what I want in plain English, and Claude Code reads the config files, understands the current state, makes the changes, validates the JSON, and restarts the gateway. No fumbling with syntax. No forgetting to update a related field somewhere else in the file.

A recent example: I wanted to split my 5am daily briefing — which was timing out at seven minutes because it was trying to do everything at once — into four separate Telegram messages. News and commentary first, then Kentucky history, then AI and investments, then the wisdom section with a Bible verse, Stoicism quote, and a Scott Adams reframe. Each one staggered ten minutes apart.

That’s four new cron jobs, each with its own prompt, schedule, timeout, and state block. It also meant removing the old job, updating the log files those jobs read and write, adding a new tracking log for the Scott Adams reframes, and updating the shared knowledge base so the OpenClaw agents themselves know about the new structure. In one session.

I just described what I wanted. Claude Code handled the rest — including catching that the second-brain-sync job had been pushing to a main branch that didn’t exist, because the local git repo used master. That’s the kind of thing I wouldn’t have noticed for weeks.

Why It Works Better Than Direct Configuration

A few things make this combination work well:

Claude Code treats config files as code. It reads the whole file before touching anything, makes targeted edits, and validates the result. It doesn’t just overwrite — it understands what’s already there and works with it.

Natural language maps well to configuration intent. When I say “use Sky News for international stories and Fox News for US news,” Claude Code knows that means updating the prompt in the news job to web_fetch from specific URLs rather than running a generic search. The translation from intent to implementation is handled for me.

It maintains context across the whole system. OpenClaw has a shared knowledge base — a file called openclaw.md in my Claude memory repo that the OpenClaw agents read at startup. Claude Code keeps that file in sync with every change. When the agents wake up the next morning, they already know about the restructured briefing, the new commentator list, the URL rules. I don’t have to tell both systems.

It catches things I didn’t ask about. The branch mismatch above is one example. Another: after running the new briefing jobs for the first time, Claude Code noted that the KY history job was generating long, broken URLs that were mangling the Telegram formatting — and suggested the fix (homepage-only links) before I even had a chance to complain about it.

The Broader Observation

There’s something interesting here about how we interact with complex software. OpenClaw has its own chat interface and I can ask the main agent to configure things directly. But describing configuration changes to an agent that is OpenClaw is oddly awkward — like asking someone to rewrite their own job description while they’re on the clock.

Claude Code sits outside the system. It has full access to the files, a complete view of the configuration, and no stake in what the config currently says. It can read the whole jobs.json, understand all fourteen cron jobs and how they relate to each other, and make changes that are consistent across the board.

Increasingly I think the right mental model for a system like OpenClaw isn’t “chat interface plus config files.” It’s “config files as the source of truth, with a capable coding assistant as the configuration layer.” The chat interface is for runtime — for conversations, queries, things happening now. The files are the system’s memory and behavior. And the best tool for shaping those files is one that reads, reasons about, and edits code.

Which, for me, is Claude Code running in a terminal while OpenClaw runs in the background.


OpenClaw is available at openclaw.ai . Claude Code is Anthropic’s CLI coding assistant — details at claude.ai/code .