From 99db56833fc892c3df6ff7edfc87f9ded58970da Mon Sep 17 00:00:00 2001 From: Rushabh Nagda Date: Tue, 13 Oct 2026 14:21:16 -0700 Subject: [PATCH] fix(init): say why trail init couldn't read past sessions When the headless `claude -p` call failed, init printed "couldn't read your past sessions this time; trail init again tries again", with no cause. In practice the cause is a `claude` CLI whose sign-in has expired: it answers, with an auth error. Say so, and name the fix. A missing `claude` command (reason no_claude) used to print nothing; it now says that too. Copy only: what is read, when, and when it retries are unchanged. Co-Authored-By: Claude Opus 5.5 --- src/cli.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/cli.ts b/src/cli.ts index aef22f5c..5ea3283d 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -1674,7 +1674,10 @@ async function runInitCommand( console.error("· Claude follows them from your next session"); if (saved.some((s) => s.scope === "repo")) console.error(commitLines({}, teammatesOn(repo), "repo").uncommitted); } else if (result.reason === "failed") { - console.error(`· couldn't read your past sessions this time; ${cmd("graft init")} again tries again`); + // Almost always a `claude` that isn't signed in: it answers, with an error. + console.error(`· couldn't read your past sessions: Claude Code didn't answer. Check \`claude\` is signed in, then run ${cmd("graft init")} again`); + } else if (result.reason === "no_claude") { + console.error(`· didn't read your past sessions: the \`claude\` command isn't on your PATH. Install Claude Code's CLI, then run ${cmd("graft init")} again`); } } if (TRAIL && !learnedNow) {