/config-history:setup [a folder path, or new computer, optional]from Config History
Set up config-history. Choose where your Claude Code config history is saved, in the plugin's own folder or a folder such as a Google Drive folder that gets backed up, or set up a new computer from a history saved in such a folder.
Ships in Config History. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Help the user choose where config-history saves the history of their Claude Code config, or set up this computer from a history in a folder. config-history saves nothing until this choice is made. Each computer keeps its own history in its own subfolder of the chosen folder. Speak in plain words and keep each message short.
What the user asked for, which may be empty: $ARGUMENTS
Use it to skip a question it already answers, such as the folder's path, or "new computer" for restoring. Never use it to skip a confirmation.
Every question you ask in these steps offers "Cancel, change nothing" as its last choice: what to do, which folder, which history and version, which files, encryption, key files, and each confirmation. If the user picks it, say that nothing was changed and stop. After a restore has run, say instead that nothing more was changed, here and whenever the steps below say "nothing was changed".
Rules for every step:
cat, no Read tool, nothing that opens it. Only pass its path to the commands below.$(, any other $, or a line break, run nothing and ask for the path again. This covers the paths the user types, the history paths the scan prints and the file paths a preview lists. A path that starts with / or ~, pasted by dragging a folder from Finder, can have a backslash before each space or other special character (My\ Drive) or be wrapped in single quotes; remove those backslashes or quotes first. In a Windows path the backslashes separate folders (G:\My Drive\Backups) and stay, but remove one at the very end, since it would escape the closing quote./config-history:undo, or ask them in plain words. Never tell them to run config-history themselves: it exists only in Claude's shell.config-history folder show and config-history folder show --json, exactly as written, run without asking. Every other command makes Claude Code ask the user for permission first. That is expected; do not try to avoid it. If the user declines a permission prompt, say that nothing was changed and stop.Run config-history folder show --json. If setup is "none", config-history is not set up yet: tell the user in one or two lines that it is not set up, so nothing is being saved yet. If history_path is not null, this computer has a history from an earlier setup there: also say how many versions it holds (versions), or, when versions is null, that it cannot be read, so its versions were not counted. Say that setting it up starts a new history and keeps them, moved whole to a folder beside history_path. Then go to step 2. Otherwise tell the user in one or two lines where the history is saved now (the folder in history_folder when setup is "folder", the default local folder when it is "default", a backend set up with claude-cfg init when it is "backend"), whether it is encrypted, how many versions there are (versions) and whether automatic saving is on (autosave). If available is false, also show problem. Then:
copied_from_another_computer is true, explain: this computer's config-history settings were copied from another computer, such as by Migration Assistant, a backup restore or a disk clone, so nothing is saved until this computer gets its own history. Ask whether to give it one in the same folder (history_folder) or in another folder, with "Cancel, change nothing" as the last choice. For the same folder, use history_folder as and go to step 6; for another, go to step 3. Either way this computer gets a new subfolder, the versions saved so far are copied into it, and the other computer's history is left alone.setup is "folder", encrypted is true and key_file_present is false, this computer's key file is missing, so nothing can be saved to the folder or read from it. Say so, and do not offer a new key: the versions there need the old one. Ask for the full path of their copy of the key file, with "Cancel, change nothing" as the last choice. Then use history_folder as , take --key-file "<key file>" as the encryption choice, and go to step 7.Ask what they want to do, with these choices:
setup is "none".setup is "folder".Ask for the folder's full path, with "Cancel, change nothing" as the last choice, unless the user's request above already gave it. Tell them how to find it: on a Mac a synced Google Drive folder is under ~/Library/CloudStorage/, such as ~/Library/CloudStorage/[email protected]/My Drive/Backups, and dragging a folder from Finder into the terminal pastes its path; on Windows Google Drive is a drive letter, such as G:\My Drive\Backups. The folder must exist already; config-history never creates it. Check the path, then run config-history folder scan "<path>" --json. If it fails, show its output and ask for the path again, with "Cancel, change nothing" as the last choice.
If the scan has parent_hint, do this before anything else in this step: the folder given looks like the history of one computer, not the folder that holds the histories. Ask whether they meant its parent folder (parent_hint), recommended, or really this folder, with "Cancel, change nothing" as the last choice. For the parent folder, use it as and scan it, as in step 3; for this folder, go on with this scan: its history can be restored from, but config-history does not save into it.
Show what the scan found, one line per history: the computer's name (computer_name; for a root history say it was made by claude-cfg init), the number of versions, the date of the newest (newest_timestamp), and "encrypted" when encrypted is true or "partly encrypted" when it is false and encrypted_versions is more than 0. When two histories have the same computer_name, add each one's folder name (computer_id) and newest date, here and in every choice below. Mark this computer's own (this_computer). If empty_version_files is more than 0, say that that many version files are not downloaded on this computer yet. If skipped_folders is more than 0, say in one sentence that that many folders look like copies made by a sync conflict and were left out. If it found nothing, say so.
root history, and the user came to restore, or versions in step 1 was 0, or setup in step 1 was "none", ask whether to restore settings from one of them. List each by name, then "Not now, just save here", then "Cancel, change nothing" as the last choice. Stop and wait for the answer. For a history, go to step 5; for "Not now", go to step 6.Restore from the chosen history. Below, is the path the scan printed for it and N is a version number, digits only.
--key-file "<key file>" at the end. An encrypted or partly encrypted root history uses a passphrase, which this skill never takes: say that it can be restored with claude-cfg restore in a terminal, on a computer set up for that folder with claude-cfg init, and stop.config-history history --from "<history>" to list its versions (--limit 30 shows more). Choose the version as /config-history:restore does: use a number the user gave; match a description such as "yesterday" to one version, and ask when more than one could match; with neither, show the three to five newest (number, when, what changed) and ask which one they want, with "Cancel, change nothing" as the last choice. Stop and wait for the answer.config-history restore --dry-run --from "<history>" --point N.--allow-plain to the preview and to the restore.--only "<file>" per file or folder they chose and preview again.--dry-run: config-history restore --from "<history>" --point N, plus the same --only, --key-file and --allow-plain options. Never add --exact here./config-history:undo reverts this restore. Plugins listed in the restored settings may need installing again from /plugin, and they need to sign in again, since credentials are never saved. Then ask whether this computer should start saving its own history in this folder too, with "Cancel, change nothing" as the last choice. For yes, go to step 6. When setup was "none", say first that nothing is saved on this computer until it is set up, and offer the plugin's own folder on this computer as a second choice, before "Cancel, change nothing"; for that choice, go to step 10. If they cancel, say that they can type /config-history:setup again later.Ask whether to encrypt the history in the folder, and recommend yes, in at most three short lines: config-history makes a random key and keeps it in a file on this computer only; keep a copy of that file in a password manager; without that file the history in the folder cannot be read. The choices:
encrypted and key_file_present both true: "Encrypt with this computer's key file (recommended)". This uses --encrypt, which uses that file again.--key-file "<key file>"; ask for the path if you do not have it yet.--encrypt.--no-encrypt. If the user picks it, say once and plainly that anyone who can open the folder, including the sync provider and anyone who gets into the account, can read whatever is in their settings, keys included.Before changing anything, show a short summary:
setup was "none" and the scan showed no history of this computer (this_computer) in the folder: that a new history starts there, that the first version of their settings is saved right away, and that automatic saving will be onsetup was "none" and the scan showed a history of this computer in the folder: that the versions this computer saved there before are kept as they are, that a full copy of their settings is saved right away as the next version, and that automatic saving will be onsetup was "none" and history_path was not null: that the versions an earlier setup left on this computer are not copied: they are moved, whole, from history_path to a folder beside it, which the output names, and can still be restored from theresetup was "default" or "folder": that the versions saved so far are copied there, and the current history stays where it issetup was "backend": that this replaces the backend set up with claude-cfg init, whose versions are not copied and stay where they are, that a copy of the old config is kept, and that automatic saving will be turned on
Ask: "Set this up now?" Then stop and wait for the answer, with "Cancel, change nothing" as the last choice. Go on only after a clear yes. A vague answer, another question, or no answer means nothing is set up: say that nothing was changed and stop. Claude Code's permission prompt is a second check, never a replacement for this confirmation.Run config-history folder use "<path>" followed by exactly one of --encrypt, --no-encrypt or --key-file "<key file>", as chosen. Add --replace-backend only when setup was "backend" and the user said yes in step 7. If the output starts with "Already saving to", tell the user it was already set up this way and stop. Any other output that is not a success is a failure: see "When a command fails". Otherwise report from the output:
To go back to the default folder: say that the history will be saved in the default local folder again, not encrypted, and that the versions in the chosen folder are copied back and also stay in that folder. Ask: "Go back to the default folder now?" Then stop and wait for the answer, with "Cancel, change nothing" as the last choice. Go on only after a clear yes; anything else means nothing is changed: say that nothing was changed and stop. Then run config-history folder use-default and report from its output.
If it fails because the folder is not available (its output says "add --no-copy"), explain: the versions in that folder cannot be copied back while it is missing. Going back without copying them is only for a folder that is gone for good. Once this computer saves a new version in the default folder, which automatic saving does by itself at the next session, it can never save to that same folder again, because the two histories would hold different versions with the same number. The versions in the folder stay there and can still be restored from. If the folder may come back, such as a sync app that is signed out or a disk that is unplugged, recommend "Cancel, change nothing" and fixing that first. Ask: "Go back without copying the versions?" Then stop and wait for the answer, with "Cancel, change nothing" as the last choice. Only after a clear yes, run config-history folder use-default --no-copy and report from its output.
To save in the plugin's own folder on this computer, show a short summary:
.claude-cfg/history)history_path in step 1 was not null: the versions an earlier setup left there are moved, whole, to a folder beside it, which the output namesconfig-history folder use-default, never with an encryption option. If the output starts with "Already saving to", tell the user it was already set up this way and stop. Otherwise report from the output where the history is saved now (the "History folder set" line), what the line that says "Automatic saving is" says, and the save made at setup as in step 8. When a line starts with "Moved the", give the folder it names and say that those earlier versions can be restored from later (when the line says the history could not be read, only once it can be read again): they type /config-history:setup, choose to restore settings from a history in a folder, and give that folder's path. Say that they can type /config-history:setup again later to move the history to a folder that gets backed up.When a command fails, say what happened in plain words. For these outputs, also do what is listed:
It says "cannot write to": this computer cannot write to that folder. Ask for another folder, as in step 3.
It says "looks like the history of one computer": the folder given looks like one computer's subfolder, not the folder that holds the histories, and nothing can be saved into it. Ask whether to use the parent folder the output names instead, with "Cancel, change nothing" as the last choice. For yes, use it as and scan it, as in step 3.
It says "running on this computer right now": something else is saving right now. Wait a moment and run the same command once more. If it fails again, show its output and stop.
It says "A different key file is already set up": this computer already has a key file of its own and keeps it. Offer "Encrypt with this computer's key", which uses --encrypt, with "Cancel, change nothing" as the last choice, and say there are then two key files to keep copies of, this computer's and the other computer's. For that choice, go to step 7.
It says "Nothing was copied and nothing was switched": this computer's history in that folder and the history it saves to now hold different versions with the same number, so it cannot continue in that folder. That happens when it went back to the default folder without copying and saved versions since, or when it was set up again after config-history's settings file was deleted, and saved versions somewhere else. Offer to choose a different folder, as in step 3. The versions in that folder stay readable there, and the restore choice can still restore from them.
It says "no key on this computer opens it": the user chose "Do not encrypt", and versions already in this computer's subfolder there are encrypted with a key file or a passphrase this computer does not have. Ask for the full path of their copy of that key file, with "Cancel, change nothing" as the last choice, and go to step 7 with --key-file "<key file>". If they saved those versions with a passphrase, not a key file, say that this skill never takes a passphrase, and that the switch works once Claude Code is started with the passphrase in the CLAUDE_CFG_PASSPHRASE environment variable and this setup is run again. Then stop.
It says "does not open with this key": the user chose encryption, and versions already in this computer's subfolder there do not open with that key. The passphrase variable is not used with encryption, so it does not help here. What works is giving the key file those versions were saved with, or choosing "Do not encrypt", which keeps those versions as they are and works when this computer can still open them. Ask which of the two they want, with "Cancel, change nothing" as the last choice. For the key file, ask for the full path of their copy of it, with "Cancel, change nothing" as the last choice, and go to step 7 with --key-file "<key file>". For "Do not encrypt", go to step 7 with --no-encrypt; if this computer cannot open those versions either, that switch fails with the message about no key on this computer, handled above.
It says "that file is damaged": a version already in this computer's subfolder there is damaged or differs from this computer's. Offer to choose a different folder, as in step 3.
It says "is inside the tool's own folder": that folder is config-history's own folder on this computer, which holds its settings and the folders of earlier versions it moved aside, so it cannot be chosen as the folder to save to. Say so in plain words, then go to step 2 so the user chooses where to save: a folder of their own, or another choice there.
It says "could not be moved aside": a history an earlier setup left in config-history's own folder could not be moved aside to start a new one, so nothing was changed. The system did not let their user account rename that folder, for example because it is locked or belongs to another account. Give the folder the output names and the reason in brackets, say that once that is fixed they can type /config-history:setup again, and stop.
It says "config-history has not finished installing": the plugin has not finished installing on this computer. Tell the user that, and that they can start a new Claude Code session and then type /config-history:setup again. Run nothing else.
For any other failure, show its output and stop. Run no other commands.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub razamit/config-history --plugin config-history4 skills in this plugin
/historySaved versions of the user's Claude Code config in ~/.claude (settings, hooks, skills, agents, commands, CLAUDE.md). Use when they ask what changed in it, when Claude Code misbehaves after a change to it, or to see or save versions./restoreGo back to an earlier version of your Claude Code config. Pick a version by number or in your own words, see what would change, then restore all of it or only some files./undoUndo the most recent config-history restore.