{"record":{"id":"86268d4ab583b5e4","repo":"plandex-ai/plandex","slug":"no-context-found-with-name-s","errorCode":null,"errorMessage":"no context found with name: %s","messagePattern":"no context found with name: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"app/cli/cmd/context_show.go","lineNumber":56,"sourceCode":"\t\tif idx, err := strconv.Atoi(nameOrIndex); err == nil {\n\t\t\t// Convert to 0-based index\n\t\t\tidx--\n\t\t\tif idx < 0 || idx >= len(contexts) {\n\t\t\t\treturn fmt.Errorf(\"invalid context index: %s\", nameOrIndex)\n\t\t\t}\n\t\t\tcontextId = contexts[idx].Id\n\t\t} else {\n\t\t\t// Try finding by name\n\t\t\tfound := false\n\t\t\tfor _, ctx := range contexts {\n\t\t\t\tif ctx.Name == nameOrIndex || ctx.FilePath == nameOrIndex {\n\t\t\t\t\tcontextId = ctx.Id\n\t\t\t\t\tfound = true\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tif !found {\n\t\t\t\treturn fmt.Errorf(\"no context found with name: %s\", nameOrIndex)\n\t\t\t}\n\t\t}\n\n\t\tres, apiErr := api.Client.GetContextBody(lib.CurrentPlanId, lib.CurrentBranch, contextId)\n\t\tif apiErr != nil {\n\t\t\tlog.Printf(\"Error getting context body: %v\\n\", apiErr)\n\t\t\treturn fmt.Errorf(\"error getting context body: %v\", apiErr)\n\t\t}\n\n\t\tfmt.Println(res.Body)\n\t\treturn nil\n\t},\n}\n","sourceCodeStart":38,"sourceCodeEnd":70,"githubUrl":"https://github.com/plandex-ai/plandex/blob/e2d772072efadbe41d2946d97d79be55532dbab5/app/cli/cmd/context_show.go#L38-L70","documentation":"For non-numeric arguments, `plandex contexts show` scans the listed contexts comparing each ctx.Name and ctx.FilePath to the argument. If no context matches, it returns 'no context found with name: %s'. The lookup is exact-match against the contexts of the current plan and branch, so case differences, partial names, or contexts on other branches will not match.","triggerScenarios":"Running `plandex contexts show <name>` where the argument does not exactly equal any context's Name or FilePath in the current plan/branch — e.g. typo, wrong case, a path missing its './' prefix, or a context that only exists on another branch.","commonSituations":"Referencing a context by a shorthand name that was never set; the context was unloaded (`plandex unstage`/`rm`) before showing it; quoting/whitespace issues in shell; running from a different plan directory than intended.","solutions":["Run `plandex contexts` to list exact names and file paths, then retry with an exactly matching name or path.","Copy the FilePath exactly as shown (including './' prefix) — matching is exact, not fuzzy or case-insensitive.","Check whether the context lives on another branch or plan and switch (`plandex checkout <branch>`) first.","Re-load the context with `plandex load <file>` if it was removed."],"exampleFix":"// before\nplandex contexts show README.md   // fails if context path is './README.md'\n// after\nplandex contexts                  # shows './README.md' as the exact path\nplandex contexts show ./README.md","handlingStrategy":"validation","validationCode":"# verify the exact name/path exists before showing\nplandex contexts | grep -Fx './README.md' >/dev/null && plandex contexts show ./README.md","typeGuard":"func findContext(contexts []shared.Context, nameOrPath string) *shared.Context {\n    for i := range contexts {\n        if contexts[i].Name == nameOrPath || contexts[i].FilePath == nameOrPath {\n            return &contexts[i]\n        }\n    }\n    return nil\n}","tryCatchPattern":"ctx := findContext(contexts, arg)\nif ctx == nil {\n    names := make([]string, len(contexts))\n    for i, c := range contexts { names[i] = c.Name }\n    return fmt.Errorf(\"%q not found; available: %v\", arg, names)\n}","preventionTips":["Copy context names/paths exactly from `plandex contexts` output — matching is exact and case-sensitive","Include the './' prefix when the listing shows file paths that way","Don't rely on context names across branches; list per branch before referencing","Check that the context hasn't been unloaded/removed before scripted access"],"tags":["cli","validation","not-found","go"],"backgroundTag":"entity-not-found","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"}