Skip to content

Swapping AI Personalities with the SOUL Evil Hook

Sometimes I find myself stuck in a loop of manual testing. I want to see how my agent reacts to a different set of instructions, but I don’t want to overwrite my main files or manage multiple branches for a simple experiment. It is frustrating to manually swap content back and forth just to test a specific edge case or a temporary personality shift.

The SOUL Evil hook handles this by swapping your SOUL.md content with an alternate file in memory. It happens during a specific “purge” window or based on a random chance you define.

  • OpenClaw installed and configured.
  • A SOUL.md file in your agent workspace root.

I recommend this setup if you want to test alternate behaviors without permanent changes. Here is how to get it running in four steps:

  1. Enable the hook Run this command in your terminal:

    Terminal window
    openclaw hooks enable soul-evil
  2. Create your alternate soul file Create a file named SOUL_EVIL.md in your agent workspace root. Place it right next to your original SOUL.md.

  3. Configure the swap logic Add the configuration to your JSON file. This example sets a 10% random chance and a scheduled window:

    {
    "hooks": {
    "internal": {
    "enabled": true,
    "entries": {
    "soul-evil": {
    "enabled": true,
    "file": "SOUL_EVIL.md",
    "chance": 0.1,
    "purge": { "at": "21:00", "duration": "15m" }
    }
    }
    }
    }
    }
  4. Run your agent When agent:bootstrap runs, the system checks these rules. If the purge window is active or the random chance hits, OpenClaw uses the content from SOUL_EVIL.md instead of your standard soul.

The system uses agents.defaults.userTimezone for the schedule if you have it set. If not, it defaults to your host timezone. Note that the purge window always takes precedence over the random chance setting.

  • Hook has no effect on sub-agents: Sub-agent runs do not include SOUL.md in their bootstrap files. This hook only works for the primary agent bootstrap process.
  • Warning in logs: If SOUL_EVIL.md is missing or empty, OpenClaw logs a warning. It will keep using your normal SOUL.md so the agent doesn’t break.
  • Files on disk aren’t changing: This is intended behavior. The hook only replaces content in memory before the system prompt is assembled.
  • SOUL.md is ignored: If SOUL.md is not in the bootstrap list, the hook does nothing.

Need help with your specific configuration? Ask the AI Setup Assistant.

OpenClaw

OpenClaw Expert

Still stuck?

If this page didn't answer your case, ask OpenClaw Expert for step-by-step guidance.