Cladding init
Use this workflow only when the user explicitly asks to initialize, adopt, or refresh Cladding. Opening a repository alone is not consent to initialize it.
Required host workflow
If the current user message itself matches APPLY CLADDING XXXXXX, do not call prepare or stage again. Call clad_init once and copy the entire user message, including the APPLY CLADDING prefix, into confirmation.
- If a greenfield request has no project intent, ask for one short description.
- Call
clad_prepare_initwith exactly one starting mode:
ideawith the user's description.documentwith a project-relative planning-document path.existingfor an existing codebase; include an optional adoption goal.
- Read the returned prompt and observations. Draft the structured object required by
clad_initusing the current host model, then callclad_stage_initwith the preparation token and that draft. Staging validates the draft and stores only ignored runtime state under.cladding/host/; it does not modify authored project files. - Show
plannedChanges, the stagedconfirmationQuestion, and its one-timeapprovalChallengeto the user, then stop and wait for a separate reply. The original initialization request is not confirmation. - Only when the user's separate reply exactly matches
approvalChallenge, callclad_initwith the entire reply verbatim asconfirmation—never strip theAPPLY CLADDINGprefix. Include the draft and token when the host retained them; process-per-turn hosts may omit both because Cladding resolves the exact staged draft from its short-lived machine-local cache. Questions, paraphrases, and generic acknowledgements are not approval. - If
nextQuestionis present, show it verbatim and end the assistant turn immediately. Never answer it, infer an answer, or call either clarify tool during the initialization-approval turn. Continue with the Cladding clarify workflow only after a new user message supplies the answer. If no question remains, report that ordinary development can begin.
Do not run clad init in a shell from an AI-host onboarding session. Do not use MCP sampling. If the MCP tools are absent, tell the user to run clad setup, restart the AI host in the project directory, and stop without writing project files.
clad_prepare_init does not modify the workspace, and clad_stage_init writes only ignored runtime state. Never call stage and apply in the same assistant turn. Only clad_init writes authored artifacts, after explicit user confirmation plus schema and freshness validation. A stale, malformed, or replayed apply request must be prepared again.
The raw CLI remains available for terminal, CI, offline, and explicitly configured SDK automation; it is not the primary host onboarding path.