{"record":{"id":"e4553e3cf770b5e3","repo":"ultraworkers/claw-code","slug":"unable-to-resolve-a-skills-install-root-set-claw","errorCode":null,"errorMessage":"unable to resolve a skills install root; set CLAW_CONFIG_HOME or HOME","messagePattern":"unable to resolve a skills install root; set CLAW_CONFIG_HOME or HOME","errorType":"validation","errorClass":"std::io::Error","httpStatus":null,"severity":"error","filePath":"rust/crates/commands/src/lib.rs","lineNumber":3851,"sourceCode":"        ),\n    )?;\n\n    Ok(CreatedAgent { name, path })\n}\n\nfn default_skill_install_root() -> std::io::Result<PathBuf> {\n    if let Ok(claw_config_home) = env::var(\"CLAW_CONFIG_HOME\") {\n        return Ok(PathBuf::from(claw_config_home).join(\"skills\"));\n    }\n    if let Ok(codex_home) = env::var(\"CODEX_HOME\") {\n        return Ok(PathBuf::from(codex_home).join(\"skills\"));\n    }\n    if let Some(home) = env::var_os(\"HOME\") {\n        return Ok(PathBuf::from(home).join(\".claw\").join(\"skills\"));\n    }\n    Err(std::io::Error::new(\n        std::io::ErrorKind::NotFound,\n        \"unable to resolve a skills install root; set CLAW_CONFIG_HOME or HOME\",\n    ))\n}\n\nfn resolve_skill_install_source(source: &str, cwd: &Path) -> std::io::Result<SkillInstallSource> {\n    let candidate = PathBuf::from(source);\n    let source = if candidate.is_absolute() {\n        candidate\n    } else {\n        cwd.join(candidate)\n    };\n    let source = fs::canonicalize(&source).map_err(|e| {\n        std::io::Error::new(\n            e.kind(),\n            format!(\"skill source '{}' not found: {e}\", source.display()),\n        )\n    })?;\n\n    if source.is_dir() {","sourceCodeStart":3833,"sourceCodeEnd":3869,"githubUrl":"https://github.com/ultraworkers/claw-code/blob/08106b0c3771ef5b4a5aa176acccd460e88b7325/rust/crates/commands/src/lib.rs#L3833-L3869","documentation":"`default_skill_install_root` (commands/src/lib.rs:3851) resolves the install registry by checking `CLAW_CONFIG_HOME`, then `CODEX_HOME`, then `HOME` (falling back to `~/.claw/skills`). If none of the three is set it returns `ErrorKind::NotFound` with this message. It is hit by `install_skill` and `uninstall_skill`, i.e. `/skills install` and `/skills uninstall`.","triggerScenarios":"Running `/skills install <src>` or `/skills uninstall <name>` in a process whose environment has none of CLAW_CONFIG_HOME, CODEX_HOME, or HOME defined.","commonSituations":"Minimal Docker containers without a HOME for the runtime user; systemd/launchd services with a scrubbed environment; CI jobs using `env -i`; test harnesses that clear the environment; `setenv -u HOME` shells.","solutions":["Export CLAW_CONFIG_HOME to a writable dir (it takes priority): `export CLAW_CONFIG_HOME=$HOME/.claw`.","Otherwise export HOME: `export HOME=/root` (root becomes `$HOME/.claw/skills`).","In containers/services, set the variable in the unit file or Dockerfile ENV so the claw process always inherits it."],"exampleFix":"# before\n/skills install ./my-skill   # unable to resolve a skills install root; set CLAW_CONFIG_HOME or HOME\n\n# after\nexport CLAW_CONFIG_HOME=\"$HOME/.claw\"\n/skills install ./my-skill","handlingStrategy":"validation","validationCode":"fn skill_root_ok() -> bool {\n    std::env::var_os(\"CLAW_CONFIG_HOME\").is_some()\n        || std::env::var_os(\"CODEX_HOME\").is_some()\n        || std::env::var_os(\"HOME\").is_some()\n}","typeGuard":null,"tryCatchPattern":"match install_skill(source, cwd) {\n    Err(e) if e.kind() == std::io::ErrorKind::NotFound\n        && e.to_string().contains(\"skills install root\") => {\n        // set CLAW_CONFIG_HOME/HOME and retry once\n    }\n    other => other,\n}","preventionTips":["Always launch claw with CLAW_CONFIG_HOME set to a writable dir","In containers/systemd units add ENV HOME or Environment=CLAW_CONFIG_HOME","Never run claw under `env -i` without re-exporting HOME"],"tags":["skills","install","environment","env-vars"],"backgroundTag":"missing-env-var","analyzedSha":"08106b0c3771ef5b4a5aa176acccd460e88b7325","analyzedAt":"2026-08-18T00:29:38.590Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}