11. Upgrading from claude-factory
The data folder is now ~/.spaghetti-code-foundry (or SCF_HOME / FACTORY_HOME if you set one).
The .claude-factory/ folder inside each repository does not change.
What happens. On the first start of any scf command except help, the whole
~/.claude-factory folder is copied to ~/.spaghetti-code-foundry: config, runs, flows, blocks,
learnings, queue, locks and evals. The copy is made next to the new folder and renamed into place
in one step, so you never see a half-done move. Paths that point into the old folder (in run state,
lock files, queue.json and config.yaml) are rewritten. If config.yaml can't be rewritten
safely, it is kept as it was and a warning lists the values that still point to the old folder.
users.json, sessions.json, credentials.json, refinements.json and help.json are copied unchanged, with their mode. The skill-quarantine/ folder is copied unchanged too.
The backup. ~/.claude-factory is never changed or deleted, except for a note file
MOVED-TO-SPAGHETTI-CODE-FOUNDRY.txt. Nothing there is used anymore: your settings now live in
~/.spaghetti-code-foundry/config.yaml, and the old ~/.claude-factory/config.yaml is only a copy.
You can delete the folder once everything works.
When the move waits. Nothing is copied when you set SCF_HOME / FACTORY_HOME, when the new
folder already exists (it is never overwritten), while a run is running, when free space is short
(size + 10% + 100 MiB), or when something in the old folder changed while it was copied. The move is
tried again on later starts, and every minute by an idle scf ui / scf serve. A run counts as
running when its run.json can't be read, or its status is running and it has no recorded pid
(from the old version) or its pid is alive. The message names these runs. For a run that crashed,
run scf resume <id> (or delete a leftover run folder without run.json).
Worktrees. Runs that use a git worktree are repaired with git worktree repair, so a waiting
run can be approved and resumed in the new folder. The workspaces left in the backup are no longer
linked to your repositories. If a repair fails, everything is put back and the old folder stays in
use. If an interrupted move left the repair unfinished, the next start finishes it.
Servers on the old folder. A running scf ui or scf serve that still uses the old folder
refuses changes after the move (HTTP 503) and restarts onto the new folder when it is idle. Other
processes on the old folder refuse to start runs; restart them. Stop old factory watch processes
before you upgrade: they run old code and can't join the lock the move uses.
If the new folder is missing. When the note exists but ~/.spaghetti-code-foundry is gone,
scf refuses to run (help still works) and never copies the backup a second time by itself. Restore
the folder, set SCF_HOME to the folder you want, or delete the note file to copy again.
Login service. Run scf service install once, so its log and settings move to the new folder.
scf service status tells you when it is still needed.
The command. If factory still points at the old install, run
npm unlink -g claude-factory && npm link in the repository.
The repository. It is now MeloMar-IT/spaghetti-code-foundry. GitHub redirects the old
address. In an existing clone, run
git remote set-url origin https://github.com/MeloMar-IT/spaghetti-code-foundry.git.
The folder of your clone can keep its name.