How to have Claude Code write a mod for you, and keep it after the session ends
You can describe a Claude Code mod in one sentence and have Claude write it. The catch is that it lives in a per-session folder that gets cleaned up. Here is the whole loop, and how to keep the mod.
The quickest way to get a Claude Code mod is to ask for one. Claude works from a built-in skill called plugin-authoring, which tells it where to write the mod, which events and methods your version has, and how the mod loads. You need Claude Code 2.1.287 or later in the terminal; the desktop app's Code tab supports mods from 2.1.286.
The loop
- Describe it. In an interactive session, ask in your own words, for example: make a mod that shows the current git branch above the prompt. You can also load the skill yourself with /plugin-authoring.
- Approve the files. In default and acceptEdits modes, Claude Code asks you to approve each file, because the mods folder is a protected path.
- Turn on hot reloading. When the first file is saved, Claude Code asks whether to enable it for the session. Yes means the mod loads when the turn ends and reloads after each turn that changes it. Not now means it loads the next time that session starts.
- Check it loaded. Run /plugin and open the Installed tab; the mod is listed there and can be turned off.
- Iterate. Tell Claude what to change. If a transcript line starting with the mod's name says the change didn't load, paste that line into your next message: Claude doesn't see it unless you do.
Keep it, or lose it
Claude writes the mod into a folder for that session, under ~/.claude/dev-mods/ followed by the session ID. A mod written there loads only in the session that made it, and Claude Code deletes the folder once it is older than the cleanupPeriodDays setting. To keep a mod, copy its directory somewhere of your own and load it from there, or add it to a marketplace so other people can install it.
Replace <session-id> with your session's ID; the folder name under ~/.claude/dev-mods/ is the same ID.
mkdir -p ~/mods
cp -R ~/.claude/dev-mods/<session-id>/git-branch ~/mods/git-branch
claude plugin validate ~/mods/git-branch
claude --plugin-dir ~/mods/git-branchTwo things to know first
- In auto and bypassPermissions modes, Claude Code can turn on hot reloading without asking, so a mod Claude writes loads at the end of the turn. If you want to review it first, start the session in default or acceptEdits mode.
- When you resume a session, the mods already in its folder can load without asking, including in claude -p. To stop one from loading, delete its directory.
A mod you wrote with Claude runs with your permissions like any other, so it is worth reading the files before you copy one out and start loading it everywhere.
Related on claudefox
- What a Claude Code mod can do on your machine, and the guard many solo users don't get
- Six weeks after launch, about 2,300 GitHub repos call themselves a Claude Code mod
- HeyGen's HyperFrames lets Claude Code write videos as HTML
Source: Create a mod (Claude Code docs), Mods overview (Claude Code docs)
This story first appeared in the claudefox daily briefing for November 14, 2026.