Skip to content

Prevent archiving (and deleting) of pinned sessions in CCD #62104

Description

@wwalter409

Request

When a session is pinned in the CCD session list, both the Archive and Delete items in its context menu should refuse the action — either grey them out, hide the keyboard shortcuts (A / D), or require an explicit Unpin first. The same refusal should apply to the mcp__ccd_session_mgmt__archive_session MCP tool.

Why

"Pinned" already communicates this matters to me, keep it visible. With the current menu, a pinned session is one stray A (Archive) or D (Delete) keypress away from disappearing — there's no safeguard. Archive is recoverable, Delete much less so.

Bonus: expose isPinned on the MCP API

mcp__ccd_session_mgmt__list_sessions currently returns only sessionId, title, cwd, isArchived, isRunning, lastActivityAt. Pin state isn't visible to MCP consumers, so:

  • archive_session can't natively short-circuit on pinned sessions
  • Hook-based or skill-based side-rails (e.g. a user-maintained pinned-sessions.json allowlist) have to duplicate state and inevitably drift from CCD's real pin attribute

Surfacing isPinned on the list response would let the MCP tool refuse pinned sessions itself, and would unblock community-built guards while the UI-level change is in flight.

Current workaround

For the MCP-tool path only, a PreToolUse hook on mcp__ccd_session_mgmt__archive_session reading a side-file of pinned sessionIds works today — but it can't intercept the in-app menu, and the side-file drifts from CCD's actual pin state unless manually kept in sync. The right home for this rule is CCD itself.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions