{"record":{"id":"5e983ee3ef4518fc","repo":"plandex-ai/plandex","slug":"failed-to-parse-input-paths-v","errorCode":null,"errorMessage":"failed to parse input paths: %v","messagePattern":"failed to parse input paths: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"app/cli/lib/context_load.go","lineNumber":255,"sourceCode":"\t\t\t\t\tcomposite := strings.Join([]string{string(shared.ContextDirectoryTreeType), inputFilePath}, \"|\")\n\t\t\t\t\tif existsByComposite[composite] != nil {\n\t\t\t\t\t\talreadyLoadedByComposite[composite] = existsByComposite[composite]\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\n\t\t\t\t\tnumRoutines++\n\t\t\t\t\tgo func(inputFilePath string) {\n\t\t\t\t\t\tsem <- struct{}{}\n\t\t\t\t\t\tdefer func() { <-sem }()\n\n\t\t\t\t\t\tflattenedPaths, err := ParseInputPaths(ParseInputPathsParams{\n\t\t\t\t\t\t\tFileOrDirPaths: []string{inputFilePath},\n\t\t\t\t\t\t\tBaseDir:        baseDir,\n\t\t\t\t\t\t\tProjectPaths:   paths,\n\t\t\t\t\t\t\tLoadParams:     params,\n\t\t\t\t\t\t})\n\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\terrCh <- fmt.Errorf(\"failed to parse input paths: %v\", err)\n\t\t\t\t\t\t\treturn\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif !params.ForceSkipIgnore {\n\t\t\t\t\t\t\tvar filteredPaths []string\n\t\t\t\t\t\t\tfor _, path := range flattenedPaths {\n\t\t\t\t\t\t\t\tif _, ok := paths.ActivePaths[path]; ok {\n\t\t\t\t\t\t\t\t\tfilteredPaths = append(filteredPaths, path)\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tignored, reason, err := fs.IsIgnored(paths, path, baseDir)\n\t\t\t\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\t\t\t\terrCh <- fmt.Errorf(\"failed to check if %s is ignored: %v\", path, err)\n\t\t\t\t\t\t\t\t\t\treturn\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif ignored {\n\t\t\t\t\t\t\t\t\t\tignoredPaths[path] = reason\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}","sourceCodeStart":237,"sourceCodeEnd":273,"githubUrl":"https://github.com/plandex-ai/plandex/blob/e2d772072efadbe41d2946d97d79be55532dbab5/app/cli/lib/context_load.go#L237-L273","documentation":"This error is produced in a goroutine of MustLoadContext (NamesOnly/directory-tree branch) when ParseInputPaths fails while expanding an input file or directory path into concrete project paths. ParseInputPaths returns errors when fs.IsSubpathOf fails while matching project paths against the input, or when a directory input is encountered without --recursive/-r, --tree, or --map. The CLI wraps the underlying cause with 'failed to parse input paths: %v' and sends it on errCh.","triggerScenarios":"Running context load with --tree (NamesOnly) where (1) an input path is a directory and no recursive/tree/map flag allowed it (ParseInputPaths returns 'cannot process directory %s: requires --recursive/-r, --tree, or --map flag'), or (2) fs.IsSubpathOf errors while checking whether a project path falls under the input path.","commonSituations":"Typing 'plandex load src' without -r/--tree/--map and expecting directory loading; passing a directory in an alias/script that previously used a file; broken or symlinked paths causing IsSubpathOf resolution failures.","solutions":["Re-run with a directory-expansion flag: --recursive/-r for full loads or --tree for the NamesOnly path that hit this error.","Load individual files instead of directories if recursion was not intended.","Verify the input path exists and resolves correctly from the project root (no broken symlinks, correct relative path).","Check the wrapped message after the prefix; if it mentions 'subpath of', inspect the project dir structure and baseDir for anomalies (e.g. path outside the repo)."],"exampleFix":"// before\nplandex load ./src\n// error: failed to parse input paths: cannot process directory ./src: requires --recursive/-r, --tree, or --map flag\n// after\nplandex load ./src --recursive   # or: plandex load ./src --tree","handlingStrategy":"validation","validationCode":"info, err := os.Stat(inputPath)\nif err != nil {\n    return fmt.Errorf(\"input path %s is not accessible: %w\", inputPath, err)\n}\nif info.IsDir() && !loadParams.Recursive && !loadParams.NamesOnly && !loadParams.DefsOnly {\n    return fmt.Errorf(\"%s is a directory; pass --recursive/-r, --tree, or --map\", inputPath)\n}","typeGuard":"func isDirWithoutExpansionFlag(path string, params *types.LoadContextParams) bool {\n    info, err := os.Stat(path)\n    return err == nil && info.IsDir() && !params.Recursive && !params.NamesOnly && !params.DefsOnly\n}","tryCatchPattern":null,"preventionTips":["Always pass an expansion flag (-r, --tree, or --map) when the input may be a directory.","Validate that input paths exist and resolve within the project root before calling load.","Read the wrapped cause after 'failed to parse input paths:' — it names the offending path and rule."],"tags":["go","cli","path-parsing","context-load"],"backgroundTag":"directory-input-requires-recursive-flag","analyzedSha":"e2d772072efadbe41d2946d97d79be55532dbab5","analyzedAt":"2026-09-05T20:56:53.631Z","contentChangedAt":"2026-09-05T20:56:53.631Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}