Skip to content

Clean dead code and finish work-context migration to /shared - #84

Merged
Juliusolsson05 merged 1 commit into
mainfrom
cleanup/dead-code-sweep-v2
May 13, 2026
Merged

Juliusolsson05 merged 1 commit into
mainfrom
cleanup/dead-code-sweep-v2

Conversation

@Juliusolsson05

Copy link
Copy Markdown
Owner

Summary

Salvages the high-signal portion of the parked cleanup/dead-code-sweep branch (commit ea7ce0e, May 11), re-derived on top of post-rename main so the cc-shell → agent-code rename is not regressed.

Four focused cleanups:

  1. Delete src/main/tmux/verify-tmux.ts — zero importers, was never wired into the tmux registry or any test.

  2. Inline toggleDangerousAgents into dangerousCommands.ts, delete dangerousActions.ts. The old module exported three runners (enable/disable/toggle) plus a shared helper but only the toggle was ever registered as a CommandDef. WHY-comment captures the non-obvious sequencing invariant.

  3. Finish the work-context migration to @shared/work-context. The renderer-side src/renderer/src/workspace/work-context/ directory was 8 one-line re-export shims left behind when the real implementation was moved to src/shared/work-context/ (the move had landed but never had its callers migrated). Switches the 9 consumers to import directly from @shared/* and deletes the shim folder. No behavior change — the shims were literally export * from '@shared/work-context/<x>'.

  4. Relocate work-context/colors.ts → tile-tree/TileLeaf/worktreeBadgeColor.ts. The file is misnamed: it's a worktree-badge palette helper, unrelated to the work-context machinery (matching/scoring/tracking). Moving it next to its only UI consumer (SessionBadges) makes future palette tweaks discoverable. Other importer (test script) updated.

Why these branches were salvaged, not rebased

The original parked branch was authored before the cc-shell → agent-code rename and would reintroduce "cc-shell" strings in README, package.json, CLAUDE.md, AGENTS.md, etc. across ~100 files. Rebasing was not safe. The intent was extracted and re-applied carefully.

Test plan

  • npm run test:work-context passes (covers the worktreeBadgeColor relocation)
  • npm run test:review-fixes passes (settings, prompt-templates, session-ownership)
  • npm run build:app succeeds
  • Confirmed zero new cc-shell / ccshell / cc_shell strings introduced (git diff main | grep -ic returns 0)
  • Manual: launch app, open command palette, verify Dangerous Agents toggle still works

Stats

20 files changed, +30/-205.

🤖 Generated with Claude Code

Salvages the high-signal portion of the parked `cleanup/dead-code-sweep`
branch, re-derived on top of post-rename main so it does not resurrect
"cc-shell" strings anywhere.

Four cleanups land here:

1. Delete src/main/tmux/verify-tmux.ts — zero importers, was never
   wired into the tmux registry or any test.

2. Inline toggleDangerousAgents into dangerousCommands.ts. The old
   dangerousActions.ts exported three runners (enable/disable/toggle)
   plus a shared helper but only the toggle was ever registered as a
   CommandDef; the other two were dead. WHY-comment captures the
   non-obvious sequencing constraint (set flag, close palette, await
   reload — in that exact order, or the new flag value races the
   reload and never reaches the next-spawned agent).

3. Finish the work-context migration to @shared/work-context. The
   renderer-side directory was 8 one-line re-export shims left behind
   when the real implementation was moved to src/shared/work-context.
   Switches the 9 consumers to import directly from @shared/* and
   deletes the shim folder. No behavior change — the shims were
   `export * from '@shared/work-context/<x>'`.

4. Relocate work-context/colors.ts (now misnamed — it has nothing to
   do with work-context, it's a worktree-badge palette) to
   tile-tree/TileLeaf/worktreeBadgeColor.ts, next to its only UI
   consumer (SessionBadges). The other importer is the test script;
   updated.

Net: 20 files changed, +30/-205. Build passes, test:work-context and
test:review-fixes pass.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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