Skip to content

fix(init): keep cursor setup out of claude config - #3290

Closed
ousamabenyounes wants to merge 1 commit into
rtk-ai:developfrom
ousamabenyounes:fix/init-cursor-instructions-dir
Closed

ousamabenyounes wants to merge 1 commit into
rtk-ai:developfrom
ousamabenyounes:fix/init-cursor-instructions-dir

Conversation

@ousamabenyounes

Copy link
Copy Markdown
Contributor

Summary

  • Treat Cursor init as a Cursor-only setup path instead of running Claude setup first.
  • Ensure the Cursor config directory exists before atomically writing hooks.json.

Test verification (RED -> GREEN)

RED on upstream-base behavior with the new regression test:

called `Result::unwrap()` on an `Err` value: Failed to write RTK.md: /tmp/.tmpGNCwuf/.claude/RTK.md
Caused by:
    0: Failed to create temp file in /tmp/.tmpGNCwuf/.claude
    1: No such file or directory (os error 2)
test hooks::init::tests::test_cursor_global_init_does_not_require_claude_dir ... FAILED

GREEN after the fix:

Cursor hook registered (global).
hooks.json: RTK preToolUse entry added
test hooks::init::tests::test_cursor_global_init_does_not_require_claude_dir ... ok

Full local CI replay:

cargo fmt --all -- --check
cargo clippy --all-targets -- -D warnings
cargo test --all
test result: ok. 2512 passed; 0 failed; 8 ignored; 0 measured; 0 filtered out

Test plan

  • cargo fmt --all -- --check
  • cargo clippy --all-targets -- -D warnings
  • cargo test --all
  • Manual testing: rtk init --global --agent cursor behavior covered by regression test

Fixes #3282

Important: All PRs must target the develop branch (not master).

@ousamabenyounes
ousamabenyounes force-pushed the fix/init-cursor-instructions-dir branch 5 times, most recently from 7ebb34e to ca12644 Compare August 3, 2026 19:25
@ousamabenyounes
ousamabenyounes force-pushed the fix/init-cursor-instructions-dir branch from ca12644 to 8cc2be7 Compare August 15, 2026 22:46
@KuSh

KuSh commented Sep 25, 2026

Copy link
Copy Markdown
Collaborator

Thanks for this. #3000 makes the same two changes: --agent cursor stops running the Claude setup, and ~/.cursor is created before hooks.json is written. Merging either one makes the other redundant. I am closing this one in favour of #3000, which was opened two weeks earlier and tests the change through the real binary, including a real install in an empty home.

If you see a case that #3000 misses, a comment there is welcome, or reply here if your scope differs.

@KuSh KuSh closed this Sep 25, 2026
@ousamabenyounes

Copy link
Copy Markdown
Contributor Author

Confirmed — #3000 is a strict superset: it gates the Claude install for Cursor/Windsurf/Cline (mine only handled Cursor) and creates ~/.cursor before writing hooks.json. I verified both changes are on develop (src/main.rs install_claude gate, src/hooks/init/cursor.rs create_dir_all). No remaining delta from my side, so closing in favour of #3000 is the right call. Thanks for the review.

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 want to install in .claude when using another agent

2 participants