Upgrading
When a new version of Worclaude is released, you can update your project's workflow files without losing your customizations. This page covers Scenario C: upgrading a project that was previously set up with Worclaude.
When to Upgrade
First, update the Worclaude CLI itself:
npm install -g worclaude@latestThen check if your project has available updates:
worclaude diffThis compares your current setup against the latest workflow version and shows what has changed:
Comparing current setup to workflow v2.4.6:
Modified (your changes):
~ CLAUDE.md (added 5 gotchas)
~ .claude/skills/testing/SKILL.md (added pytest patterns)
Missing (will be restored by upgrade):
- .claude/hooks/learn-capture.cjs
- .claude/agents/doc-writer.md
Deleted (removed in current version):
- .claude/agents/retired-agent.md
Extra (you added):
+ .claude/skills/my-custom-skill.md
+ .claude/agents/my-custom-agent.mdThis is a read-only command -- it does not change anything. Use it to decide whether an upgrade is worth doing.
The two "Missing" categories behave differently during worclaude upgrade:
- Missing (will be restored) — file is tracked in
workflow-meta.jsonand still shipped by the current CLI. The nextupgraderun will re-install it from the template. - Deleted (removed in current version) — file is tracked in
workflow-meta.jsonbut no longer in the current CLI's templates (the workflow retired it). Upgrade will drop it from tracking; the on-disk state (gone) stays gone.
Running the Upgrade
worclaude upgradeWorclaude reads your .claude/workflow-meta.json to understand what was originally installed and what version you are on:
Worclaude Upgrade
Current version: 2.4.5
New version: 2.4.6If you are already on the latest version and nothing has drifted from the installed state, Worclaude prints Already up to date (vX.Y.Z) and exits. If versions match but some files have been deleted from disk, Worclaude enters the Repair-only flow described below.
Flags
worclaude upgrade accepts three optional flags:
| Flag | Purpose |
|---|---|
--dry-run | Preview the planned changes and exit without writing anything |
--yes | Skip the interactive confirmation prompt (useful in CI or scripted flows) |
--repair-only | Run only the drift-repair pass; skip template updates even on version mismatch |
# Preview first, apply second
worclaude upgrade --dry-run
worclaude upgrade
# Non-interactive repair for CI
worclaude upgrade --repair-only --yesHow Change Detection Works
Worclaude uses SHA-256 hashes stored in workflow-meta.json to categorize every file. Files split into these groups:
- Auto-update — Files you have not modified since installation. Safe to replace with the new version.
- Conflict — Files you have customized AND the workflow has updated. The new version is saved under
.claude/workflow-ref/<same-path>(preserving the original filename); review manually. - New files — Files that did not exist in the previous version. Added directly.
- Missing (will be restored) — Files tracked in
workflow-meta.jsonbut missing on disk, and still shipped by the current version. Restored from templates during the repair pass. - Deleted (removed in current version) — Files tracked in
workflow-meta.jsonbut no longer in the current templates. Dropped from tracking. - Unchanged — Neither you nor the workflow made changes. Nothing to do.
- Modified — You customized the file and the workflow has not updated it. Preserved as-is.
The preview shows each non-empty category before anything is written:
Changes:
+ Restore (missing from disk):
+ hooks/learn-capture.cjs
✓ Auto-update (unchanged since install):
✓ agents/plan-reviewer.md
✓ agents/code-simplifier.md
✓ 12 more files
~ Needs review (you've customized these):
~ skills/context-management.md (modified since install)
+ New in this version:
+ agents/incident-responder.md
~ Also:
~ CLAUDE.md memory guidance missing (will write .claude/workflow-ref/CLAUDE.md sidecar)
= Unchanged: 8 files
~ Your customizations (no workflow updates available):
~ skills/testing.md
? Proceed with upgrade? (Y/n)The Repair-Only Flow
If your CLI and installed versions match but worclaude doctor reports drift — typically missing hook scripts, a missing AGENTS.md, a missing .claude/learnings/ directory, or CLAUDE.md without memory-architecture guidance — worclaude upgrade runs a repair-only flow. It restores missing files and writes sidecars without bumping the recorded version:
Worclaude Repair (v2.4.6)
Drift detected:
+ Restore (missing from disk):
+ hooks/pre-compact-save.cjs
+ hooks/learn-capture.cjs
+ hooks/correction-detect.cjs
+ hooks/skill-hint.cjs
~ Also:
~ .claude/learnings/ directory missing (will be created)
~ CLAUDE.md memory guidance missing (will write .claude/workflow-ref/CLAUDE.md sidecar)
? Repair drifted files? (Y/n)You can force this flow on any version with worclaude upgrade --repair-only, which applies the repair pass and skips the template-update step even when a newer version is available.
Tracked files added in v2.4.6
Earlier versions of worclaude upgrade did not track hook scripts or AGENTS.md, so deleting them went undetected. v2.4.6 fixes this by adding hooks/*.{cjs,js} and root/AGENTS.md to the tracked file set. Projects initialized before v2.4.6 pick up these entries automatically on first upgrade:
- Hook scripts and
AGENTS.mdalready on disk with unmodified content get quietly tracked inworkflow-meta.json. - User-edited hook scripts or
AGENTS.mdon disk — bytes that do not match the template — are preserved, and a reference copy is written under.claude/workflow-ref/<path>so you can compare and merge manually.
CLAUDE.md handling
CLAUDE.md is always considered user-owned; worclaude upgrade never edits it in place. If it lacks memory-architecture guidance keywords (memory architecture, .claude/learnings, [LEARN], /learn, etc.), upgrade writes a sidecar at .claude/workflow-ref/CLAUDE.md with a suggested snippet. Paste the snippet into your CLAUDE.md wherever makes sense, then delete the sidecar.
What Happens During the Upgrade
After you confirm, Worclaude:
- Creates a backup of your entire Claude Code setup (same timestamped backup as Scenario B).
- Auto-updates files you have not touched -- replaces them with the new version directly.
- Saves conflict files under
.claude/workflow-ref/<same-path>(preserving original filenames), so you can review and merge at your own pace without the reference copies being discovered as live slash commands or agents. - Adds new files directly to your
.claude/directory. - Merges settings.json -- appends any new permissions and hooks using the same tiered logic as the initial merge (new permissions are appended, hook conflicts are prompted).
- Updates workflow-meta.json with the new version number, timestamp, and recomputed file hashes.
Upgrade complete! (2.4.5 → 2.4.6)
Restored: 4 files
Updated: 14 files
Conflicts: 1 files (saved under .claude/workflow-ref/)
New: 1 files added
Unchanged: 8 files
Customized: 2 files (no updates needed)
Sidecar: 1 suggestion files
Backup: .claude-backup-20260419-091500/
Review files under .claude/workflow-ref/ and merge what's useful.Optional Features and Observability (Phase 3 + 6a)
worclaude upgrade can scaffold features that did not exist when the project was originally initialized:
- Optional features registry (Phase 3 T3.9): when the upgrade detects that the project lacks an opt-in feature shipped by the current CLI (e.g., the GitHub Action plugin scaffold or a memory-architecture template), it prompts via
AskUserQuestion. Decline once and it stops asking — the choice is remembered inworkflow-meta.jsonunderoptedOutFeatures. - Observability infrastructure (Phase 6a PR C): existing installs from before v2.7 receive
.claude/observability/(with.gitkeep), the three observability hook scripts (obs-skill-loads.cjs,obs-command-invocations.cjs,obs-agent-events.cjs), and theInstructionsLoaded/SubagentStart/SubagentStopsettings entries via the standard auto-update path. Capture is gated byWORCLAUDE_HOOK_PROFILE—minimalskips it,standardandstrictenable it. See Observability.
Both flows are silent when nothing applies. Both honor --yes for non-interactive runs.
Upgrading from v1.x to v2.0.0
v2.0.0 introduces Claude Code runtime integration. Two structural changes require migration:
What changed:
- Skill format: Flat
.mdfiles replaced withskill-name/SKILL.mddirectory format. Claude Code silently ignores flat files in the skills directory. - Agent frontmatter: The
descriptionfield is now required. Without it, agents are invisible to Claude Code's/agentslisting and routing. - New skill:
coordinator-modeadded for multi-agent orchestration. - New doctor checks: CLAUDE.md size limits, skill format validation, agent description verification.
What worclaude upgrade does automatically:
- Migrates skill files from flat to directory format (e.g.,
testing.md→testing/SKILL.md) - Moves corresponding reference copies into skill directories
- Patches agent files with missing
descriptionfrontmatter (auto-patches unmodified agents; prompts for modified ones) - Updates hash keys in
workflow-meta.jsonfor the new skill paths
How to verify the upgrade:
- Run
worclaude doctor-- all new checks should pass - Start Claude Code and run
/skillsto confirm skills are loaded with descriptions - Run
/agentsto confirm all agents are visible - Check that conditional skills activate only when working on matching files
If something went wrong: Run worclaude restore to roll back from the automatic backup.
Handling Conflict Files
After the upgrade, review any files under .claude/workflow-ref/ the same way you would after a Scenario B merge. Each reference mirrors the path of the live file it corresponds to (e.g. .claude/workflow-ref/commands/sync.md is the new template for .claude/commands/sync.md). Open the reference alongside your customized version with diff, merge what is useful, and delete the reference when you are done.
See Existing Projects for detailed guidance on reviewing reference files.
Upgrading from pre-v2.5.1 installs
Pre-v2.5.1 wrote reference copies as *.workflow-ref.md siblings next to the live file, including inside .claude/commands/ — where Claude Code's command loader picked them up as phantom slash commands. The first worclaude upgrade to v2.5.1+ automatically relocates any legacy reference files into .claude/workflow-ref/<original-path>. If a reference already exists at the new location (because both a stale legacy copy and a fresh one from this upgrade would land there), the legacy file is left in place and reported as skipped — resolve it manually.
Restoring After a Failed Upgrade
If something goes wrong, restore from the backup:
worclaude restoreSelect the backup that was created during the upgrade and your setup will be restored to its pre-upgrade state.
Next Steps
- Workflow Tips -- Best practices for working with Claude Code
- Existing Projects -- How the merge system works in detail
- Getting Started -- Full setup walkthrough for new projects