plandex-ai/plandex · error
error getting project paths: %v
Error message
error getting project paths: %v
What it means
Build wraps any error returned by fs.GetProjectPaths when resolving the base directory for the current contexts. It means the CLI could not determine where project files (contexts, plan files) live, so it cannot proceed to check outdated contexts or build. The underlying cause (path resolution or stat failure) is embedded in the message.
Source
Thrown at app/cli/plan_exec/build.go:37
term.StartSpinner("")
err := PromptSyncModelsIfNeeded()
if err != nil {
term.OutputErrorAndExit("Error syncing models: %v", err)
}
term.StartSpinner("")
contexts, apiErr := api.Client.ListContext(params.CurrentPlanId, params.CurrentBranch)
if apiErr != nil {
term.OutputErrorAndExit("Error getting context: %v", apiErr)
}
paths, err := fs.GetProjectPaths(fs.GetBaseDirForContexts(contexts))
if err != nil {
return false, fmt.Errorf("error getting project paths: %v", err)
}
anyOutdated, didUpdate, err := params.CheckOutdatedContext(contexts, paths)
if err != nil {
term.OutputErrorAndExit("error checking outdated context: %v", err)
}
if anyOutdated && !didUpdate {
term.StopSpinner()
log.Println("Build canceled")
return false, nil
}
apiErr = api.Client.BuildPlan(params.CurrentPlanId, params.CurrentBranch, shared.BuildPlanRequest{
ConnectStream: !buildBg,
ProjectPaths: paths.ActivePaths,
AuthVars: params.AuthVars,View on GitHub (pinned to e2d772072e)
Solutions
- Verify the current working directory exists and is readable (pwd, ls)
- Re-create the project base directory or re-init the project
- Check permissions on the project directory
- Reopen the session from the correct project root
Example fix
// before
paths, err := fs.GetProjectPaths(fs.GetBaseDirForContexts(contexts))
// after
baseDir := fs.GetBaseDirForContexts(contexts)
if _, err := os.Stat(baseDir); os.IsNotExist(err) {
os.MkdirAll(baseDir, 0755)
}
paths, err := fs.GetProjectPaths(baseDir) Defensive patterns
Strategy: validation
Validate before calling
baseDir := fs.GetBaseDirForContexts(contexts)
if _, err := os.Stat(baseDir); err != nil {
// recreate or abort before calling Build
os.MkdirAll(baseDir, 0755)
} Type guard
func projectPathsOk(baseDir string) bool {
info, err := os.Stat(baseDir)
return err == nil && info.IsDir()
} Try / catch
_, err := Build(params)
if err != nil && strings.HasPrefix(err.Error(), "error getting project paths") {
// recover: reinit project dirs or cd back to project root
return fmt.Errorf("project directory missing: %w", err)
} Prevention
- Don't rename/delete the project root while a session is open
- Re-open plandex from the project root after moving the repo
- Keep $HOME and project dirs writable
- Re-init the project if base dir metadata is stale
When it happens
Trigger: Calling Build when fs.GetProjectPaths(fs.GetBaseDirForContexts(contexts)) returns an error — typically the base directory does not exist, cannot be created, or a path component cannot be resolved for the given contexts.
Common situations: Running plandex from a directory that was deleted or renamed after session start; context referencing a project root that was moved; permission problems in $HOME or project dir.
Related errors
- error checking if %s is a subpath of %s: %s
- path %s is not in the project
- error loading accounts: %v
- error setting auth: %v
- error writing auth: %v
AI-assisted analysis of plandex-ai/plandex@e2d772072e (2026-09-05).
Data as JSON: /api/errors/6afe812e03499f2e.
Report an issue: GitHub.