coleam00/Archon · error · Error

Cannot resume: Not in a git repository. Either run from a gi

Error message

Cannot resume: Not in a git repository.
Either run from a git repo or use /clone first.

What it means

Fallback guard in the --resume path: resume requires a resolved codebase, and if there is neither a lookup error (DB reachable) nor a registration error, the only remaining cause is that the cwd is not a git repository / not a recognized project. The CLI refuses to resume because the prior run's project cannot be matched to the current directory, and suggests cloning or running from a git repo.

Source

Thrown at packages/cli/src/commands/workflow.ts:2371

    }
  }

  // Handle --resume: locate the prior failed run, reuse its worktree, and hand
  // the resumed-run handle to executeWorkflow below via opts. The executor no
  // longer performs implicit resume detection on its own.
  let resumable: WorkflowRun | null = null;
  if (options.resume) {
    if (!codebase) {
      if (codebaseLookupError) {
        throw new Error(
          'Cannot resume: Database lookup failed.\n' +
            `Error: ${codebaseLookupError.message}\n` +
            'Hint: Check your database connection before using --resume.'
        );
      }
      if (codebaseRegistrationError) {
        throw buildRegistrationFailureError('resume', codebaseRegistrationError);
      }
      throw new Error(
        'Cannot resume: Not in a git repository.\n' +
          'Either run from a git repo or use /clone first.'
      );
    }

    if (resumeLookupError) {
      throw buildResumeLookupFailureError(resumeLookupError);
    }
    // Resolved before discovery (top of this function), because the graph this run
    // executes had to be chosen from it.
    resumable = continuationRun ?? null;

    if (!resumable) {
      throw buildNoResumableRunError(workflowName, cwd);
    }

    getLog().info(

View on GitHub (pinned to 0773b97458)

Solutions

  1. cd into the actual git repository checkout for the project and retry --resume.
  2. If the checkout is gone, re-clone it (the message suggests /clone) or start a fresh run with --branch.
  3. Initialize git in the directory if it truly should be a repo (git init plus remote setup), then re-register.

Example fix

// before
cd /tmp/scratch && archon workflow run my-flow --resume  # Not in a git repository
// after
cd ~/work/my-project && archon workflow run my-flow --resume
Defensive patterns

Strategy: validation

Validate before calling

import { existsSync } from 'fs';
if (!existsSync(join(process.cwd(), '.git'))) {
  throw new Error(`cwd ${process.cwd()} is not a git repository; cd into the project checkout before --resume.`);
}

Try / catch

try {
  await runWorkflow({ resume: true });
} catch (error) {
  if ((error as Error).message.includes('Not in a git repository')) {
    console.error('cd into the repo checkout (or clone it) and retry --resume.');
  } else throw error;
}

Prevention

When it happens

Trigger: Running `archon workflow run <flow> --resume` from a plain directory with no .git, or from an unregistered non-git folder, so resolveRunCodebase returns no codebase and no error.

Common situations: Opening a terminal in a temp or extracted folder instead of the repo; the .git directory was deleted or the repo was moved; trying to resume a run from a completely different machine directory.

Related errors


AI-assisted analysis of coleam00/Archon@0773b97458 (2026-09-01). Data as JSON: /api/errors/bae9a9d65ced6c73. Report an issue: GitHub.