Skip to content

feat(01KVS11W): A Flow workspace git-ignores .claude/ so the runtime's worktrees and agent scratch never show up as untracked noise#437

Merged
jackmcintyre merged 2 commits into
mainfrom
story/native-01kvs11w2ggh84xqcwh79gmbqz-a-flow-workspace-git-ignores-claude-so-t
Jun 23, 2026
Merged

feat(01KVS11W): A Flow workspace git-ignores .claude/ so the runtime's worktrees and agent scratch never show up as untracked noise#437
jackmcintyre merged 2 commits into
mainfrom
story/native-01kvs11w2ggh84xqcwh79gmbqz-a-flow-workspace-git-ignores-claude-so-t

Conversation

@jackmcintyre

Copy link
Copy Markdown
Owner

What changed

A Flow workspace git-ignores .claude/ so the runtime's worktrees and agent scratch never show up as untracked noise

This change delivers the following acceptance criteria:

  • AC1: Given /flow:init provisions a workspace whose .gitignore does not already ignore .claude/, When init writes workspace config, Then .claude/ is git-ignored (a .gitignore is created or appended to) so the runtime worktrees and agent scratch are invisible to git, and any other existing .gitignore rules are preserved (append-safe, no clobber).
  • AC2: Given a workspace whose .gitignore already contains a .claude/ ignore rule, When /flow:init runs, Then it does not duplicate the rule and leaves the rest of .gitignore unchanged (idempotent).

Why

As an operator initialising a Flow workspace in my own project, I want /flow:init to git-ignore .claude/ in my workspace, so that the Claude Code runtime's per-story worktrees (under .claude/worktrees/) and agent scratch do not appear as untracked noise in my git status.

How to check it yourself

Run the init-workspace tests: cd plugins/flow/mcp-server && vitest run src/tools/tests/init-workspace.test.ts. The three new tests cover: (1) .gitignore created with .claude/ rule when absent, (2) .claude/ appended without clobbering existing rules, (3) no duplication when rule already present.

Risk and blast radius

Risk tier: medium

The change is scoped to the files in the diff below. Review the diff to judge its actual blast radius — including any effect on shared state, data schemas, or authentication paths — before approving.

What is explicitly not covered: reviewer verification of this summary's accuracy is handled by a separate companion story.

Evidence

The pre-pull-request build-and-test gate passed before this pull request was opened. No pull request can be opened by the automated flow unless both pnpm build and pnpm test exit 0 in the developer's working directory.

Per-criterion covering checks:

  • AC1 → plugins/flow/mcp-server/src/tools/__tests__/init-workspace.test.ts (automated test)
  • AC2 → plugins/flow/mcp-server/src/tools/__tests__/init-workspace.test.ts (automated test)

Story: native:01KVS11W2GGH84XQCWH79GMBQZ
Spec: .flow/native-stories/01KVS11W2GGH84XQCWH79GMBQZ.md
ACs:

  • AC1: Given /flow:init provisions a workspace whose .gitignore does not already ignore .claude/, When init writes workspace config, Then .claude/ is git-ignored (a .gitignore is created or appended to) so the runtime worktrees and agent scratch are invisible to git, and any other existing .gitignore rules are preserved (append-safe, no clobber).
  • AC2: Given a workspace whose .gitignore already contains a .claude/ ignore rule, When /flow:init runs, Then it does not duplicate the rule and leaves the rest of .gitignore unchanged (idempotent).

feat(init): git-ignore .claude/ on workspace init (append-safe, idempotent)

jackmcintyre and others added 2 commits June 24, 2026 00:00
…s worktrees and agent scratch never show up as untracked noise

When /flow:init provisions a workspace, it now ensures .claude/ is
git-ignored so the Claude Code runtime's per-story worktrees
(.claude/worktrees/) and agent scratch never appear as untracked noise
in git status. The implementation appends .claude/ to .gitignore
(creating the file if absent), is idempotent when the rule already
exists, and preserves all existing .gitignore rules. Tests cover both
new ACs.
@jackmcintyre jackmcintyre merged commit 5dcd636 into main Jun 23, 2026
@jackmcintyre jackmcintyre deleted the story/native-01kvs11w2ggh84xqcwh79gmbqz-a-flow-workspace-git-ignores-claude-so-t branch June 23, 2026 14:09
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