[PR #14] [MERGED] fix: respect tool-specific env vars for session storage paths #18

Closed
opened 2026-03-04 01:39:17 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/yigitkonur/cli-continues/pull/14
Author: @yutakobayashidev
Created: 2/25/2026
Status: Merged
Merged: 2/25/2026
Merged by: @yigitkonur

Base: mainHead: fix/respect-env-var-overrides


📝 Commits (1)

  • 89013c3 fix: respect tool-specific env vars for session storage paths

📊 Changes

4 files changed (+12 additions, -4 deletions)

View changed files

📝 src/parsers/claude.ts (+3 -1)
📝 src/parsers/codex.ts (+3 -1)
📝 src/parsers/gemini.ts (+3 -1)
📝 src/parsers/opencode.ts (+3 -1)

📄 Description

Summary

Parsers now check each tool's official environment variable override before falling back to the default os.homedir()-based paths. Without this, users who customize their config directories via env vars will have their sessions silently missed by continues.

  • Claude Code: check CLAUDE_CONFIG_DIR$CLAUDE_CONFIG_DIR/projects/
  • Codex CLI: check CODEX_HOME$CODEX_HOME/sessions/
  • Gemini CLI: check GEMINI_CLI_HOME$GEMINI_CLI_HOME/.gemini/tmp/
  • OpenCode: check XDG_DATA_HOME$XDG_DATA_HOME/opencode/

The remaining 3 tools (Copilot, Factory Droid, Cursor) have no env var override mechanism, so they are unchanged.

References

Each env var matches the tool's own config resolution:

Tool Env Var Source
Claude Code CLAUDE_CONFIG_DIR docs: Settings — Environment variables
Codex CLI CODEX_HOME codex-rs/utils/home-dir/src/lib.rs#L11-L15find_codex_home() reads CODEX_HOME env var
Gemini CLI GEMINI_CLI_HOME packages/core/src/utils/paths.ts#L20-L26, docs: Configuration
OpenCode XDG_DATA_HOME packages/opencode/src/global/index.ts#L2-L9xdgData from xdg-basedir resolves $XDG_DATA_HOME/opencode

Test plan

  • tsc compiles clean
  • All 278 unit tests pass (vitest run)
  • Manual: set CLAUDE_CONFIG_DIR=/tmp/test-claude and verify continues list --source claude reads from the custom path
  • Manual: set CODEX_HOME=/tmp/test-codex and verify continues list --source codex reads from the custom path

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/yigitkonur/cli-continues/pull/14 **Author:** [@yutakobayashidev](https://github.com/yutakobayashidev) **Created:** 2/25/2026 **Status:** ✅ Merged **Merged:** 2/25/2026 **Merged by:** [@yigitkonur](https://github.com/yigitkonur) **Base:** `main` ← **Head:** `fix/respect-env-var-overrides` --- ### 📝 Commits (1) - [`89013c3`](https://github.com/yigitkonur/cli-continues/commit/89013c3d4d2195a2c7bc1e87f530b126f462e830) fix: respect tool-specific env vars for session storage paths ### 📊 Changes **4 files changed** (+12 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `src/parsers/claude.ts` (+3 -1) 📝 `src/parsers/codex.ts` (+3 -1) 📝 `src/parsers/gemini.ts` (+3 -1) 📝 `src/parsers/opencode.ts` (+3 -1) </details> ### 📄 Description ## Summary Parsers now check each tool's official environment variable override before falling back to the default `os.homedir()`-based paths. Without this, users who customize their config directories via env vars will have their sessions silently missed by `continues`. - **Claude Code**: check `CLAUDE_CONFIG_DIR` → `$CLAUDE_CONFIG_DIR/projects/` - **Codex CLI**: check `CODEX_HOME` → `$CODEX_HOME/sessions/` - **Gemini CLI**: check `GEMINI_CLI_HOME` → `$GEMINI_CLI_HOME/.gemini/tmp/` - **OpenCode**: check `XDG_DATA_HOME` → `$XDG_DATA_HOME/opencode/` The remaining 3 tools (Copilot, Factory Droid, Cursor) have no env var override mechanism, so they are unchanged. ## References Each env var matches the tool's own config resolution: | Tool | Env Var | Source | |------|---------|--------| | Claude Code | `CLAUDE_CONFIG_DIR` | [docs: Settings — Environment variables](https://code.claude.com/docs/en/settings) | | Codex CLI | `CODEX_HOME` | [`codex-rs/utils/home-dir/src/lib.rs#L11-L15`](https://github.com/openai/codex/blob/ddfa032eb8506eeb21b4f00f12f0836f06e8a6b0/codex-rs/utils/home-dir/src/lib.rs#L11-L15) — `find_codex_home()` reads `CODEX_HOME` env var | | Gemini CLI | `GEMINI_CLI_HOME` | [`packages/core/src/utils/paths.ts#L20-L26`](https://github.com/google-gemini/gemini-cli/blob/29e8f2abf41f6db15efb11e94c839b90d09bdb51/packages/core/src/utils/paths.ts#L20-L26), [docs: Configuration](https://github.com/google-gemini/gemini-cli/blob/29e8f2abf41f6db15efb11e94c839b90d09bdb51/docs/reference/configuration.md) | | OpenCode | `XDG_DATA_HOME` | [`packages/opencode/src/global/index.ts#L2-L9`](https://github.com/sst/opencode/blob/dev/packages/opencode/src/global/index.ts#L2-L9) — `xdgData` from `xdg-basedir` resolves `$XDG_DATA_HOME/opencode` | ## Test plan - [x] `tsc` compiles clean - [x] All 278 unit tests pass (`vitest run`) - [ ] Manual: set `CLAUDE_CONFIG_DIR=/tmp/test-claude` and verify `continues list --source claude` reads from the custom path - [ ] Manual: set `CODEX_HOME=/tmp/test-codex` and verify `continues list --source codex` reads from the custom path 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-04 01:39:17 +03:00
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/cli-continues#18
No description provided.