{"record":{"id":"fa0f3342fa90c7ca","repo":"chenhg5/cc-connect","slug":"cursor-cannot-determine-home-dir-w","errorCode":null,"errorMessage":"cursor: cannot determine home dir: %w","messagePattern":"cursor: cannot determine home dir: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agent/cursor/cursor.go","lineNumber":223,"sourceCode":"\t\t}\n\t}\n\ta.mu.RUnlock()\n\n\treturn newCursorSession(ctx, cmd, extraArgs, workDir, model, mode, sessionID, extraEnv)\n}\n\n// ListSessions reads sessions from Cursor Agent CLI chat storage.\n// The CLI may store chats under ~/.cursor/chats or ~/.config/Cursor/chats\n// depending on XDG_CONFIG_HOME and platform; all known locations are scanned.\nfunc (a *Agent) ListSessions(_ context.Context) ([]core.AgentSessionInfo, error) {\n\tworkDir := a.GetWorkDir()\n\treturn listCursorSessions(workDir)\n}\n\nfunc (a *Agent) DeleteSession(_ context.Context, sessionID string) error {\n\thomeDir, err := os.UserHomeDir()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"cursor: cannot determine home dir: %w\", err)\n\t}\n\tworkDir := a.GetWorkDir()\n\tdir, err := findCursorSessionDir(homeDir, workDir, sessionID)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn os.RemoveAll(dir)\n}\n\nfunc (a *Agent) Stop() error { return nil }\n\n// ── SkillProvider implementation ──────────────────────────────\n\nfunc (a *Agent) SkillDirs() []string {\n\tworkDir := a.GetWorkDir()\n\tabsDir, err := filepath.Abs(workDir)\n\tif err != nil {\n\t\tabsDir = workDir","sourceCodeStart":205,"sourceCodeEnd":241,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/agent/cursor/cursor.go#L205-L241","documentation":"Wraps a failed os.UserHomeDir() inside cursor Agent.DeleteSession. Cursor chat storage lives under the home directory (~/.cursor/chats or ~/.config/Cursor/chats); without a home the path cannot be built and deletion aborts.","triggerScenarios":"Thrown at agent/cursor/cursor.go:223 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set HOME for the cc-connect process","Confirm the daemon user has a valid home directory","Retry /delete after fixing the environment"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4000b2338aa6e850c99df54f8b0ed6ed7460b401","analyzedAt":"2026-09-06T11:45:09.575Z","contentChangedAt":"2026-09-06T11:45:09.575Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}