Skip to content

docs(agents): type slash commands into your own pane, name the session, trim the file - #211

Merged
defangdevs merged 2 commits into
masterfrom
claude/agents-md-self-slash-commands
Aug 12, 2026
Merged

docs(agents): type slash commands into your own pane, name the session, trim the file#211
defangdevs merged 2 commits into
masterfrom
claude/agents-md-self-slash-commands

Conversation

@defangdevs

Copy link
Copy Markdown
Owner

What

Two new sections in the seeded AGENTS.md (modules/src/default-agents.md), so every session of every agent CLI gets them.

Slash commands: type them into your own pane. Slash commands are client-side. The agent never sees them as a tool call, so it cannot run them the usual way. But each session IS a tmux pane, so it can type into itself:

tmux send-keys -t "$TMUX_PANE" C-m
tmux send-keys -t "$TMUX_PANE" -l "/rename my-task"
tmux send-keys -t "$TMUX_PANE" C-m

Verified live in a Claude Code 2.1.226 session: the pane answered Session renamed to: blah.

Name your session for the work. Rename before you start a task, and keep the login name and the box host in the name. One box shows many sessions of many users in one web terminal, so a bare "review PR 42" says nothing about who or where. The section also states the limit: the name lives in the agent CLI, so a respawn loses it. agent-box-session add NAME --agent claude -- -n "..." makes it permanent.

Notes

  • The rename text is vendor-neutral. Codex has its own command set, and its binary strings are compressed, so the text points the reader at / in the TUI and at --help instead of naming a Codex command that may not exist.
  • Goldens regenerated with nix run .#update-golden; module-generated-up-to-date and module-single-file pass locally.

🤖 Generated with Claude Code

https://claude.ai/code/session_01T3WmpdY3zc555sNdkY9dzQ

defangdevs and others added 2 commits August 12, 2026 14:04
Slash commands are client-side: the agent never sees them as a tool call,
so it cannot run them. But each session IS a tmux pane, so `tmux send-keys
-t "$TMUX_PANE"` types into it. Verified with Claude Code `/rename`.

Add two AGENTS.md sections:
- the send-keys mechanism, with the literal-text flag and the two rules
  (the command runs after the current turn; non-commands become a message
  to self)
- name the session before you start a task, and keep the user and the box
  in the name, because one box shows many sessions of many users in one
  web terminal

The rename note stays vendor-neutral. Codex ships its own command set and
its binary strings are compressed, so the text points at `/` and `--help`
instead of naming a Codex command that may not exist.

Goldens regenerated with `nix run .#update-golden`.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T3WmpdY3zc555sNdkY9dzQ
The file is @imported by every session of every user, so its size is a
per-session context cost. Tighten the wording: shorter sentences, no
rationale paragraphs, no repeated framing.

Same sections and the same inline detail — every command, flag, path and
rule stays, verified by diffing the backticked tokens before and after.
199 -> 176 lines, 10.1 -> 8.9 KB rendered.

Goldens regenerated.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T3WmpdY3zc555sNdkY9dzQ
@defangdevs defangdevs changed the title docs(agents): type slash commands into your own pane, and name the session docs(agents): type slash commands into your own pane, name the session, trim the file Aug 12, 2026
@defangdevs

Copy link
Copy Markdown
Owner Author

Second commit: a prose trim of the whole seeded AGENTS.md.

The file is @imported by every session of every user, so its length is a per-session context cost, and the two new sections above made it longer. This commit takes that back and then some — shorter sentences, no rationale paragraphs, no repeated framing.

lines rendered
master 160 8.3 KB
+ the two new sections 199 10.1 KB
after the trim 176 8.9 KB

Same sections, same inline detail: every command, flag, path and rule stays. I verified that mechanically by extracting all backticked tokens from the rendered guide before and after — the set is unchanged.

I did not move the webhook mechanics out to agent-box-webhook --help, which duplicates most of that section and would save ~25 more lines. That is the bigger win if you want it later.

@defangdevs
defangdevs merged commit c2ec06c into master Aug 12, 2026
1 check passed
@defangdevs
defangdevs deleted the claude/agents-md-self-slash-commands branch August 12, 2026 21:22
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