ClawMorph
Turn one agent into many roles — with preview, snapshot, and rollback.
Transform any OpenClaw agent into a role-specific workspace in one command.
ClawMorph lets you turn the same agent into a researcher, designer, lawyer, product manager, or founder without hand-editing prompt files.
Unlike simple prompt switchers, ClawMorph works at the workspace layer:
- preview changes before writing anything
- apply a role pack safely
- snapshot the previous state automatically
- roll back cleanly when you want to undo
That makes it useful for real agent iteration, not just prompt swapping.
Why people star it
- Role switching without manual file surgery
- Safer than ad-hoc prompt edits because every apply is previewable and reversible
- Works on real OpenClaw workspaces instead of isolated prompt snippets
- Easy to demo: list, preview, apply, rollback
Quick demo
npx clawmorph list
npx clawmorph new demo-founder --role founder --root /tmp/clawmorph-agents
npx clawmorph preview --path /tmp/clawmorph-agents/demo-founder --role researcher
npx clawmorph snapshots --path /tmp/clawmorph-agents/demo-founder
npx clawmorph rollback --path /tmp/clawmorph-agents/demo-founder
For the shortest first run, use npx clawmorph .... If you want the command available globally, install it with npm install -g clawmorph.
Why it is different
| Capability | Prompt template | ClawMorph |
|---|---|---|
| Switch role instructions | ✅ | ✅ |
| Preview changes before write | ❌ | ✅ |
| Update workspace files | ❌ | ✅ |
| Snapshot before mutation | ❌ | ✅ |
| Roll back to previous state | ❌ | ✅ |
Before vs after
Before
A generic OpenClaw agent workspace might only contain a light identity file and a few loose notes.
After
ClawMorph can apply a role pack that:
- updates
IDENTITY.md - creates or updates
SOUL.md - creates or updates
TOOLS.md - appends role-specific entries to
MEMORY.md - stores a snapshot in
.clawmorph/snapshots/...
Install
Run instantly with npx
npx clawmorph list
Install globally
npm install -g clawmorph
clawmorph list
Develop from source
git clone https://github.com/ViccHoo/clawmorph.git
cd clawmorph
npm install
npm run build
npm run list
Built-in role packs
researcher— evidence gathering, source comparison, synthesisdesigner— UX reasoning, flows, visual directionlawyer— careful wording, constraints, risk analysisproduct-manager— scope, priorities, outcomes, trade-offsfounder— strategy, momentum, business judgment
Commands
Create a new agent workspace
clawmorph new my-agent --role researcher
clawmorph new founder-bot --role founder --root /tmp/clawmorph-agents
This creates a new OpenClaw-compatible workspace and immediately applies the selected role pack.
List available role packs
clawmorph list
clawmorph snapshots --path /tmp/leo-demo
Preview changes for a role pack
clawmorph preview --path ./test-fixtures/demo-agent --role researcher
clawmorph preview --path ./test-fixtures/demo-agent --role researcher --json
Or resolve a named agent conservatively:
clawmorph preview --agent leo --role researcher
Apply a role pack directly to a workspace copy
clawmorph apply --path /tmp/leo-demo --role researcher
Roll back the latest apply
clawmorph rollback --path /tmp/leo-demo
clawmorph rollback --path /tmp/leo-demo --snapshot <snapshot-id>
How it works
ClawMorph follows a simple flow:
- Resolve target workspace
- explicit
--path - or a best-effort
--agentlookup
- explicit
- Load a role pack from
role-packs/*.yaml - Scan the workspace for key OpenClaw files
- Preview planned changes
- Create a snapshot before writing files
- Apply file updates
- Rollback if needed
Current MVP focuses on these files:
IDENTITY.mdSOUL.mdTOOLS.mdMEMORY.md
ClawMorph intentionally does not mutate USER.md in this version.
Automation-friendly output
For integration with scripts or future UI layers, core commands support JSON output:
clawmorph list --json
clawmorph preview --path ./test-fixtures/demo-agent --role researcher --json
clawmorph apply --path /tmp/leo-demo --role researcher --json
clawmorph rollback --path /tmp/leo-demo --json
clawmorph snapshots --path /tmp/leo-demo --json
Safe real-agent demo
If you want to test against a real OpenClaw agent without mutating the original workspace, copy that agent directory first and run ClawMorph against the copy.
Example:
cp -R ~/.openclaw/workspace/agents/leo /tmp/leo-demo
clawmorph preview --path /tmp/leo-demo --role researcher
clawmorph apply --path /tmp/leo-demo --role researcher
clawmorph rollback --path /tmp/leo-demo
This keeps your real agent untouched while still demonstrating the workflow.
Cross-platform note
ClawMorph's core CLI is Node.js-based and is intended to work across macOS, Ubuntu/Linux, and Windows.
- Core commands (
list,preview,apply,rollback) are implemented in TypeScript/Node and are platform-friendly. - Demo entrypoints now use Node-based scripts instead of Unix-only shell helpers.
- For the smoothest first run on Windows, prefer the explicit
--pathmode before testing--agent.
Current scope
Included in this MVP
- role-pack listing
- workspace scanning
- preview planning
- apply with snapshots
- rollback of latest snapshot
Not included yet
- web UI
- plugin packaging
- OpenClaw skill wrapper
- role marketplace / registry
- team features
- cloud sync
Roadmap
Next likely improvements
- better README visuals / GIF demo
- improved real-agent path resolution
- cleaner generated sections and formatting
- import/export role packs
- optional OpenClaw skill wrapper around the CLI
Development
git clone https://github.com/ViccHoo/clawmorph.git
cd clawmorph
npm install
npm run build
npm test
npm run demo
License
MIT
No comments yet.