Skip to content

Commit 2e9fcd9

Browse files
feat: add /settitle to name the current session
Lets users give the active session a custom title so it shows up with a meaningful name in the /resume picker instead of "(untitled)". The title persists via SessionStore.setTitle and is included in the slash menu (aliases: title, name). Generated with Codebuff 🤖 Co-Authored-By: Codebuff <noreply@codebuff.com>
1 parent bfdc583 commit 2e9fcd9

5 files changed

Lines changed: 34 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [3.0.10] - 2026-08-17
9+
10+
### Added
11+
- `/settitle <title>` (slash menu: `title`/`name`): name the current session so it shows up with a proper title in `/resume` instead of `(untitled)`
12+
813
## [3.0.9] - 2026-08-17
914

1015
### Added

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "btch-cli",
3-
"version": "3.0.9",
3+
"version": "3.0.10",
44
"description": "An open-source AI coding agent, built with Bun and OpenTUI.",
55
"type": "module",
66
"main": "dist/index.js",

src/agent/agent.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -833,6 +833,12 @@ export class Agent {
833833
return this.session?.title || null;
834834
}
835835

836+
setSessionTitle(title: string): void {
837+
if (!this.session || !this.sessionStore) return;
838+
this.sessionStore.setTitle(this.session.id, title);
839+
this.session = { ...this.session, title };
840+
}
841+
836842
getChatEntries(): ChatEntry[] {
837843
if (!this.session) return [];
838844
return buildChatEntries(this.session.id);

src/ui/app.tsx

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,7 @@ const BUILTIN_TYPED_SLASH_COMMANDS = new Set([
339339
"/recap",
340340
"/recaps",
341341
"/resume",
342+
"/settitle",
342343
"/remote-control",
343344
"/mcp",
344345
"/mcps",
@@ -2302,6 +2303,22 @@ export function App({ agent, startupConfig, initialMessage, onExit }: AppProps)
23022303
openResumePicker();
23032304
return true;
23042305
}
2306+
if (c.startsWith("/settitle ") || c === "/settitle") {
2307+
const title = cmd.trim().slice("/settitle".length).trim();
2308+
if (!title) {
2309+
setMessages((prev) => [
2310+
...prev,
2311+
buildAssistantEntry(
2312+
"Usage: /settitle <title>\nExample: /settitle Fix login bug — sets this session's title so it's easy to find in /resume",
2313+
),
2314+
]);
2315+
return true;
2316+
}
2317+
agent.setSessionTitle(title);
2318+
setSessionTitle(title);
2319+
setMessages((prev) => [...prev, buildAssistantEntry(`Session titled: ${title}`)]);
2320+
return true;
2321+
}
23052322
if (c === "/wallet") {
23062323
openWalletPicker();
23072324
return true;
@@ -2490,6 +2507,10 @@ export function App({ agent, startupConfig, initialMessage, onExit }: AppProps)
24902507
inputRef.current?.clear();
24912508
inputRef.current?.insertText("/btw ");
24922509
break;
2510+
case "settitle":
2511+
inputRef.current?.clear();
2512+
inputRef.current?.insertText("/settitle ");
2513+
break;
24932514
case "update":
24942515
setIsUpdating(true);
24952516
setUpdateOutput(null);

src/ui/slash-menu.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export const SLASH_MENU_ITEMS: SlashMenuItem[] = [
1818
{ id: "models", label: "models", description: "Select a model", aliases: ["model", "mode"] },
1919
{ id: "recaps", label: "recaps", description: "Turn session recaps on/off", aliases: ["recap", "summary"] },
2020
{ id: "resume", label: "resume", description: "Resume an earlier session", aliases: ["history", "sessions"] },
21+
{ id: "settitle", label: "settitle", description: "Set a title for this session", aliases: ["title", "name"] },
2122
{ id: "new", label: "new session", description: "Start a new session" },
2223
{ id: "commit-push", label: "commit & push", description: "Commit and push" },
2324
{ id: "commit-pr", label: "commit & pr", description: "Commit and open PR" },

0 commit comments

Comments
 (0)