# =============================================================================
# Wrangler / Cloudflare local state (R2 blobs, SQLite, miniflare)
# =============================================================================
.wrangler/

# =============================================================================
# Branch-specific artifacts (playgrounds, prototypes, design exports)
# =============================================================================
playgrounds/
!docs/playgrounds/
overcut/
# CI playground-check (PR Playground job) requires HTML at docs/<branch-slug>/.
# Closes #1461 — previously we had to use `git add -f` on every PR.
# These dirs ARE tracked now; remove the broad exclusions.
docs/design/
docs/research/
docs/migrations/

# =============================================================================
# Large binary assets (use external hosting, not git)
# =============================================================================
docs/*.pdf
docs/*.png
docs/*.html

# OS generated files
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db

# Editor swap files
*.swp
*.swo
*~

# Logs
*.log
logs/

# Temporary files
*.tmp
*.temp
.cache/

# Generated visualization outputs
outputs/

# Environment files
.env
.env.local
.mcp.json
# The live pi MCP config a user copies from .pi/mcp.json.example. Same reason as
# .mcp.json above: it is user-owned, project-scoped, and may carry a token.
.pi/mcp.json

# =============================================================================
# Runtime artifacts (should never be committed)
# =============================================================================

# Root level temp artifacts
HOOK_SECURITY_*.json
HOOK_SECURITY_*.txt
.test-skill-validation-*
.test-temp-*

# Instance-specific environment
.claude/.instance_env
.claude-local/

# Session state and runtime data
.claude/context/session.json
.claude/context/session/*
!.claude/context/session/.gitkeep
.claude/session/*
!.claude/session/.gitkeep
.claude/context/handoffs/
.claude/HANDOFF.md
.claude/context/quality_gate_review_evidence.json
.claude/context/verification-queue/
# Written by subagent-stop/auto-spawn-quality.ts. Session-scoped runtime state
# (spawn ids, ISO timestamps, trigger agent names), so it is never committable,
# but it was absent from this block and showed as untracked in every affected
# worktree (#3734).
.claude/context/spawn-queue.json

# Coordination runtime files
.claude/coordination/IMPLEMENTATION_REPORT.json
.claude/coordination/*.lock
.claude/coordination/heartbeats/
.claude/coordination/locks/
.claude/coordination/decision-log.json
.claude/coordination/.decision-sync-state.json
.claude/coordination/work-registry.json

# Hook logs (generated at runtime)
.claude/hooks/logs/

# Agent memory (M170/#3130): project scope (.claude/agent-memory/) is
# COMMITTED — CC injects it at spawn and git is the sharing mechanism.
# Local scope stays untracked per CC docs. PII pass required before adding
# new dirs (public repo): bash scripts are word-level + token-format scans.
.claude/agent-memory-local/

# Agent activity ledgers (runtime, per-branch attribution tracking)
.claude/agents/

# Worktrees (created by agent isolation, ephemeral)
.claude/worktrees/

# Worktrees checked out inside the repo. Each is its own checkout with its own
# .git file, so git already refuses to descend into them, but without this they
# still surface as one untracked "?? .worktrees/" line in every status call.
.worktrees/

# Negative count markers (runtime)
.claude/.negative-count-*

# All runtime logs
.claude/logs/

# Local settings (user-specific)
.claude/settings.local.json

# Hook overrides (per-project, user-specific)
.claude/hook-overrides.json

# Orchestration runtime state (session-specific)
.claude/orchestration/

# Hooks runtime artifacts (created during hook execution)
# Covers root, src/hooks, and plugins/*/hooks
**/hooks/.claude/
**/hooks/dist/*.map

# Python caches
.mypy_cache/
.pytest_cache/
.ruff_cache/
__pycache__/
*.pyc
*.pyo

# IDE/Editor specific
.idea/
.vscode/

# Local instance files
.instance/
.claude/coordination/.claude.db

# Runtime memory state (session-specific)
.claude/memory/
.claude/.comm-style-counter

# Telemetry runtime artifacts (JSONL events, circuit breaker state)
.claude/telemetry/

# Security audit artifacts (generated by verification agents)
SECURITY_AUDIT_*.txt
security-findings.json
.claude/settings.json
.claude/hooks/

# Demo build artifacts
orchestkit-demos/build/

# Next.js build cache (docs site)
.next/

# plugins/*/hooks/dist is TRACKED (#2360): marketplace installs have no build
# toolchain, so the built hook bundles must ship in git. Source of truth is
# still src/hooks/dist/ — build-plugins.sh rsyncs it into plugins/ and the CI
# drift gate fails when the committed copies go stale.

# Vercel local project config

# Feedback system (user-specific learning data)
.claude/feedback/
!.claude/feedback/.gitkeep
.claude/.satisfaction-counter
.setup-complete

# Node modules (all locations) — no trailing slash so symlink FILES named
# node_modules are ignored too (a trailing-slash pattern matches only real
# dirs, which let a worktree node_modules symlink slip into #2645 → 8.60.0).
node_modules
**/node_modules

# Generated plugin builds (now committed for marketplace distribution)
# Run `npm run build` before committing to ensure plugins/ is up-to-date
# .claude-plugins is tracked (relative path for portability)
viral-posts/01-skills-auto-activate.md
viral-posts/02-specialized-agents.md
viral-posts/03-hook-consolidation.md
viral-posts/04-typescript-performance.md
viral-posts/05-memory-fabric.md
viral-posts/06-plugin-marketplace.md
viral-posts/07-decision-history.md
viral-posts/08-video-demo-generation.md
viral-posts/09-security-validation.md
viral-posts/10-zero-config.md
viral-posts/README.md
tests/skills/functional/results/
tests/evals/results/

# Playground prototypes (design artifacts, not shipped)
playground-*.html
cellebrite-tech-stack.html

# Runtime hook state (session-specific, never committed)
.claude/state/last-test-run.json
.claude/state/edit-history.jsonl
.claude/state/ultrareview-usage.json
.claude/state/ork-metrics-*.json
.claude/scheduled_tasks.lock
.claude/state/

# session-state artifacts (machine-written per session)
.claude/HANDOFF.md.consumed
.claude/chain/

# Source maps are debug-only build artifacts — regenerated by esbuild, excluded
# from the shipped plugin by build-plugins.sh's rsync. Untracked (repo hygiene).
*.mjs.map

# Vercel CLI local linking state (projectId/orgId) — the CLI normally auto-ignores
# this; it is local machine state, not repo content. Untracked (repo hygiene).
.vercel/

# Per-session Claude telemetry (session-local, never committed)
.claude/memory/sessions/
docs/site/.claude/memory/sessions/

# Session artifacts from agents working in SUBDIRECTORIES. The root patterns
# above are all root-anchored, so a session whose cwd is e.g. src/hooks writes
# src/hooks/src/.claude/{HANDOFF.md,memory/} and nothing ignores it — that
# exact sweep contaminated two commits on 2026-08-01 before this was added.
**/.claude/HANDOFF.md
**/.claude/memory/

# Same anchoring class as the two rules above, found 2026-08-23 after four
# session-event files reached main (one 103 KB, inside a feat PR). A pattern
# containing a slash is anchored to THIS directory, so `.claude/state/` above
# only ever matched at the repo root while every nested copy stayed visible to
# `git add -A`. Nothing is tracked under a nested state/ or telemetry/ today,
# so these two are inert for existing files and only stop new ones.
#
# Deliberately NOT extended to orchestration/, coordination/ or agent-memory/.
# 18 real test fixtures are tracked under src/hooks/.claude/orchestration/ (a
# path line 128 already ignores, so they are tracked-despite-ignored since
# 2026-01; 31 files are tracked under src/hooks/.claude/ across all kinds), and
# project-scope .claude/agent-memory/ is tracked on purpose
# (M170/#3130). A blanket **/ rule over those kinds would silently swallow a
# legitimately-added fixture or agent-memory file, which is a worse failure
# than the one being fixed because it is invisible at `git add` time.
**/.claude/state/
**/.claude/telemetry/

# Subagent scratch probes. Two were committed by accident on 2026-08-08
# (__guards_main_tmp.ts, __probe_main_tmp.ts) — one of them would have poisoned
# any `grep permission_mode src/`.
**/__*_tmp.ts

# scratch fallback when the system temp dir is unwritable (see tests/run-all-tests.sh)
tests/.tmp/

# Build output for the publishable npm packages. Built on demand by
# `npm run build --workspace=<pkg>` and by the release workflow; never committed
# (unlike plugins/*/hooks/dist above, which marketplace installs need prebuilt).
packages/*/dist/
