Files:
packages/agentctx/src/cli/sync.ts:69-72 — declined confirmation returns 0
packages/agentctx/src/cli/reset.ts:53-56 — declined confirmation returns 1
packages/agentctx/src/cli/profile-cmd.ts:163-166 — declined confirmation returns 1
Problem (one line): Three commands prompt for confirmation before acting; when the user answers "no", sync exits 0 while reset and profile clear exit 1, so the same "user aborted" outcome produces different exit codes.
Details
agentctx sync (after the user declines):
if (!confirmed) {
env.io.err("aborted: CLAUDE.md unchanged");
return 0;
}
agentctx reset:
if (!confirmed) {
env.io.err("aborted: project context kept (pass --force to skip the prompt)");
return 1;
}
agentctx profile clear:
if (!confirmed) {
env.io.err("aborted: preference kept (pass --force to skip the prompt)");
return 1;
}
All three write the "aborted" notice to stderr, but sync returns 0 where the other two return 1. Scripts that branch on the exit code (e.g. wrapping these in automation) get inconsistent signals for an identical user action. reset + profile clear form the established convention (declined = exit 1); sync is the outlier.
What "done" looks like
Pick one convention and align all three. The straightforward fix is to make sync return 1 on decline, matching reset and profile clear. (If exit 0 on decline is intended for sync, document why it differs and leave a comment — but the three should agree or the difference should be deliberate and explained.)
Scope
A one-line change plus a test asserting the chosen exit code. No architectural impact. Good for a first-time contributor; under an hour.
Files:
packages/agentctx/src/cli/sync.ts:69-72— declined confirmation returns 0packages/agentctx/src/cli/reset.ts:53-56— declined confirmation returns 1packages/agentctx/src/cli/profile-cmd.ts:163-166— declined confirmation returns 1Problem (one line): Three commands prompt for confirmation before acting; when the user answers "no",
syncexits0whileresetandprofile clearexit1, so the same "user aborted" outcome produces different exit codes.Details
agentctx sync(after the user declines):agentctx reset:agentctx profile clear:All three write the "aborted" notice to stderr, but
syncreturns0where the other two return1. Scripts that branch on the exit code (e.g. wrapping these in automation) get inconsistent signals for an identical user action.reset+profile clearform the established convention (declined = exit 1);syncis the outlier.What "done" looks like
Pick one convention and align all three. The straightforward fix is to make
syncreturn1on decline, matchingresetandprofile clear. (If exit0on decline is intended forsync, document why it differs and leave a comment — but the three should agree or the difference should be deliberate and explained.)Scope
A one-line change plus a test asserting the chosen exit code. No architectural impact. Good for a first-time contributor; under an hour.