Skip to content

chore: ignore all of .claude and .agents except skills#1185

Merged
MykalMachon merged 1 commit into
mainfrom
mykal/gitignore-skills
Jun 4, 2026
Merged

chore: ignore all of .claude and .agents except skills#1185
MykalMachon merged 1 commit into
mainfrom
mykal/gitignore-skills

Conversation

@MykalMachon
Copy link
Copy Markdown
Contributor

Summary of changes

Follow-up to the skill-sharing change. The .gitignore only kept .claude/settings.local.json out of git, leaving the rest of .claude/ (and all of .agents/) tracked. This switches to an ignore-everything-except-skills policy: only .claude/skills/ and the .agents/skills symlink are tracked; anything else either tool writes under those dirs stays local.

The pattern matters — .claude/ (trailing slash) excludes the directory itself so git never descends and a negation can't re-include anything. Using /* excludes only the contents, so !.claude/skills re-includes the folder. The .agents/skills negation has no trailing slash because it's a symlink, not a real directory.

.claude/*
!.claude/skills
.cursor/
.agents/*
!.agents/skills

Verified with git check-ignore: the skill + symlink stay tracked, any other path under .claude//.agents/ is ignored.

Docs

No docs impact — tooling/config only.

Replace the single .claude/settings.local.json ignore with a broad
ignore-all-except-skills policy so only the shared skills (and the
.agents symlink) are tracked, while everything else under .claude/ and
.agents/ stays local. Uses /* + negation so git still descends into the
dirs and honors the re-include.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@MykalMachon MykalMachon merged commit d2a868c into main Jun 4, 2026
4 checks passed
@MykalMachon MykalMachon deleted the mykal/gitignore-skills branch June 4, 2026 16:38
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.

1 participant