NanoClaw

NanoClaw: Persona and rules

This page sets the voice and the standing rules for one agent, using the file NanoClaw actually reads. The steps were checked on 14 November 2026, against the project docs and the repository. Run them in Terminal on a Mac, or in the Ubuntu window on Windows. Keep the folder list empty, and keep egress lockdown on, for this whole page.

What NanoClaw calls it

NanoClaw uses one persona or soul file, named instructions.prepend.md, and standing rules live in that same file. The file sits in that agent's folder under ~/nanoclaw/groups/, and each agent has its own copy. When a container starts, the host pastes the file at the top of a generated CLAUDE.md, under the heading Persona. There is no system prompt box to type into, and there is no second rules file beside it. A provider other than Claude gets the same text at the top of its own project file.

Set a persona

1. Find the file and save a copy

Run the three commands below from the nanoclaw folder, and note your agent's id and folder from ncl groups list.

cd ~/nanoclaw
ncl groups list
find groups -name 'instructions.prepend.md' -print

Copy the file you are about to edit, and put the folder value where the command says <folder>.

cp "groups/<folder>/instructions.prepend.md" "$HOME/nanoclaw-instructions-backup.md"

What you should see ncl groups list prints your agent's id and folder, and find prints any existing persona path under groups. The backup file then appears in your home folder as nanoclaw-instructions-backup.md. If find prints nothing, there is no persona file yet, so the copy line says "No such file", and you create the file in the next step using the folder name from ncl groups list.

2. Write the voice

Open groups/<folder>/instructions.prepend.md in an editor, and create that file first if it is not there yet. Put the tone at the top of the file, using the short start in the box below.

Speak in short, plain sentences.

Save the file, then restart the group so your next message starts a fresh container with the new text. Put the id from ncl groups list where the command says <agent-id>.

ncl groups restart --id <agent-id>

What you should see the restart command finishes, and the instructions file contains the tone line you wrote.

3. Check the next reply

Send one short question that the new voice can answer without touching a file.

pnpm run chat "In one sentence, tell me how you should sound, and do not change any file."

What you should see one short sentence in the voice you wrote, and no new files outside groups.

Set rules

Use the same instructions.prepend.md for standing rules, and add the rule under the tone line. Do not put standing rules only in a memory file, because memory is for facts the agent has learned.

1. Add one rule

Add the line below under the tone line, then save the file before you restart.

Ask me before you delete a file.

Restart the agent so your next message starts a fresh container that reads the rule you just saved.

ncl groups restart --id <agent-id>

What you should see the instructions file contains both the tone line and the rule about deleting a file.

2. Check the next reply

pnpm run chat "Tell me what you should do before you delete a file, and do not delete anything."

What you should see the reply says it should ask you first, and nothing on the computer is deleted.

A different voice

Each agent has its own instructions.prepend.md, so a second agent is how you keep a different voice. Phone chats and the terminal share that same file when they both talk to the same agent. This guide could not confirm a persona that applies only to phone chats, or a rules file that covers only one folder on your computer. A template can stamp a new agent's instructions from ai.nanoco.nanoclaw/context/instructions.md inside its template folder, while the older bare context/instructions.md layout is rejected. After that stamp, editing the live agent still means editing its instructions.prepend.md, and restamping the template later resets those local edits unless you save them first.

What not to edit

Leave groups/<folder>/CLAUDE.md alone, because the host rebuilds that file every time a container starts. It mounts the generated file read-only, so an edit you make there disappears on the next start. The top of that generated file says it was composed at spawn and points you back to the instructions file. Leave container/CLAUDE.md alone, because that shared file is the base copied into every generated file. It includes the runtime contract the agent needs in order to use its tools, and an update can replace it. Your own lines belong in instructions.prepend.md, which the host does not regenerate. Leave groups/<folder>/memory/system/definition.md alone, because it holds the agent's own rules for filing memory. Facts belong in the other memory files, and tone belongs in the instructions file.

How to undo

The copy from the first step is the previous text, so copy it back and then restart the agent. If you are about to replace the file and you have no backup yet, copy the current file aside first.

cp "$HOME/nanoclaw-instructions-backup.md" "groups/<folder>/instructions.prepend.md"
ncl groups restart --id <agent-id>

What you should see the instructions file matches the backup, and the next reply follows that older text.

If the instructions file did not exist before you created it, delete that one instructions.prepend.md and restart. The host reads no persona lines from a file that is not there.

Rules are not a lock

The trade-off below is about standing rules, which shape the reply and do not lock the agent down.

Standing rules.

Sources

Opened 14 November 2026.

Next

Continue to Persona and rules.

Checked 14 November 2026 · prices, limits, and versions change