Skip to content

persona

Know where you standv1.0.0

Pick a role, and Claude only edits what that role may touch.

claude: persona
What you are seeing With the UI/UX Designer persona, Claude edits a button style but is blocked from changing an API file. The footer shows the active role.

Install

o-mods
  1. Add the o-mods collection (once):

    claude plugin marketplace add omeerdvrn/o-mods

  2. Install this mod:

    claude plugin install persona@o-mods

Then run /reload-plugins in any open Claude Code session.

First time? Set up o-mods

Author
omeerdvrn
Version
1.0.0
License
MIT
Tags
persona, role, guard, permissions
Source on GitHub
Source on GitHub

Sets the role Claude works for on this machine. Each persona adds a role prompt to the system prompt and denies edits and shell commands outside its scope. A denied call never runs. Claude is told to explain the change that's needed instead of working around the block.

Personas ​

IdNameMay editBlocked
ui-uxUI/UX DesignerComponents, pages, styles, assets, stories, Tailwind and PostCSS configAPI, server, database, migrations, .sql/.prisma/.graphql, secrets, infra, DB and deploy commands
backendBackend DeveloperEverything except UI.tsx/.jsx/.vue/.svelte, stylesheets, components/, public/, secrets, deploy commands
devDeveloperAll application codeSecrets, CI workflows, Docker, Terraform, Kubernetes, Helm, deploy commands
qaQA EngineerTests, specs, fixtures, mocks, snapshots, test configApplication code, secrets, migrations, deploy commands
docsTechnical WriterMarkdown, MDX, docs/, READMEs, changelogsCode, secrets, DB and deploy commands
pmProduct ManagerNothing in the projectEvery write, git commit/push/reset, package installs, DB and deploy commands

Use ​

/persona            # status and list
/persona ui-ux      # switch (names work too: /persona designer)
/persona off        # clear

The choice is saved on this machine and applies to every session and project. The persona shows at the end of the hint line under the prompt.

  • In terminals that show pictures through the kitty graphics protocol (kitty, Ghostty, and others with it on), it is the Claude crab dressed for the role, one row tall, then the role's name.
  • In the Claude desktop app, which shows no hint line, the role's name joins the footer's mode labels, beside the model.
  • In every other terminal, including inside tmux and other multiplexers, it is the role's name alone.

The mod finds out which by trying once: it draws the picture, and when the terminal shows the picture's placeholder text instead, it switches to the name.

Showing the crab in WezTerm and herdr ​

kitty and Ghostty show the crab with no setup. WezTerm, and herdr in front of it, need three settings. persona sets them for you:

CommandWhat it does
/persona picturesLists what this machine needs, file by file. Changes nothing.
/persona pictures fixMakes those changes, keeping a backup of each file, and says what to restart.

The changes:

  • WezTerm config: config.enable_kitty_graphics = true.
  • herdr config, before herdr 0.9: [experimental] kitty_graphics = true. From 0.9, herdr has this on by default.
  • Shell profile (zsh, bash or fish): inside herdr only, CLAUDE_CODE_FORCE_TERMINAL_IMAGES=1. herdr calls itself tmux, and its terminal (libghostty) is not on Claude Code's list of terminals that show pictures, so Claude Code needs telling.

After the fix, quit WezTerm and open it again, then start Claude Code from a new herdr pane.

When the crab cannot show but the terminal can be set up for it, persona says so once, in a notification. /persona status says whether the picture showed, and why not when it did not.

persona never changes these files on its own. They are your terminal's and shell's settings, so they change only when you run /persona pictures fix.

PersonaThe crab
Developerheadphones, a laptop in front
UI/UX Designera beret, a brush held up and a palette
Backend Developera hard hat with a lamp, a server rack
QA Engineera detective's cap, a magnifying glass
Technical Writera pencil behind the ear, an open book
Product Managera clipboard

A persona you define in a file gets the crab alone. The crab is 16×8 pixel art, drawn as a picture four cells wide and one row tall.

To pin a persona without the command, set CLAUDE_PERSONA in ~/.claude/settings.json:

json
{ "env": { "CLAUDE_PERSONA": "ui-ux" } }

CLAUDE_PERSONA wins over the saved choice. CLAUDE_PERSONA=off disables personas for that shell.

What it checks ​

  • Edit, Write and NotebookEdit: the target path, and the real path when it is a symbolic link.
  • Bash: each persona's blocked command patterns, plus the files a command visibly writes: redirects (>, >>), tee, sed -i, perl -i, rm, mv, touch, mkdir, copy destinations, and git checkout/restore/rm/mv. patch and git apply are denied under a restricted persona because their target files can't be checked.
  • Rules apply to files inside the session's working directory. Outside it, for example scratch files, memory and plans, only the blocked list applies.

The Bash check is best effort. A script that writes files on its own (python -c, node -e, a build step) isn't read.

Customize ​

Add a JSON file per persona in ~/.claude/personas/ for this machine, or in <project>/.claude/personas/ for one repository. Both are read at session start and on every /persona call, and the project file wins. A file with a built-in id changes that persona. Any other id adds a new persona.

json
{
  "id": "ui-ux",
  "extraAllow": ["src/hooks/use*.ts"],
  "extraDeny": ["src/lib/api-client/**"],
  "extraBashDeny": ["\\bnpm\\s+run\\s+db:"]
}
FieldMeaning
id, name, summary, promptIdentity and the text added to the system prompt
writes"none", or { "allow": [globs], "deny": [globs] }. Without allow, any path that isn't denied may be written. A deny match always wins.
bashDenyRegular expressions for blocked commands
extraAllow, extraDeny, extraBashDenyAdded to the existing lists instead of replacing them

Globs are matched against the path relative to the project. ** spans folders, * and ? match within one folder, and {a,b} matches either.

Develop ​

claude plugin validate mods/persona
claude plugin test mods/persona

Edit this page on GitHub