Troubleshooting
What you see, why, and what clears it. npx opencastle doctor names most of these itself, with the command that fixes each.
Commands
opencastle: command not found.npx opencastle initruns OpenCastle without installing it. Run every command the same way —npx opencastle sync— or install it once withnpm i -D opencastle, which also pins the version for everyone.Unknown command.npx opencastle --helplists the commands, andnpx opencastle help <command>one command's options. A removed command says what replaced it.unknown setting "…"in.opencastle/config.json. A misspelled key; the message suggests the one meant. Point your editor at the schema with"$schema"to catch it as you type.
CI and drift
sync --checkfails on a pull request. A generated file no longer matches what its sources compile to. The report names each file and how it drifted: changed (edited by hand — make the edit in.opencastle/instead), missing or outdated (sources changed without a recompile), or extra (a file added to a generated directory). Runnpx opencastle syncon the branch and commit the result. On GitHub Actions each file is annotated in the pull request with its own fix.- A dependency bot's baseline bump fails the check. The new baseline compiles to different files, and the bot cannot recompile. Check out its branch, run
npx opencastle sync, and push;npx opencastle reviewon that pull request says what the new version changes for this repository's assistants. - A file of yours disappeared after
sync. It was in a directory OpenCastle generates, such as.claude/agents/or.cursor/rules/;initandsync --checkname such files before they go. Restore it from git and move it into.opencastle/—instructions/,skills/<name>/oragents/— so it compiles for every assistant. A skill is the exception: one another tool wrote into a compiled skills folder — Devin proposes skills in.agents/skills/, Claude Code and Copilot write into theirs — is kept.syncmoves it into.opencastle/skills/and compiles it for every assistant;sync --checklists it under "Skills another tool added" until then. - A merge conflict in
.opencastle/lock.json. The lock is generated. Resolve the conflicts in the sources, take either side of the lock, runnpx opencastle sync, and commit the lock it writes. - An MCP server "needs fixing by hand". A server someone added to an MCP config that the team's policy does not allow, or that runs an unpinned or unknown package.
synccannot change a server it did not write;npx opencastle doctornames the server and what is wrong with it.
Versions and upgrades
This project was compiled by OpenCastle X; this is Y. You are running an older OpenCastle than the one that compiled the project, and compiling would take every teammate's files back. Runnpx opencastle@X, or add OpenCastle todevDependenciesso everyone runs one version.--allow-downgradegoes back on purpose.- A baseline is older than the one the lock records. Your
node_modulespredates a bump. Runnpm install(or your package manager's), then sync. - A baseline cannot be found. An npm baseline must be installed: add it to
devDependencies, and in CI install the dependencies before OpenCastle runs. A path inextendsresolves from.opencastle/, so abaseline/directory at the project root is"../baseline". - Upgrading.
npm i -D opencastle@latest, thennpx opencastle sync; it names each file it removes and counts the ones it changes, andgit diffshows them all. Commit the result.
MCP servers and secrets
- A server fails to start or to authenticate. It usually needs an environment variable.
npx opencastle explainlists the ones you have not set, and which server needs each. Set them in your shell, or in.envat the project root — never in a committed file;initwill not write into a.envthe repository commits. - VS Code asks for a token. A token inside a remote server's header is a password input VS Code asks for once and keeps. A server's environment variables come from
.env. - Codex does not load the servers. Codex reads
.codex/config.tomlonly in a project you have marked as trusted. Trust the project when Codex asks. - A server asks you to sign in in a browser. Expected for servers that use OAuth (Linear, Notion, Supabase, Vercel and others): the first time it starts, then never again.
In your assistant
- The
/oc:commands do not appear. Restart Claude Code, or in VS Code run Developer: Reload Window. Cursor, Windsurf, OpenCode, Codex and Antigravity have no slash commands for them: ask for a prompt by name — "run the bug-fix prompt". - The assistant does not know the project.
npx opencastle doctorsays when.opencastle/project.instructions.mdis still a template, and how much is left to describe. Run/oc:bootstrap-customizations, or ask for the bootstrap-customizations prompt. - An edit to
project.instructions.mdhas no effect. It is compiled into what every assistant always loads. Runnpx opencastle syncafter editing it. - An agent tries to log its session and is told the command was removed. The project was compiled by an earlier release, whose instructions asked for it. Run
npx opencastle sync.
Lessons
doctor: an assistant keeps memories the team does not have. The project is not compiled for the assistant its people work in — set up for VS Code, say, and used with Claude Code — so that assistant has no hook to share what it remembers and loads none of the lessons. Runnpx opencastle init --customizeand choose it as well.- What the agents remembered never becomes a lesson. The memory hook is written only for the assistants the project compiles for, and runs only in a folder the assistant trusts: accept Claude Code's or VS Code's workspace trust prompt. In VS Code, hooks are a preview feature, on unless
chat.useHooksis off. Check the hook is there withnpx opencastle sync --check, and runnpx opencastle promote memory --dry-runto see what it would share. Memories saved as about you are never shared, by design. doctor: a lesson cites code that has changed. Read the lesson against the code. Still true:npx opencastle lesson verify <id>, with--cite <new path>if the code moved. No longer true, or now in a skill:npx opencastle lesson archive <id> --into <file>.promote memoryfinds no memory. It reads Claude Code's, VS Code's (Copilot Chat) and Codex's, once one of them has saved a memory about this repository; Codex's is off until you turn memories on. Cursor keeps its memories on its servers and Copilot Memory lives on GitHub, so neither can be read: ask the assistant to write what it learned withnpx opencastle lessoninstead.doctor: the lessons index is large. Every agent reads it before every task. Move the lessons that keep coming up into the skill or instruction file they are about, and archive them there.- A lesson is refused. It names a category or severity that does not exist —
.opencastle/LESSONS-LEARNED.mdlists them — cites a file that does not exist (paths are relative to the project root), or would commit something that looks like a credential.
Convoy
- The plan or the run cannot start an agent. A convoy runs on the agent CLI
initset up —claude,codex,cursor-agent,opencodeorcopilot— which must be installed and signed in.--adapter <name>picks another. - The tasks do not see your latest change. Each task starts from the last commit. Commit before you run.
- A run stopped, or failed part-way.
npx opencastle convoyshows the last run and the one next step;npx opencastle convoy resumecontinues whatever is not done.npx opencastle convoy dashboardshows each task, its review and the checks.