Skip to content

Skip LFS smudge when the worktree helper checks out a repository that uses Git LFS #17286

Closed

Description

@kyle-sexton

Steps to reproduce

  1. In a clone of a repository that tracks files through Git LFS (filter=lfs in .gitattributes) with its LFS objects already in the local store, for example melodic-software/knowledge-corpus, whose .gitattributes routes video, images, PDFs, EPUBs and audio through LFS.
  2. Create a worktree with /source-control:worktree create <name>.

A worker reported on 2026-11-18 that this copied 4.2 GB of LFS objects out of the local LFS store into the new worktree. Its attempt to skip that with -c filter.lfs.* overrides on the git command was denied by the permission system.

Expected behavior

Creating a worktree checks out LFS-tracked paths as pointer files and copies nothing from the LFS store; a session that needs the content fetches it on demand.

Actual behavior

The helper's checkout runs the LFS smudge filter on every LFS-tracked path, so each new worktree writes a full copy of the repository's LFS content. The worktree skill's create path has no LFS handling: worktree-create.sh runs a plain git -C "$toplevel" worktree add ... (three forms: existing branch, --no-track -b for fresh, -b for head), and neither it nor context/create.md mentions LFS or smudge (read at origin/main today).

Severity

medium

Severity justification

Each worktree of an LFS repository costs gigabytes of disk and minutes of copying, and lanes create many worktrees; the only in-session workaround (git config overrides) is refused, so nothing is lost but every create pays the full cost.

Suggested fix location

plugins/source-control/scripts/worktree-create.sh (the git worktree add call); plugins/source-control/skills/worktree/context/create.md.

Notes

Proposal

When the repository uses LFS, run the helper's git worktree add with GIT_LFS_SKIP_SMUDGE=1 in that one command's environment, which leaves pointer files (git-lfs-smudge(1): "GIT_LFS_SKIP_SMUDGE:: Disables the smudging process"). Say on stderr that LFS content was not checked out and how to get it: git lfs pull, or git lfs pull --include <paths> for part of it. Because the variable is set inside the helper, no session-level command shape or permission change is needed.

A permission-shaped fix (an allow rule for the -c filter.lfs.* overrides) is the owner's call and is not this proposal.

Root cause

known: the helper never sets LFS smudge off for the checkout.

Acceptance criteria

  • Creating a worktree with worktree-create.sh in a repository whose .gitattributes routes paths through filter=lfs leaves those paths as LFS pointer files in the new worktree.
  • In that case the helper writes one stderr line saying LFS content was not checked out, naming git lfs pull and git lfs pull --include <paths>; stdout stays the worktree path alone.
  • In a repository with no LFS attributes, the helper's checkout and output are unchanged.
  • context/create.md says LFS paths arrive as pointers and how to fetch them.
  • A test with a fixture repository using LFS proves the first two items, skipping with a named reason when git lfs is not installed; the helper's existing tests pass.

Out of scope

  • A per-repository setting to smudge LFS content at create.
  • Permission rules for git config overrides.
  • Native EnterWorktree creation, which this skill does not use.

Activity

  1. added theissue type on Nov 18, 2026
  2. added
    needs-triage
    on Nov 18, 2026
  3. github-actions commented on Nov 18, 2026

    @github-actions
    Contributor

    Size: Small
    Complexity: Low
    Uncertainty: Known
    Flags: none
    Blocked by: none
    Blast radius: the source-control worktree-create.sh helper, its create.md context page and one new test; read and run by anyone creating worktrees with /source-control:worktree create.
    Reversible: yes; revert the change, and worktrees already created are unaffected.
    Open questions: none
    Understood: creating a worktree in a Git LFS repository runs the smudge filter and copies the LFS content into every new worktree. You propose setting GIT_LFS_SKIP_SMUDGE=1 on the helper's own git worktree add, with one stderr note on how to fetch content, an update to create.md, and a fixture test. The acceptance criteria are exact, so nothing more is needed from you. I found no open duplicate and no merged pull request that already covers this.

    Automated triage. A maintainer reviews it.

  4. removed
    needs-triage
    on Nov 18, 2026
  5. melodic-automation-lanes commented on Nov 18, 2026

    @melodic-automation-lanes
    Contributor

    {"v":1,"actor_id":337595936,"title_sha256":"4de32d3cbda1a22917cdd9ae1d268514b67dd6d66c86d0d68000931c7b97d766","body_sha256":"9163b3bb36eedbee54f0fc23da6c87d11a3b3947fd85fbe78761830aa324b8c0"}

  6. github-actions commented on Nov 18, 2026

    @github-actions
    Contributor
    No description provided.
  7. melodic-automation-lanes commented on Nov 18, 2026

    @melodic-automation-lanes
    Contributor

    This records a re-fire of an earlier stop, not a new one. A GitHub API pool's stop floor stopped run 44406236443, the work-resolve-issue run that agent-ready started, after its model ran, until 2026-11-18T22:46:50Z. work-unblock has now removed and added agent-ready back to start a fresh run early in a window. A floor stop is the lanes' load, not a fault in this issue. After limits.limit-stops-per-issue of these since a person last added agent-ready or a run last reported, work-unblock waits the limits.stranded-backoff-hours failed-again backoff instead.

  8. github-actions commented on Nov 18, 2026

    @github-actions
    Contributor
    No description provided.
  9. github-actions commented on Nov 19, 2026

    @github-actions
    Contributor
    No description provided.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Fields

    Work status

    needs-triage

    Priority

    medium

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions