Skip to content

fix: treat an empty CLAUDE_CONFIG_DIR or CODEX_HOME as unset - #48

Merged
VikramLex merged 1 commit into
Graphicle-AI:mainfrom
leninworld:fix-empty-claude-codex-home
Nov 27, 2026
Merged

VikramLex merged 1 commit into
Graphicle-AI:mainfrom
leninworld:fix-empty-claude-codex-home

Conversation

@leninworld

Copy link
Copy Markdown
Contributor

Summary

  • An empty CLAUDE_CONFIG_DIR or CODEX_HOME was used as a folder instead of being treated as unset in two places:
    • capture::default_root: with CLAUDE_CONFIG_DIR= (or CODEX_HOME=), graphicle sessions import --client claude-code (or --client codex) without --path looked in the relative folder projects (or sessions) and failed with graphicle: Transcript path not found, instead of reading ~/.claude/projects (or ~/.codex/sessions).
    • agent_setup::hook_file: with CODEX_HOME=, setup --clients codex and connect codex --hooks wrote Codex's hooks file to the relative hooks.json in the current folder, while the same command put config.toml in ~/.codex (that path comes from agent_detect::Environment::current, which already ignores empty values).
  • The program already treats these two variables as unset when empty in agent_detect::Environment::current and terminal::codex_home; the three remaining reads now use the same filter. A non-empty value is still used as given.

crates/graphicle-graph/src/install.rs also reads CLAUDE_CONFIG_DIR without the filter; I left it alone because it is part of the Graphify port.

Test plan

  • capture::sessions_cli_empty_client_home_uses_the_default_folder runs sessions import for claude-code and codex from an empty folder, with a fixture home and the variable set to "". On main it fails with graphicle: Transcript path not found; with this change each client imports its one transcript from the default folder. Removing only the CODEX_HOME filter makes the codex case fail too.
  • easy_review::setup_codex_empty_home_writes_hooks_under_the_default_home runs setup --yes --clients codex with CODEX_HOME="". On main, ~/.codex/hooks.json is not written; with this change it holds Graphicle's Stop hook and no hooks.json lands in the repository folder.
  • cargo fmt --check, cargo clippy --locked --all-targets -- -D warnings, cargo clippy --locked --all-targets --features local-inference -- -D warnings and cargo test --locked --all-targets in crates/graphicle (Rust 1.95.0, macOS). Linux and Windows run in CI.
  • cargo deny check bans licenses sources in crates/graphicle (as in CI): ok. The full cargo deny check also reports the advisory RUSTSEC-2026-0543 (chrono unmaintained) from the Cargo.lock on main; this change does not touch Cargo.toml or Cargo.lock.

sessions import (without --path) looked in the relative folder projects or sessions, and setup/connect wrote Codex's hooks.json into the current folder, when the variable was set but empty. agent_detect and terminal::codex_home already ignore empty values; the session-import roots and the Codex hooks file now do the same.

Signed-off-by: Lenin Mookiah <2639584+leninworld@users.noreply.github.com>
@VikramLex
VikramLex merged commit 856d69b into Graphicle-AI:main Nov 27, 2026
14 checks passed
@VikramLex

Copy link
Copy Markdown
Member

Merged, thank you. An empty CLAUDE_CONFIG_DIR or CODEX_HOME now counts as unset in sessions import and in the Codex hooks file, as it already did elsewhere, and both tests are in. Leaving graphicle-graph/src/install.rs to the engine port was the right call; we will pick it up there. This will ship in the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants