Source: deferred from v3 imessage-alignment pass, decision 19
Problem
`sessions.name` is nullable + never auto-populated today. Sessions show up in the digest as `<short_id> @ <cwd_basename>`, which is fine for ambiguous-cwd cases but unfriendly for power users running many sessions.
Proposed fix
Tiny addition to the action enum.
Schema
```ts
z.object({
action: z.literal("rename"),
name: z.string().min(1).max(40).regex(/^[a-z0-9-]+$/),
}).strict()
```
Dispatcher
```ts
if (action.action === "rename") {
db.prepare("UPDATE sessions SET name = ? WHERE id = ?")
.run(action.name, MY_SESSION_ID);
return text(JSON.stringify({ name: action.name }));
}
```
Render
`computeDigest` already has the `name` field on session rows; `renderDigest` shows `` instead of `<short_id> @ ` when name is non-null.
Resolution
`resolveSessionTarget()` already tries `name` first via the existing query column, so renames "just work" once the verb lands.
Files to touch
- `plugins/cc/lib/action.ts` — extend discriminated union
- `plugins/cc/server.ts` — dispatcher branch
- `plugins/cc/lib/render.ts` — prefer name in digest
- `plugins/cc/skills/sessions/SKILL.md` — document
- `plugins/cc/tests/action.test.ts` — schema test
Acceptance criteria
Source: deferred from v3 imessage-alignment pass, decision 19
Problem
`sessions.name` is nullable + never auto-populated today. Sessions show up in the digest as `<short_id> @ <cwd_basename>`, which is fine for ambiguous-cwd cases but unfriendly for power users running many sessions.
Proposed fix
Tiny addition to the action enum.
Schema
```ts
z.object({
action: z.literal("rename"),
name: z.string().min(1).max(40).regex(/^[a-z0-9-]+$/),
}).strict()
```
Dispatcher
```ts
if (action.action === "rename") {
db.prepare("UPDATE sessions SET name = ? WHERE id = ?")
.run(action.name, MY_SESSION_ID);
return text(JSON.stringify({ name: action.name }));
}
```
Render
`computeDigest` already has the `name` field on session rows; `renderDigest` shows `` instead of `<short_id> @ ` when name is non-null.
Resolution
`resolveSessionTarget()` already tries `name` first via the existing query column, so renames "just work" once the verb lands.
Files to touch
Acceptance criteria