Skip to content

feat(cli): add /btw for quick-capture notes to user memory#153

Merged
emal-avala merged 2 commits intomainfrom
feat/cmd-btw
Apr 22, 2026
Merged

feat(cli): add /btw for quick-capture notes to user memory#153
emal-avala merged 2 commits intomainfrom
feat/cmd-btw

Conversation

@emal-avala
Copy link
Copy Markdown
Member

Summary

Adds `/btw ` — a one-liner way to save a free-form note to the user's memory directory without going through the model.

  • Writes `btw-YYYYMMDD-HHMMSS-.md` via `memory::writer::write_memory` (the same path used by the memory system)
  • Slugifies the first ~40 chars for a descriptive filename
  • Updates `MEMORY.md` index so the note loads on the next session
  • Type: `user` memory · Description: first ~120 chars of the note

Example:
```

/btw prefers short, direct commit messages
Noted. Saved to ~/.config/agent-code/memory/btw-20260422-151200-prefers-short-direct-commit-messages.md
```

Why

When the user says "btw, I always do X" mid-session, the current options are (a) ask the agent to remember it, which costs a turn, or (b) drop out of the REPL to edit the memory file. This bridges that gap.

Test plan

  • `cargo check -p agent-code` passes
  • `cargo clippy -p agent-code --no-deps` clean
  • `cargo test --bin agent commands::tests` (7 unit tests for slugify + truncate)
  • Manual: `/btw` with no args prints usage
  • Manual: `/btw hello world` creates file and updates MEMORY.md

\`/btw <note>\` writes a free-form note to the user's memory directory
as a timestamped markdown file and updates MEMORY.md so the note
loads on the next session. Faster than asking the agent to "remember
that ...", and doesn't consume a turn.

- Filename: btw-YYYYMMDD-HHMMSS-<slug>.md
- Type: user memory
- Description: first ~120 chars of the note
@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

# Conflicts:
#	crates/cli/src/commands/mod.rs
@emal-avala emal-avala merged commit 598d14d into main Apr 22, 2026
12 of 13 checks passed
@emal-avala emal-avala deleted the feat/cmd-btw branch April 22, 2026 22:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant