Skip to content
Open
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
4 changes: 2 additions & 2 deletions examples/title/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ For more details on how to use and configure the title script, please refer to t
## How it works

The `title.sh` script reads a JSON payload from standard input, which contains real-time information about the agent's state and context. It then:
1. Extracts the `agent_state` and `workspace.current_dir` using `jq`.
1. Extracts the `agent_state`, `workspace.current_dir`, and optional `conversation_title` (or `conversation_name`) using `jq`.
2. Parses the current directory to determine a short workspace name (with special handling for CitC workspaces).
3. Maps the agent state to a corresponding emoji (e.g., 🤔 for thinking, 🛠️ for tool use, 😴 for idle).
4. Outputs the formatted title string in the format: `[Emoji] [State] | [Workspace]`.
4. Outputs the formatted title string in the format: `[Emoji] [State] | [Workspace]` or `[Emoji] [State] | [Workspace] ([ConversationTitle])` if a conversation title is set via `/rename` or `/title`.

## Examples

Expand Down
9 changes: 7 additions & 2 deletions examples/title/title.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ DATA=$(cat)
eval $(echo "$DATA" | jq -r '
"STATE=\"\(.agent_state // "idle")\"
CWD=\"\(.workspace.current_dir // "")\"
CONV_TITLE=\"\(.conversation_title // .conversation_name // "")\"
"
' 2>/dev/null || echo 'STATE="idle" CWD=""')
' 2>/dev/null || echo 'STATE="idle" CWD="" CONV_TITLE=""')

# Try to extract CitC workspace name from CWD
if [ -n "$CWD" ]; then
Expand All @@ -32,6 +33,10 @@ case "$STATE" in
*) EMOJI="🤖" ;;
esac

TITLE="$EMOJI $STATE | $WORKSPACE"
if [ -n "$CONV_TITLE" ]; then
TITLE="$EMOJI $STATE | $WORKSPACE ($CONV_TITLE)"
else
TITLE="$EMOJI $STATE | $WORKSPACE"
fi

echo "$TITLE"