#claude-cli to openclaw
1 messages · Page 1 of 1 (latest)
Best pattern: don’t sync Claude’s memory into OpenClaw indirectly — make Claude write the OpenClaw workspace files directly.
OpenClaw’s useful files are in the agent workspace, usually:
~/.openclaw/workspace
Check yours with:
openclaw config get agents.defaults.workspace
Then have Claude CLI update these:
AGENTS.md— rules OpenClaw should always follow; best for “before touching config, read the change log”
MEMORY.md— durable decisions / preferences / “why this was changed”memory/YYYY-MM-DD.md— running daily notes / raw changelogTOOLS.md— local conventions / machine-specific setup notes
For your exact case, I’d add something like this to AGENTS.md:
## Config-change hygiene
Before modifying OpenClaw config, system services, launch agents, env files, or installed tools:
1. Search/read MEMORY.md and memory/*.md for recent config decisions.
2. Preserve externally-made changes unless explicitly asked to revert them.
3. If you change config, append a dated note to memory/YYYY-MM-DD.md with:
- what changed
- why
- how to verify it
- what not to undo later
Then tell Claude CLI: “Whenever you make a system/OpenClaw config change, append a note to ~/.openclaw/workspace/memory/$(date +%F).md, and promote stable decisions into MEMORY.md.”
Tiny gotcha: arbitrary extra .md files are not automatically injected. If you make CONFIG_CHANGES.md, reference it from AGENTS.md and tell the agent to read it before config work.
Also: in Discord guild channels, long-term memory may not auto-load the same way as private sessions, so put the “must always follow” bits in AGENTS.md, not only MEMORY.md.
Docs:
https://docs.openclaw.ai/concepts/agent-workspace
https://docs.openclaw.ai/concepts/memory
https://docs.openclaw.ai/concepts/system-prompt
Yes — this is logical and should achieve the goal.
I’d tweak it slightly:
- Put the file at the workspace root:
~/.openclaw/workspace/CLI-CONFIG-CHANGES.md
- Don’t make it only an append-only diary. Add a tiny top section:
# CLI-CONFIG-CHANGES.md
## Active decisions / do-not-unwind
- 2026-04-28: Gateway uses X because Y. Verify with Z. Do not revert to A unless user approves.
## Change log
...
That way OpenClaw doesn’t have to infer the current truth from 40 old entries.
-
Have both Claude CLI and OpenClaw write to the same file when they change OpenClaw/system config. Otherwise Claude sees OpenClaw’s changes less clearly too.
-
In
AGENTS.md, make the rule scoped so the agent doesn’t read it for every random chat:
## OpenClaw/system config handoff
Before changing OpenClaw config, gateway/service settings, channel config, auth/profile config, env files, launch/systemd services, or installed OpenClaw tooling:
1. Read `CLI-CONFIG-CHANGES.md` from the workspace root if it exists.
2. Check for active decisions that relate to the intended change.
3. If the intended change contradicts an active decision, stop before editing and ask the user to confirm.
4. After making a config/system change, append a concise entry to `CLI-CONFIG-CHANGES.md` with:
- date
- changed files/settings
- why
- verification command/result
- rollback note or “do not undo unless...”
- whether prior decisions are superseded
5. Never store secrets/tokens in this file.
One important caveat: arbitrary files like CLI-CONFIG-CHANGES.md are not automatically injected into every prompt, so the AGENTS.md instruction to explicitly read it is the key part. AGENTS.md is the right place.
Docs worth keeping handy:
https://docs.openclaw.ai/concepts/agent-workspace
https://docs.openclaw.ai/concepts/system-prompt
Yep — Claude’s side goes in Claude Code’s CLAUDE.md, not in CLI-CONFIG-CHANGES.md itself.
If you want this behavior everywhere Claude runs, put it in:
~/.claude/CLAUDE.md
If you only want it when working from the OpenClaw workspace, put it in:
~/.openclaw/workspace/CLAUDE.md
Claude Code officially reads CLAUDE.md for persistent instructions; it does not read AGENTS.md directly unless CLAUDE.md imports it with @AGENTS.md. (docs.anthropic.com)
I’d put this in Claude’s CLAUDE.md:
## OpenClaw config handoff
When asked to inspect, modify, repair, or revert OpenClaw-related system configuration, first treat the OpenClaw agent workspace as the handoff source.
Default OpenClaw workspace:
`~/.openclaw/workspace`
Before changing any of the following:
- OpenClaw config
- gateway/service settings
- channel config
- model/provider/auth profile config
- environment files
- launchd/systemd services
- installed OpenClaw tooling
- browser/node host settings used by OpenClaw
Do this:
1. Read `~/.openclaw/workspace/CLI-CONFIG-CHANGES.md` if it exists.
2. Check whether the planned change conflicts with any active decision or “do-not-unwind” note.
3. If there is a conflict, stop before editing and ask the user to confirm.
4. After making a change, append a concise entry to `~/.openclaw/workspace/CLI-CONFIG-CHANGES.md`.
Each entry should include:
- date/time
- changed file, setting, command, or service
- why the change was made
- how to verify it
- rollback note, if known
- whether it supersedes an earlier decision
Never write secrets, tokens, OAuth data, private keys, or raw credentials into `CLI-CONFIG-CHANGES.md`.
Keep entries concise. Prefer updating the top “Active decisions / do-not-unwind” section when a decision is still current, and append details under the change log.
Then create the shared file with this starter shape:
# CLI-CONFIG-CHANGES.md
Shared handoff log between Claude CLI and OpenClaw.