Skip to content

fix(init): respect CLAUDE_CONFIG_DIR for global paths - #674

Closed
TechWizard9999 wants to merge 2 commits into
rtk-ai:developfrom
TechWizard9999:fix/init-respect-claude-config-dir
Closed

TechWizard9999 wants to merge 2 commits into
rtk-ai:developfrom
TechWizard9999:fix/init-respect-claude-config-dir

Conversation

@TechWizard9999

Copy link
Copy Markdown
Contributor

Description

rtk init -g ignored CLAUDE_CONFIG_DIR and always targeted ~/.claude. This PR makes global Claude path resolution env-aware so installs/patches land in the intended config directory.

Related Issue

Closes #633

Changes Made

  • updated Claude config resolver to honor CLAUDE_CONFIG_DIR when set
  • added explicit validation for empty CLAUDE_CONFIG_DIR
  • updated manual patch instructions to print the resolved settings.json path instead of always showing ~/.claude/settings.json
  • added unit tests for env override, home fallback, and empty override rejection
  • added changelog entry under Unreleased bug fixes

Files Changed

Testing

  • cargo fmt --all --check
  • rtk cargo clippy --all-targets (2 pre-existing warnings in untouched files)
  • rtk cargo test
  • rtk cargo test init::tests::test_resolve_claude_dir_

Checklist

  • Code follows project style guidelines
  • Self-review completed
  • Documentation updated
  • No breaking changes introduced

cc @pszymkowiak for review

@CLAassistant

CLAassistant commented Mar 20, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@TechWizard9999

Copy link
Copy Markdown
Contributor Author

@pszymkowiak could you please review this and let me know if anything needs to change?

@aeppling

Copy link
Copy Markdown
Contributor

Hey

We are cleaning up the codebase and improving the project structure for better onboarding. As part of this effort, PR #826 reorganizes src/ from a flat layout into subfolders.

No logic changes — only file moves and import path updates.

What you need to do

Rebase your branch on develop when receiving this comment:

git fetch origin && git rebase origin/develop

Git detects renames automatically. If you get import conflicts, update the paths:

use crate::git;        // now: use crate::cmds::git::git;
use crate::tracking;   // now: use crate::core::tracking;
use crate::config;     // now: use crate::core::config;
use crate::init;       // now: use crate::hooks::init;
use crate::gain;       // now: use crate::analytics::gain;

Need help rebasing? Tag @aeppling

@TechWizard9999
TechWizard9999 force-pushed the fix/init-respect-claude-config-dir branch from 96e2620 to 5130f11 Compare March 27, 2026 01:48
@TechWizard9999

Copy link
Copy Markdown
Contributor Author

Rebased on latest develop per the refactor notice and force-updated this branch.

@pszymkowiak could you please re-review when convenient?

@TechWizard9999
TechWizard9999 force-pushed the fix/init-respect-claude-config-dir branch from 5130f11 to 716639f Compare March 30, 2026 03:19
@ChrisGVE

Copy link
Copy Markdown
Contributor

Thanks for this work, this is a key feature to me

@TechWizard9999
TechWizard9999 force-pushed the fix/init-respect-claude-config-dir branch from 716639f to bc23ed5 Compare April 15, 2026 14:09
@TechWizard9999

Copy link
Copy Markdown
Contributor Author

Thanks for the feedback. I have now rebased this PR on the latest develop and force-pushed a fresh update with conflict resolution retained for .\n\n@pszymkowiak @FlorianBruniaux could you please re-review when convenient?

@TechWizard9999

Copy link
Copy Markdown
Contributor Author

Correction: the rebased update keeps the CLAUDE_CONFIG_DIR behavior in init path resolution.\n\nPlease re-review when convenient. Thanks.

@TechWizard9999

Copy link
Copy Markdown
Contributor Author

Quick maintainer ping after latest rebase update. @pszymkowiak @FlorianBruniaux please re-review when convenient.

@amenophis

Copy link
Copy Markdown

Any news on this ?

@ChrisGVE

Copy link
Copy Markdown
Contributor

Why is there no traction for this simple change? It's been on the table for long and it is a key feature for many of us.

ChrisGVE added a commit to ChrisGVE/rtk that referenced this pull request Jun 3, 2026
Add Co-authored-by trailer for Roopesh, original author of the
superseded PR rtk-ai#674 that first addressed CLAUDE_CONFIG_DIR handling
in rtk init.

Co-authored-by: Roopesh <[email protected]>
@KuSh

KuSh commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

Hi, thanks for your PR. This has been superseded by #2087, and you’ve been properly credited there

@KuSh KuSh closed this Jun 30, 2026
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.

rtk init -g does not respect CLAUDE_CONFIG_DIR

6 participants