| name | register |
| description | Register this session with cc-dm — sets your session name, role, and optional project tag for project-scoped messaging. Auto-invoked on first interaction if session name or role is missing. Use when the user asks to register, set name, change role, or set/change project. |
Register Session
Register this session with a user-chosen name, role, and optional project tag.
Arguments (fast path)
If arguments are provided (e.g., name: planner | role: worker | project: myapp):
- Parse the provided name, role, and project from the arguments.
- Skip the pre-check gate and interactive prompts entirely.
- Call the
register tool directly with the provided values.
- If the tool returns an error (e.g., name in use), report it clearly.
- If successful, confirm: "Registered as {name} with role {role}." If a project was set, add: "Broadcasts and DMs scoped to project {project}."
- Stop here — do not proceed to the pre-check or interactive registration.
Pre-check (gate)
Before prompting the user, determine if registration is needed:
- Read your session id from the MCP server instructions (the
"Your session id is ..." line).
- Call the
who tool to list active sessions.
- Find your session id in the results.
- If your session's
name is different from your session id (i.e. not session-XXXXXX), registration was already done AND no arguments were provided. Stop here silently — do not prompt the user.
- If your session is not found or its name still equals the auto-generated id, proceed to registration.
Registration steps
- Ask the user: "What session name would you like to use?" (e.g., planner, backend, reviewer, tests)
- Wait for their response.
- Before proceeding, check the
who results from the pre-check. If the requested name is already taken by another session, tell the user: "That name is already in use." Show the active session list and ask them to pick a different name. Repeat until available.
- Ask the user: "What role should this session have?" (e.g., orchestrator, worker, reviewer, specialist)
- Wait for their response.
- Ask the user: "What project tag should this session use? (optional — if set, broadcasts will be scoped to this project only)"
- If there are active sessions with non-empty project tags, list the distinct project tags: "Active projects:
myapp, api-server. You can pick one of these or enter a new one."
- The user can leave this blank for no project (global broadcasts).
- Wait for their response.
- Call the
register tool with the provided name, role, and project (if given).
- If the tool returns an error about the name being in use, it may be a stale session from a previous
/resume or /clear. Tell the user: "That name is held by a stale session that will expire within 60 seconds. Wait and retry, or pick a different name." Show the active session list.
- Confirm success: "Registered as {name} with role {role}." If a project was set, add: "Broadcasts and DMs scoped to project {project}."
If registration fails for any other reason, report the error clearly.