Skip to content

feat(search): ignore Claude worktrees - #3089

Closed
lntutor wants to merge 2 commits into
rtk-ai:developfrom
lntutor:feat/2147-ignore-claude-worktrees
Closed

lntutor wants to merge 2 commits into
rtk-ai:developfrom
lntutor:feat/2147-ignore-claude-worktrees

Conversation

@lntutor

@lntutor lntutor commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Summary

  • exclude Claude Code worktree content from native grep and ripgrep searches
  • use an exact !**/.claude/worktrees/** glob for ripgrep, including explicit --hidden searches
  • prevent native recursive grep from descending into .claude metadata
  • apply exclusions to both grouped filtering and passthrough/file-list modes
  • add end-to-end coverage for grep -r, grep -rl, rg --hidden, and rg --files

Testing

  • cargo fmt --all -- --check
  • cargo clippy --all-targets --all-features -- -D warnings
  • cargo test --all-features (2,497 passed, 8 ignored)

Closes #2147

@CLAassistant

CLAassistant commented Jul 20, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

Resolve conflict in passthrough(): keep both PR's add_default_search_excludes
and develop's --line-buffered piped-stdout handling.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01G8b9dEaJtpvydzz4ttM7JH
@KuSh

KuSh commented Oct 17, 2026

Copy link
Copy Markdown
Collaborator

Thank you for this. We are handling this class through #4477 (#4477 (comment)): rtk grep honours the project's ignore files during the walk, as rtk find does, rather than a fixed exclusion.

A fixed --exclude-dir=.claude also reaches further than worktrees. With it, grep -r NEEDLE . no longer finds matches in .claude/settings.json or .claude/skills/, and grep -r NEEDLE .claude returns nothing with exit 1, with no notice in either case.

#2147 stays open and is tracked with that direction; you are welcome to take the work there. Closing this one in favour of it.

@KuSh KuSh closed this Oct 17, 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 grep should ignore .claude/worktrees

3 participants