Skip to content

Handoff: Forge cleanup + Claude best-practices audit (2026-07-09)

URL: https://mkdocs.justinsforge.com/memory/handoffs/forge-cleanup-claude-best-practices-2026-07-09/

Fable coordinator session, four Sonnet audit workers plus two implementation workers.

Done this session

Item Detail
Console root disk 95% -> 84% Deleted regenerable caches (ms-playwright 3.4G, puppeteer 627M, npm/pip caches, stale /tmp); moved backup staging files (ha_config_backup.tar, n8n_database.sqlite, erpnext sql.gz, 785M) to /mnt/workspace/Forge/backups/console-staging/
Repo hygiene commit f7570c5 161 untracked root debug artifacts (QA screenshots, a11y snapshot ymls) moved to _archive/root-clutter-2026-07-09/; gitignore now blocks root-level png/jpeg/yml, .db-shm/.db-wal repo-wide, and 6 runtime data pockets; untracked data/markai/markai_chat.db-shm; 14 dormant one-off migration scripts moved to _archive/scripts-dormant-2026-07-09/ (all in git history)
Skill fixes (same commit) freerun and rebridge descriptions trimmed; resume/SKILL.md was missing YAML frontmatter entirely (bare description: line, no --- delimiters, no name key), fixed
SessionStart hook commit ed63825 scripts/forge_hook_session_start_since_last.sh now dedups repeated monitor alerts (timestamp strip + digit normalization, "repeated Nx since HH:MM"); tested against live monitor-infra.log, rest of output byte-identical, 0.57s

Not done, needs restart window

~5.1G of Next.js dev caches sit under LIVE dev servers (creatortrack .next-dev 3.0G + .next-dev-float 462M; forge-suite-wt worktrees .next 985M + 570M). Safe to rm only after stopping/restarting those dev servers.

Key findings (unresolved)

  1. Split memory store, likely root cause of "chats missing context". The MEMORY.md Claude auto-loads lives in ~/.claude/projects/-home-justinwieb-forge/memory/ (291 files) NOT in repo memory/general/ (93 files); only 2 filenames overlap. Repo-scoped grep/recall cannot see the auto-loaded store; it is also not git-backed. Note there is additionally a ~/.claude-sub2/projects/... store used by some sessions (this one). Fix options: symlink the claude-projects memory dir into the repo, or migrate canonical home into forge/memory/ and symlink back. Decision needed before merging duplicates.
  2. Duplicate/contradictory memory clusters in the auto-load store: Listmonk decommission x3, Notion dead-system docs x7 (incl. 399-line notion-api-playbook), workspace-app x6, Intel AMT x3, CreatorTrack finance dupes x2, plus a direct contradiction (project_finances_app_hybrid_not_decommissioned.md vs MEMORY.md index saying RETIRED). Merge after decision 1.
  3. system-map full read every session is the largest context item (~4,900 tokens). Candidate: keep fleet.md + architecture.md in startup, keyword-gate the rest via the existing UserPromptSubmit hook pattern.
  4. memory/handoffs runaway pace: July at ~4.2/day vs ~1/day prior months; inflates SessionStart briefing over time. Consider monthly archive folders.
  5. context-mode plugin installed twice (context-mode and context-mode-scottconverse-context-mode), each growing a per-session SQLite index (113M + 74M during this session); likely the disk sawtooth driver. Remove one copy, ctx_purge old session DBs.
  6. UserPromptSubmit hook points at MEMORY.md sections ("HA API section" etc.) that no longer exist; minor pointer staleness.
  7. Ambiguous, left alone: forge_creatortrack_component_batch.sh (recent, purposeful); forge_em_dash_purge.py / forge_text_sanitize.py / forge_rename_helper.py kept (utility-shaped, not one-off).

Claude best-practices adoption list (researched 2026-07-09)

  1. Advisor tool: pair Haiku/Sonnet dispatcher workers and bot brains with an Opus advisor (/advisor opus, advisorModel setting, CC v2.1.98+, Anthropic API only). Cheap quality lift on unattended claude -p runs; subagents inherit it.
  2. .claude/loop.md: custom default prompt for bare /loop (PR babysitting / cleanup). The /loop feature is cron-backed, min 1m, self-paces without an interval.
  3. security-guidance plugin: /plugin install security-guidance@claude-plugins-official; reviews changes for vulns as Claude works, fits fail-loud doctrine.
  4. obra/superpowers: pull TDD + code-review phases (forge already lifted feature-plan from it).
  5. Dynamic Workflows trial: bounded task first (e.g. LESSONS.md debt sweep) with a budget gate; triggered by "workflow" in prompt, up to 16 concurrent agents.
  6. claude-cookbooks/managed_agents: read CMA_plan_big_execute_small.ipynb and CMA_verify_with_outcome_grader.ipynb against the dispatcher + grader design.
  7. isolation: worktree native subagent field: may retire/simplify scripts/forge_worktree.sh.
  8. Skip: Artifacts (Team/Enterprise gated), financial-services repo (off-mission).

Full research sources in session log; docs at code.claude.com/docs (whats-new, advisor, scheduled-tasks, workflows, skills, sub-agents).

Next actions

RESOLVED same day (2026-07-09 afternoon session), commits 15ff0f7..efa4043:

  1. DONE. Memory stores migrated into the repo: canonical index at forge/MEMORY.md, all topic files in memory/general/ (366 files), both ~/.claude and ~/.claude-sub2 project memory dirs are now symlinks into the repo. Duplicate clusters merged, finances contradiction resolved (RETIRED is correct; hybrid note was a 1-day-stale snapshot, archived). Commits 3c5995e, 451ca33, 69df647.
  2. DONE. system-map keyword-gated: fleet/architecture/steering mandatory, rest on demand via prompt hook; ~3,000 tokens saved per session. Commit 15ff0f7.
  3. MOOT. Root disk grown 48G to 97G by another agent; .next cache purge dropped, dev servers and reaper untouched.
  4. DONE-ish. Not a duplicate install: one plugin with a data-dir path-split bug (finding 5 corrected). Stale DBs backed up out; the 165M unnamespaced dir frees on next full session restart; claude plugin update errors ("not found") despite being installed, revisit.
  5. DONE. .claude/loop.md written (forge babysit prompt, never touches dev slots or reaper); security-guidance 2.0.6 installed and enabled in both configs. Advisor NOT enabled yet, awaiting Justin's go for dispatcher workers and bot brains.

Bonus same-day: mkdocs systemic 404s root-caused and fixed (clean rebuild was wiping the live serving dir every 2 min; now double-buffered atomic symlink swap, commit 1efd855); forge_worktree.sh retired for native EnterWorktree/ExitWorktree (fbe8e22); superpowers /tdd, /execute-plan, /debug-systematic ported (6047ce2).

Still open: enable advisor (needs Justin's go); full session restart to free the context-mode 165M dir; optional URL backfill for 349 migrated memory files (forge_mkdocs_url_backfill.py lives in _archive/scripts-dormant-2026-07-09).