tma1-peer · diff
git:20260622.f3727bc to git:20260828.e19040d
76 added, 76 removed. Audit A to A.
---
name: tma1-peer
- description: "Pull recent session content from peer coding agents (Claude Code, OpenClaw, Copilot CLI) that worked on the same project. Invoke this skill when the user asks you to read another agent's review feedback, see what someone else tried, or act on cross-agent context. Trigger phrases: \"what did claude do\", \"what did openclaw do\", \"what did copilot do\", \"peer sessions\", \"cross-agent context\", \"/tma1-peer\"."
+ description: "List recent sessions on this project by agent — peers (Claude Code, OpenClaw, Copilot CLI) or your own past sessions. Invoke this skill when the user asks you to read another agent's review feedback, see what someone else tried, act on cross-agent context, or recall your own earlier work here. Trigger phrases: \"what did claude do\", \"what did openclaw do\", \"what did copilot do\", \"peer sessions\", \"cross-agent context\", \"what did I do earlier\", \"/tma1-peer\"."
---
# TMA1 Peer-Agent Lens (Codex)
- You're being invoked because the user wants to see what a peer coding agent
- left on this project — typically because they used Claude Code, OpenClaw,
- or Copilot CLI to review or run something and now want you to act on that
- work without copy-pasting it manually.
-
- ## How to invoke this skill
+ Lists recent sessions on the current project, newest first. Default is
+ peer agents — the ones that aren't you — because the usual reason to call
+ this is "Claude Code or Copilot left something here, act on it without me
+ copy-pasting between terminals". Naming yourself is also allowed.
- This skill is auto-selected when the user mentions reading another agent's
- output on the current project, or when they explicitly type
- `/tma1-peer [agent] [count] [messages]`. Parse:
+ ## Invocation
- - First positional arg (optional): peer agent name (`claude` / `claude_code`
- / `openclaw` / `copilot` / `copilot_cli` / `all`). **If this arg is a bare
- integer** (e.g. `/tma1-peer 3`), there's no agent token: it is the count, and
- the next integer (if any) is messages per session — use `agent_source: ""`
- (all peers). Do not reject it as an unknown agent. E.g. `/tma1-peer 3 30` →
- count 3, 30 messages.
- - Count (first integer, after the agent name when present): recent sessions to
- pull, integer 1-5, default 1.
- - Messages per session (the integer after count): integer 1-100, default 10.
+ Auto-selected when the user mentions reading another agent's output on
+ this project, or typed explicitly:
- If none is supplied, treat as `all` with count 1 and 10 messages.
+ ```
+ /tma1-peer # all peers, latest session each
+ /tma1-peer claude # Claude Code only
+ /tma1-peer claude --full # with full conversation content
+ /tma1-peer self # your own recent sessions here
+ /tma1-peer copilot --limit 2 # latest 2 Copilot CLI sessions
+ /tma1-peer --summary --limit 5 # headers only, 5 per agent
+ /tma1-peer claude --since 6h # widen the time window
+ ```
## Normalize the agent name
- | Input | Canonical `agent_source` to send |
- | ----------------- | -------------------------------- |
- | `claude`, `cc` | `claude_code` |
- | `claude_code` | `claude_code` |
- | `openclaw` | `openclaw` |
- | `copilot` | `copilot_cli` |
- | `copilot_cli` | `copilot_cli` |
- | `all`, `*`, empty | `""` (returns all non-Codex peers) |
+ | Input | `agent_source` to send |
+ | ----------------- | ---------------------------------- |
+ | `claude`, `cc` | `claude_code` |
+ | `claude_code` | `claude_code` |
+ | `openclaw` | `openclaw` |
+ | `copilot` | `copilot_cli` |
+ | `self`, `me` | `self` (the server resolves it) |
+ | `all`, `*`, empty | `""` (every peer except you) |
Any other value: reply
- `unknown peer agent "<X>"; available: claude, openclaw, copilot, all` and
- STOP — do not call the tool with an unrecognised name.
+ `unknown agent "<X>"; available: claude, openclaw, copilot, self, all`
+ and STOP — do not call the tool with an unrecognised name.
- ## Call the tma1 MCP tool
+ ## Flags
- This project's TMA1 install registers an MCP server named `tma1`. Call
- the `get_peer_sessions` tool on that server with:
+ | Flag | Argument to send | Default |
+ | --- | --- | --- |
+ | `--summary` | `detail: "summary"` — header, tools, files; no messages | |
+ | (none) | `detail: "preview"` — 3 recent messages | default |
+ | `--full` | `detail: "full"` — 40 recent messages | |
+ | `--limit N` | `limit` — sessions per agent, `[1, 5]` | 1 |
+ | `--since 2h` / `--since 90m` | `since_min` in minutes | 1440 |
- | Argument | Value |
- | --------------- | ------------------------------------------------------ |
- | `agent_source` | the canonical name from the table above (or `""`) |
- | `limit` | the parsed count — **when the user gave a count you MUST pass it** (don't default to 1); omit only when none was given (server default `1`, clamp `[1, 5]`) |
- | `message_limit` | the parsed third arg if supplied (clamp `[1, 100]`), otherwise `10` |
+ Legacy positional form `[agent] [limit] [message_limit]` still works; a
+ bare leading integer is the limit, not an agent.
- If your runtime addresses MCP tools by a prefixed name (for example
- `tma1.get_peer_sessions` or `mcp_tma1_get_peer_sessions`), use whichever
- convention this Codex install uses — the tool itself is the same one
- backing TMA1's perception layer.
+ ## Call the tma1 MCP tool
- ## Use the returned content directly
+ This project's TMA1 install registers an MCP server named `tma1`. Call
+ its `get_peer_sessions` tool with the parsed arguments. If your runtime
+ addresses MCP tools by a prefixed name (`tma1.get_peer_sessions`,
+ `mcp_tma1_get_peer_sessions`), use whichever convention this Codex
+ install uses — it's the same tool.
- The response is a JSON object with two top-level fields worth knowing
- about:
+ ## Use the returned content directly
- - `sessions` array — each entry has:
- - Identity: `session_id`, `agent_source`, `started_at`,
- `last_activity_at`, `last_activity_ago`, `duration_minutes`, `cwd`.
- - Volume: `tool_call_count`, `tokens_input`, `tokens_output`.
- - Content: `messages` (chronological user / assistant / thinking),
- `recent_tool_names`, `files_touched`.
- - `most_recent_session` — shortcut to the freshest peer's `agent_source` +
- `last_activity_at` + `last_activity_ago`. Use this for your first-line
- summary so the user instantly knows whether the peer work is current.
- - `partial_failures` — map of `agent → error_message`. Present **only**
- when one or more per-agent queries failed in the all-peers fan-out
- (`agent_source: ""`). **Check this before treating empty `sessions`
- as "no peer activity"** — a non-empty map means the result is
- incomplete; tell the user which peer(s) couldn't be reached.
+ - `sessions` array — identity (`session_id`, `agent_source`, `started_at`,
+ `last_activity_at`, `last_activity_ago`, `duration_minutes`, `cwd`),
+ volume (`tool_call_count`, `tokens_input`, `tokens_output`), content
+ (`messages`, `recent_tool_names`, `files_touched`). On a `self` lookup,
+ `is_latest_for_cwd` marks the session you are almost certainly in right
+ now — don't report your own current work back as news.
+ - `most_recent_session` — freshest session's agent + age; lead with it.
+ - `partial_failures` — `agent → error_message`, present **only** when the
+ all-peers fan-out had a failure. **Check it before treating empty
+ `sessions` as "no peer activity".**
When you act on what the peer left:
- - **Quote concrete points the peer made.** Don't paraphrase. The user
- uses this skill specifically because they want the peer's exact
- feedback in your context, not your summary of it.
- - **List the files the peer touched.** If the user's next step is "fix
- what Claude flagged", you need to know which files matter.
- - **Surface the timing.** "Claude left this 12 min ago" is more useful
- than "recently".
+ - **Quote concrete points the peer made.** Don't paraphrase — the user
+ wants the peer's exact feedback in your context, not your summary.
+ - **List the files the peer touched**, when the next step is "fix what
+ they flagged".
+ - **Surface the timing.** "Claude left this 12 min ago" beats "recently".
+ - A message with `truncated: true` was cut to fit; fetch the rest with the
+ `get_session_transcript` tool for that `session_id`.
- If `sessions` is empty AND `partial_failures` is absent, reply
- `no recent <agent> sessions on this project in the active window`
- and stop — do not fabricate context. If `partial_failures` is present,
- quote the failed agent(s) instead of asserting silence.
+ If `sessions` is empty and `partial_failures` is absent, reply
+ `no recent <agent> sessions on this project in the active window` and
+ stop — do not fabricate context. If `partial_failures` is present, quote
+ the failed agent(s) instead of asserting silence.
+ ## Related tools
+
+ - Searching by keyword instead of by agent → the `tma1-search` skill
+ (`search_sessions`).
+ - Already holding a `session_id` → `get_session_transcript`.
+
## Examples
User: "what did claude leave on this project?"
- You: (call `get_peer_sessions` with `agent_source: "claude_code", limit: 1, message_limit: 10`)
+ You: (call `get_peer_sessions` with `agent_source: "claude_code", detail: "full"`)
You: "Claude Code reviewed `server/internal/handler/anomalies.go` 8 minutes ago and flagged three concrete issues:
1. fetchEmits has no LIMIT — body cap will truncate before the query finishes.
2. `applyForceColor` env dedup is libc-dependent.
3. anomalyCache.history map never evicts stale sessions.
Want me to address all three or pick one?"
- User: `/tma1-peer copilot 2`
- You: (call `get_peer_sessions` with `agent_source: "copilot_cli", limit: 2, message_limit: 10`)
- You: "Copilot CLI ran two sessions on this project today — the most recent
- deployed staging 20 min ago (success), the prior one 2 h ago ran the
- test suite and hit a flake in `TestSemAcceptsUpToCapacity`."
+ User: `/tma1-peer self`
+ You: (call `get_peer_sessions` with `agent_source: "self"`)
+ You: "Two of your earlier sessions here today: 14:20 landed the retry fix,
+ 11:05 was the abandoned migration attempt."