parsemend fix
parsemend fix postlyra-12One command that runs the whole pipeline in your working copy: fetch the context bundle, work out the root cause, turn that into a plan, then write the code. Every step runs locally against models you pay for directly.
This is the path for when there is no agent session to drive — a scripted run, a terminal with nothing else open, a machine where you want one command rather than a conversation. If you already work in Claude Code or Codex, the MCP server is the better trade: your session's model, your session's tools, and no provider key of your own.
Naming the issue
fix takes what parsemend issues prints, a numeric id, or a full issue URL:
parsemend fix postlyra-12
parsemend fix 4127
parsemend fix https://app.parsemend.com/issues/4127Anything else is refused before the request goes out, so a typo costs nothing.
The steps
| Step | What it produces |
|---|---|
root_cause | A reproduction timeline: how the failure actually happens, walked through the real checkout. |
plan | A solution plan built from that timeline. Opens in $EDITOR for review unless you pass --no-edit. |
coding | The change set, written into your working copy. |
Stop early with --stop-at root_cause, --stop-at plan, or --stop-at coding.
Run state is written to .parsemend/run-<id>.json after every step, so a run interrupted at the plan resumes from the plan rather than starting over. Add .parsemend/ to .gitignore. If the agent has already produced output for this issue in the cloud, a fresh run offers to reuse it instead of re-deriving it.
Your working copy is the workspace
There is no isolated per-run directory to throw away. fix edits the files you have open, which makes git diff and git checkout -- . your undo button — and only works if the tree was clean to begin with. The coding step refuses to write into a dirty tree without --force.
--dry-run shows the proposed change set without writing anything. It applies to the default executor only.
Models and keys
Four roles, each resolved from a flag, then a PARSEMEND_MODEL_<ROLE> environment variable, then a built-in default:
| Role | Flag | Default |
|---|---|---|
explore | --model-explore | anthropic:claude-haiku-4-5 |
conclude | --model-conclude | anthropic:claude-sonnet-5 |
code | --model-code | anthropic:claude-sonnet-5 |
format | — | anthropic:claude-haiku-4-5 |
--model <spec> sets every role at once. A spec is always provider:model; a bare model name is an error rather than a guess. Supported providers are anthropic, openai, google, and ollama (served through its OpenAI-compatible endpoint on localhost:11434).
Keys come from the standard environment variable for the provider — ANTHROPIC_API_KEY, OPENAI_API_KEY, GOOGLE_GENERATIVE_AI_API_KEY. The CLI will also read a providerApiKeys map out of ~/.parsemend/config.json if you put one there, but no command writes that map for you, so the environment variable is the path that exists today.
Handing the coding step to Claude Code
parsemend fix postlyra-12 --executor claude_code --model-code anthropic:claude-opus-5Instead of the built-in tool loop, this shells out to your local claude binary (or CLAUDE_CODE_BINARY) with --permission-mode acceptEdits — it applies its own edits without asking. The anthropic: prefix is dropped on the way through, since claude --model takes claude-opus-5 or opus. Naming any other provider is an error rather than a silent fallback. Left unset, Claude Code keeps whatever model you configured for it.
Publishing
Nothing is sent to Parsemend unless you ask:
parsemend fix postlyra-12 --post-backOr, after the fact, for a run that already happened in this directory:
parsemend post-back postlyra-12The run appears on the issue under AI Agent → Fix runs. As with the MCP server, the diff is read from the working tree — publish before you commit.
The CLI never opens a pull request. That is the agent's job, and only the agent does it.
All flags
| Flag | Effect |
|---|---|
--executor <name> | tool_loop (default) or claude_code. |
--model <spec> | Every role, unless a per-role flag overrides it. |
--model-explore, --model-conclude, --model-code | Per-role override. |
--stop-at <step> | root_cause, plan, or coding. |
--dry-run | Show the change set without writing files. Default executor only. |
--force | Proceed into coding with a dirty working tree. |
--no-edit | Skip the $EDITOR plan review. |
-y, --yes | Skip all confirmations. |
--post-back | Publish the run when it finishes. |
The catch
The coding step cannot ask you anything. It runs as a one-shot subprocess against a plan that was fixed the moment it started, so a plan that is subtly wrong is carried out anyway, and you find out by reading the diff. --stop-at plan and the $EDITOR review are the two places to catch it — and the MCP server exists precisely because a session you can interrupt is a better place to fix a hard bug than a pipeline you cannot.
