Skip to content
Development
Command

/chat

**Lightweight mode for responding to messages from external channels (Telegram, Slack, etc.).**

From plugin
jat
24836 skills36 commands
Install
$ npx -y skills add joewinke/jat --agent claude-code

How it fires

How this command gets triggered: by you, by Claude, or both.

  • Fires itselfClaude auto-loads it when your prompt matches the work.
  • You can call itInvoke it directly when you want it.
  • Slash command/chat

Context preview

What this command does when you run it.

**Lightweight mode for responding to messages from external channels (Telegram, Slack, etc.).**

Command definition

chat.md
argument-hint: [agent-name task-id]

/jat:chat - Conversational Chat Mode

**Lightweight mode for responding to messages from external channels (Telegram, Slack, etc.).**

Unlike `/jat:start` which runs a full task workflow, `/jat:chat` is optimized for conversational back-and-forth: 1. Read the message 2. Post a reply comment on the task 3. Pause and wait for follow-up

Usage

/jat:chat AgentName task-id    # Start chat on a task (IDE-spawned)

---

What This Command Does

1. **Establish identity** - Use pre-registered agent (same as /jat:start) 2. **Read the task** - Get the message from task description 3. **Emit starting + working signals** - So IDE tracks the session 4. **Post reply comment** - Write a task comment (external=true) as the response 5. **Pause** - Call pause API so session can resume on next reply

**Skip entirely:** Memory search, prior task review, conflict detection, review signals.

---

Implementation Steps

STEP 1: Parse Parameters & Get Agent Identity

Same as `/jat:start` Steps 1-2:

get-current-session-id
TMUX_SESSION=$(tmux display-message -p '#S' 2>/dev/null)
PRE_REG_FILE=".claude/sessions/.tmux-agent-${TMUX_SESSION}"
if [[ -f "$PRE_REG_FILE" ]]; then
    AGENT_NAME=$(cat "$PRE_REG_FILE")
fi

If no pre-registration file, register manually:

am-register --name "$AGENT_NAME" --program claude-code --model sonnet-4.5
PROJECT=$(basename "$(git rev-parse --show-toplevel 2>/dev/null || pwd)")
tmux rename-session "${PROJECT}-${AGENT_NAME}"

STEP 2: Get Task Details

jt show "$TASK_ID" --json

Extract from the task:

  • `title` - The original message
  • `description` - Full context including sender info and any follow-up replies

STEP 3: Emit Starting Signal

jat-signal starting '{
  "agentName": "AgentName",
  "sessionId": "...",
  "taskId": "task-id",
  "taskTitle": "message text",
  "project": "projectname",
  "model": "...",
  "tools": ["Bash", "Read", "Write", "Edit", "Glob", "Grep", "WebFetch", "WebSearch"],
  "gitBranch": "master",
  "gitStatus": "clean",
  "uncommittedFiles": []
}'

STEP 4: Update Task Status

jt update "$TASK_ID" --status in_progress --assignee "$AGENT_NAME"

STEP 5: Emit Working Signal

jat-signal working '{
  "taskId": "task-id",
  "taskTitle": "message text",
  "approach": "Responding to chat message from external channel"
}'

STEP 5.5: Check Available Data Tables

Before responding, check if the project has data tables relevant to the user's question:

jt data tables

If tables exist, their names and row counts will be listed. Query them to answer questions or update them based on user requests:

# Read data
jt data query "SELECT item, category FROM groceries WHERE status = 'needed'"

# Write data (use --force to skip confirmation)
jt data exec "INSERT INTO groceries (item, category, status) VALUES ('pecans', 'nuts', 'needed')" --force

# See table structure
jt data schema groceries

**When to use data tables:**

  • User asks about stored information ("what do I need from the store?")
  • User provides new data to remember ("we're out of pecans")
  • User asks to update or remove stored data ("got the milk, cross it off")

If no tables exist or the message is unrelated to stored data, skip this step.

STEP 6: Process and Reply

Read the task description carefully. It contains:

  • The original message (in the title and first line of description)
  • Sender info (`From: @username`)
  • Origin channel info (`Origin: telegram channel ...`)
  • Any follow-up replies appended as `**Reply from @username** (timestamp):`

**Process the message and formulate your response.** This could be:

  • Answering a question
  • Acknowledging a request
  • Asking for clarification

**Post the reply as a task comment:**

IDE_URL="http://127.0.0.1:3333"
TASK_ID="the-task-id"
AGENT_NAME="YourAgentName"

curl -s -X POST "${IDE_URL}/api/tasks/${TASK_ID}/comments" \
  -H "Content-Type: application/json" \
  -d "{
    \"text\": \"Your response here\",
    \"author\": \"${AGENT_NAME}\",
    \"author_type\": \"agent\",
    \"comment_type\": \"note\"
  }"

The comment API automatically sets `external: true` for agent-authored comments (jat-47wul.2 policy), making it visible in the widget panel and IDE thread.

**IMPORTANT:** Post only ONE comment per response. Do NOT post multiple comments for the same message.

STEP 7: Pause Session

After sending the reply, pause the session so it can be resumed when the user replies:

TMUX_SESSION=$(tmux display-message -p '#S' 2>/dev/null)
TASK_ID="the-task-id"

curl -s -X POST "http://127.0.0.1:3333/api/sessions/${TMUX_SESSION}/pause" \
  -H 'Content-Type: application/json' \
  -d "{\"taskId\":\"${TASK_ID}\"}"

**Important:** After the pause API call, the session will be killed. No further action is needed.

---

On Resume (Follow-up Replies)

When the user replies on the external channel, the ingest daemon will: 1. Detect the reply via thread tracking 2. Resume this session via `claude -r {sessionId}` 3. Inject the reply text via tmux send-keys

**The injected message will look like:**

The user replied on the originating channel (e.g. Telegram). Post your response as a task comment. Their message: {reply text}

**On receiving this message:** 1. Process the follow-up 2. Post a reply comment (CRITICAL - must post a comment, not just text output) 3. Pause again

This creates a conversational loop that continues until the task is closed.

---

Completing a Chat Task

If the conversation reaches a natural end (user says thanks, question answered, etc.):

  • Post a final reply comment as usual
  • Then run `/jat:complete` instead of pausing

---

Key Differences from /jat:start

| Aspect | /jat:start | /jat:chat | |--------|-----------|-----------| | Memory search | Yes | No | | Prior task review | Yes | No | | Conflict detection | Yes | No | | File reserva

Read more
Ships withjat

Agents ship, suggest, repeat. You supervise — or they run on their own. JAT is the complete, self-contained environment for agentic development. Task management, agent orchestration, code editor, git integration, terminal access—all unified in a single IDE.

Get the whole plugin