{"record":{"id":"db3d729fd6357489","repo":"chenhg5/cc-connect","slug":"claudecode-read-project-dir-w","errorCode":null,"errorMessage":"claudecode: read project dir: %w","messagePattern":"claudecode: read project dir: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agent/claudecode/claudecode.go","lineNumber":583,"sourceCode":"\ta.mu.RLock()\n\tworkDir := a.workDir\n\ta.mu.RUnlock()\n\tabsWorkDir, err := filepath.Abs(workDir)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"claudecode: resolve work_dir: %w\", err)\n\t}\n\n\tprojectDir := findProjectDir(homeDir, absWorkDir)\n\tif projectDir == \"\" {\n\t\treturn nil, nil\n\t}\n\n\tentries, err := os.ReadDir(projectDir)\n\tif err != nil {\n\t\tif os.IsNotExist(err) {\n\t\t\treturn nil, nil\n\t\t}\n\t\treturn nil, fmt.Errorf(\"claudecode: read project dir: %w\", err)\n\t}\n\n\tvar sessions []core.AgentSessionInfo\n\tfor _, entry := range entries {\n\t\tname := entry.Name()\n\t\tif entry.IsDir() || !strings.HasSuffix(name, \".jsonl\") {\n\t\t\tcontinue\n\t\t}\n\n\t\tsessionID := strings.TrimSuffix(name, \".jsonl\")\n\t\tinfo, err := entry.Info()\n\t\tif err != nil {\n\t\t\tcontinue\n\t\t}\n\n\t\tsummary, msgCount := scanSessionMeta(filepath.Join(projectDir, name))\n\n\t\tsessions = append(sessions, core.AgentSessionInfo{","sourceCodeStart":565,"sourceCodeEnd":601,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/agent/claudecode/claudecode.go#L565-L601","documentation":"Wraps a failed os.ReadDir of the discovered ~/.claude/projects/<project> directory during session listing. Not-exist is treated as 'no sessions'; this error fires only on other IO failures such as permission problems on the project storage directory.","triggerScenarios":"Thrown at agent/claudecode/claudecode.go:583 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix read permissions on the ~/.claude/projects directory","Confirm the path is a readable directory and not a broken symlink","Retry /sessions after repair"],"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"}