Repository navigation
Description
Summary
_GITIGNORE_PATTERNS in src/backend/services/git_service.py ignores six .claude/* runtime directories under an explicit policy comment — "Claude Code runtime — commit commands/skills/agents, exclude runtime data" — covering .claude/projects/, .claude/statsig/, .claude/todos/, .claude/debug/, .claude/sessions/, and .claude/shell-snapshots/. .claude/plugins/ is absent from that list.
Claude Code installs marketplace plugins into ~/.claude/plugins/cache/<plugin>@<version>/ (a full copy of each plugin: skills, agents, hooks). Because a Trinity agent's HOME is its git repo root (ENV HOME=/home/developer, WORKDIR=/home/developer, repo at the same path), that cache lands inside the agent's git working tree and is auto-committed by the 15-minute sync loop — the same repo-bloat class as #1596, just via a different writer.
Context
Found while reviewing the platform skill-injection work (abilityai/trinity-enterprise#183), which had to add per-skill .gitignore lines and untracking for exactly this reason: anything the platform or the agent writes under ~/.claude/ is inside the repo by construction.
This is a path users are actively steered onto — CLAUDE.md recommends /plugin marketplace add abilityai/abilities and the trinity plugin is meant to be installed by agents (/trinity:onboard). Every plugin install is a fresh directory tree committed to the agent's GitHub repo, and every plugin update commits another copy.
Acceptance Criteria
-
.claude/plugins/added to_GITIGNORE_PATTERNSalongside the existing Claude Code runtime entries - Existing agents pick it up through the idempotent gitignore merge on next sync, and already-committed matches are untracked via the
git rm --cachedpath added in bug: git-sync agent workspaces grow unboundedly — auto-committed data churn bloats .git (44GB observed on one agent) #1596 (stops future churn; does not shrink existing history) - Verified against a live agent with a plugin installed: the plugin cache no longer appears in
git status, and the plugin still loads afterwards - Open question resolved before closing: does plugin install state need a committed manifest to survive a container recreate? Claude Code records installed plugins in
~/.claude.json, which is already gitignored — so a recreated agent may silently lose its plugins today. If that is the case, track it as its own issue rather than un-ignoring the cache (a re-installable cache does not belong in git either way)
Technical Notes
src/backend/services/git_service.py—_GITIGNORE_PATTERNS, the "Claude Code runtime" block; merge helper_build_gitignore_append_command; untrack pattern established by bug: git-sync agent workspaces grow unboundedly — auto-committed data churn bloats .git (44GB observed on one agent) #1596- Sibling issues in the same bloat class: bug: git auto-gc can never complete inside agent containers — unbounded, silent workspace .git bloat (273GB observed; 97%-garbage repos) #1595 (auto-gc can never complete in-container), bug: git-sync agent workspaces grow unboundedly — auto-committed data churn bloats .git (44GB observed on one agent) #1596 (auto-committed data churn)
- Root cause behind the whole category is the agent layout (repo root ==
$HOME) — tracked separately
Activity
fix(git-sync): ignore .claude/plugins/ so plugin caches aren't auto-c…
fix(git-sync): stop the base image's container-only .claude/settings.…
docs: design-system principle 30 (no variable-cardinality chrome abov…