Skip to content

feat(gitignore): ignore Claude local artifacts in managed block#471

Merged
Chemaclass merged 2 commits into
mainfrom
feat/gitignore-claude-local-artifacts
Jul 3, 2026
Merged

feat(gitignore): ignore Claude local artifacts in managed block#471
Chemaclass merged 2 commits into
mainfrom
feat/gitignore-claude-local-artifacts

Conversation

@Chemaclass

Copy link
Copy Markdown
Owner

Closes #469

Problem

The managed .gitignore block did not cover two machine-local Claude Code artifacts:

  • /.claude/agent-memory/ (agent memory store)
  • /.claude/settings.local.json (per-user local settings)

Both had to be added by hand outside the block, and a agnostic-ai sync could drop the hand-added entries.

Fix

  • New optional gitignoreHinter interface: an adapter declares ignore-only paths it creates but never emits. Mirrors the existing nativeOverviewer optional-interface pattern.
  • The claude adapter contributes both paths, honoring the outputs.claude.dir override.
  • sync (text + JSON paths) folds the hints into the managed block. Target-scoped: a project that does not enable claude never sees them.

Verification

  • Unit tests: GitignoreHints (defaults + dir override), hints folded into the block for claude, absent for codex/gemini.
  • E2E: init+sync on a claude project emits both entries; a codex-only project emits neither.
  • Full suite green (go test ./...), gofmt clean, go vet clean.

Docs

  • docs/user/configuration.md: managed-block section documents target-contributed hints.
  • CHANGELOG.md: entry under Unreleased / Added.

Claude Code writes .claude/agent-memory/ and .claude/settings.local.json
locally; agnostic-ai never emits them, so they had to be added by hand
outside the managed block and a sync could drop the hand-added lines.

Add an optional gitignoreHinter interface so an adapter can declare
ignore-only paths it does not emit. The claude adapter contributes both
paths (honoring outputs.claude.dir); sync folds them into the managed
block for every enabled claude target. Target-scoped: a codex-only
project never sees them.

Closes #469
@Chemaclass Chemaclass added the enhancement New feature or request label Jul 3, 2026
@Chemaclass Chemaclass self-assigned this Jul 3, 2026
@Chemaclass Chemaclass merged commit 5278be1 into main Jul 3, 2026
9 checks passed
@Chemaclass Chemaclass deleted the feat/gitignore-claude-local-artifacts branch July 3, 2026 04:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add /.claude/agent-memory/ and /.claude/settings.local.json to managed .gitignore block

1 participant