Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions apps/cli/src/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1117,6 +1117,23 @@ export const PrivacySettingsCommand: SlashCommand = {
},
};

export const BtwCommand: SlashCommand = {
name: '/btw',
description: 'Add a "by the way" note to the context (no agent turn fired).',
run(args, ctx) {
const note = args.join(' ').trim();
if (!note) {
return ['Usage: /btw <note> β€” queues a side-note the agent sees with your next message.'];
}
const base = ctx.history ?? [];
ctx.newHistory = [
...base,
{ role: 'user', content: [{ type: 'text', text: `(By the way: ${note})` }] },
];
return [`Noted β€” the agent will see this with your next message.`];
},
};

export const BUILTIN_COMMANDS: SlashCommand[] = [
HelpCommand,
ClearCommand,
Expand Down Expand Up @@ -1152,6 +1169,7 @@ export const BUILTIN_COMMANDS: SlashCommand[] = [
PrCommentsCommand,
UpgradeCommand,
PrivacySettingsCommand,
BtwCommand,
];

// ──────────────────────────────────────────────────────────────────────────
Expand Down
15 changes: 15 additions & 0 deletions apps/cli/src/parity-commands.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,3 +208,18 @@ describe('/resume <id> (live switch)', () => {
expect(out.join('\n')).toMatch(/Recent sessions/);
});
});

describe('/btw', () => {
it('queues a context note into newHistory', async () => {
const c = ctx({ history: [{ role: 'user', content: [{ type: 'text', text: 'hello' }] }] });
const out = await reg.match('/btw')!.cmd.run(['use', 'tabs'], c);
expect(out.join('\n')).toMatch(/Noted/);
expect(c.newHistory).toHaveLength(2);
expect(JSON.stringify(c.newHistory)).toContain('use tabs');
});

it('shows usage with no note', async () => {
const out = await reg.match('/btw')!.cmd.run([], ctx());
expect(out.join('\n')).toMatch(/Usage: \/btw/);
});
});
2 changes: 1 addition & 1 deletion docs/BEHAVIOR_PARITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Legend: `βœ…` matches Β· `🟑` matches with caveats Β· `πŸ”„` deferred Β· `⚠
| `/plugins` | βœ“ | βœ“ | βœ… β€” lists wired plugins + contributed hook events + warnings (M5.2) |
| `/compact` | βœ“ | βœ“ | βœ… β€” manual `/compact` + automatic threshold trigger in the agent loop |
| `/diff` | βœ“ | βœ“ | βœ… β€” git diff + untracked files in the working tree (PR #150) |
| `/btw` | βœ“ | βœ— | πŸ”„ |
| `/btw` | βœ“ | βœ“ | 🟑 β€” queues a "by the way" context note the agent sees with your next message (no turn fired); exact Claude Code behavior may differ |
| `/recap` | βœ“ | βœ“ | βœ… β€” provider-summarized recap of the session so far |
| `/rewind` | βœ“ | βœ“ | βœ… β€” 5 ops (code/conversation/both/summarize-from/up-to); `Esc Esc` bound |
| `/voice` | βœ“ | βœ— | πŸ”„ M8 |
Expand Down
Loading