{"record":{"id":"d6142fb051e44dfc","repo":"chenhg5/cc-connect","slug":"claudecode-q-cli-not-found-in-path-please-insta","errorCode":null,"errorMessage":"claudecode: %q CLI not found in PATH, please install it first","messagePattern":"claudecode: %q CLI not found in PATH, please install it first","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agent/claudecode/claudecode.go","lineNumber":235,"sourceCode":"\t// the project-level config field by cmd/cc-connect/main.go.\n\tspawnOpts := core.SpawnOptions{}\n\tspawnOpts.RunAsUser, _ = opts[\"run_as_user\"].(string)\n\tif env, ok := opts[\"run_as_env\"].([]any); ok {\n\t\tfor _, v := range env {\n\t\t\tif s, ok := v.(string); ok {\n\t\t\t\tspawnOpts.EnvAllowlist = append(spawnOpts.EnvAllowlist, s)\n\t\t\t}\n\t\t}\n\t} else if env, ok := opts[\"run_as_env\"].([]string); ok {\n\t\tspawnOpts.EnvAllowlist = append(spawnOpts.EnvAllowlist, env...)\n\t}\n\n\t// When run_as_user is set, the target user's PATH is what matters;\n\t// skip the supervisor-side LookPath check and let spawn fail loudly\n\t// at runtime if the target doesn't have claude installed.\n\tif !spawnOpts.IsolationMode() {\n\t\tif _, err := exec.LookPath(cmd); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"claudecode: %q CLI not found in PATH, please install it first\", cmd)\n\t\t}\n\t}\n\n\t// Parse project-level env from opts[\"env\"] (set via [projects.agent.options.env] in config.toml).\n\t// Stored separately from runtime sessionEnv so SetSessionEnv calls cannot overwrite it.\n\tvar configEnv []string\n\tif envMap, ok := opts[\"env\"].(map[string]string); ok {\n\t\tfor k, v := range envMap {\n\t\t\tconfigEnv = append(configEnv, k+\"=\"+v)\n\t\t}\n\t} else if envMap, ok := opts[\"env\"].(map[string]any); ok {\n\t\tfor k, v := range envMap {\n\t\t\tif s, ok := v.(string); ok {\n\t\t\t\tconfigEnv = append(configEnv, k+\"=\"+s)\n\t\t\t}\n\t\t}\n\t}\n","sourceCodeStart":217,"sourceCodeEnd":253,"githubUrl":"https://github.com/chenhg5/cc-connect/blob/4000b2338aa6e850c99df54f8b0ed6ed7460b401/agent/claudecode/claudecode.go#L217-L253","documentation":"Pre-flight validation in the claudecode agent factory: exec.LookPath cannot find the configured claude binary in the supervisor's PATH. The %q is the command name looked up. Skipped when run_as_user is set, since the target user's PATH is what matters there.","triggerScenarios":"Thrown at agent/claudecode/claudecode.go:235 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Install the Claude Code CLI (npm i -g @anthropic-ai/claude-code)","Put the binary's directory on the daemon's PATH","Or set the agent cmd option to the binary's absolute path"],"exampleFix":null,"handlingStrategy":"validation","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"}