Skip to content

[Suggestion]: index files inside linked git worktrees that live under repo root (like .worktrees/) #608

@AndrewP-GH

Description

@AndrewP-GH

Which fff frontend(s)?

MCP server (fff-mcp)

What problem are you trying to solve?

In short

I use fff-mcp daily and I am very thankful for it — it became part of my hands. But there is one case where it cannot help me, and I think it is worth fixing.

When I start fff-mcp at the root of repository, it does not see files that live in linked git worktrees nested under this root. Typical layout in our team is <repo>/.worktrees/<branch>/. We keep .worktrees/ in .gitignore on purpose, so that git status stays clean. And here is the whole problem: fff respects .gitignore and .git/info/exclude honestly, so these files become invisible.

My environment

  • Tool: fff-mcp (the MCP build of fff), one positional argument [PATH]
  • Host: Claude Code. It starts MCP server once per session, and sets working directory of server equal to directory from where editor was launched.
  • OS: macOS (darwin)

What happens now

  1. fff-mcp decides its scan root through Repository::discover(&base_path)repo.workdir() (you can see it in crates/fff-mcp/src/main.rs). When I am already inside a worktree, this resolves to that worktree workdir, and then everything works perfectly — so per-worktree start is not a problem.
  2. But when I start from the main checkout, the root becomes the main workdir. Nested worktrees under .worktrees/ are thrown away, because they are written in .gitignore (and frequently in .git/info/exclude too), and fff obeys both of them.
  3. In CLI there is no --no-ignore, and in FffCreateOptions (crates/fff-c/include/fff.h) there is no field to switch ignore off. PATH is single — so no second root either.

So the conclusion is simple and a little sad: a session that started at the main checkout will never see the worktree files, and one instance cannot serve the main checkout and the worktrees together.

Why this is important for me (and possibly not only for me)

Worktrees nested under the repo (<repo>/.worktrees/<branch>/) are not exotic —
for teams that hold many branches checked out at the same time. We put .worktrees/ into .gitignore exactly to keep git status quiet, and exactly this gesture is what hides them from fff. Very often I open one session at the root and then walk into a worktree in the middle of work — and from this moment fff, nailed to the main root since launch, becomes blind to the very files I am editing. It is a pity, because the engine itself is fast and good.

Proposed solution

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions