Skip to content
43 linesCodeBlameRaw

Pick any line to see why it is the way it is: the commit, the pull request and issue it came from, and what the agent was thinking.

g1t has a plugin for Claude Code, in its own marketplace at the repository's root (claude plugin marketplace add https://g1t.sh/flagon-io/g1t.git, then claude plugin install g1t@g1t). Its hooks record each session on g1t through the g1t CLI in a working copy of a g1t repository: SessionStart starts the session (g1t session start --harness claude_code --harness-session-id, idempotent on Claude's session id) and gives Claude the work context of the issue the session claimed or the branch names (g1t work context N, waited for under a second, else a line saying how to load it), or a line on how to claim one; UserPromptSubmit logs the prompt's first 2,000 characters; PostToolUse logs the tool's name and one line on what it was called with, with anything that looks like a secret hidden, and never what it returned, and after a git push that reached the remote sets the session's head commit; Stop sends a heartbeat and SessionEnd ends the session with Claude's reason. The hooks are one Node script with no dependencies that returns at once and runs the CLI in a detached process; when g1t is missing or signed out it records nothing and says so once, and it installs nothing. G1T_RECORD_PROMPTS=0 keeps prompts back and G1T_RECORD=0 records nothing. The plugin also connects g1t's MCP server, has the skills work-on-issue, fix-integration and coordinate and the commands /g1t:claim, /g1t:status and /g1t:handoff, and plugins/other-harnesses has the AGENTS.md lines that do the same with the CLI for Codex and other agents. node --test plugins/claude-code/test/hooks.test.mjs checks the hooks against a stand-in CLI, and CI runs it.1---
2name: coordinate
3description: Stay coordinated with other agents and people while working on a g1t issue. Use for longer work on an issue, when several agents work in one repository, or when asked to watch for overlapping changes, dependencies or merge-queue results.
4argument-hint: "[issue number]"
5allowed-tools: Bash(g1t:*) Bash(git:*)
6---
7
8# Coordinate on a g1t issue
9
10g1t tells everyone working in a repository what changes around them, as
11events. Follow the ones about your issue while you work, and act on them
12as they come rather than finding out at merge time.
13
14Issue: $ARGUMENTS (if empty, use the issue this session claimed).
15
161. **Follow its events in the background.** Start
17 `g1t work events --follow --issue N` as a background command, and read
18 its output between steps. Each line is one event. Add `--json` for one
19 JSON object per line.
202. **React to what arrives:**
21
22 | Event | What to do |
23 | --- | --- |
24 | `work.claimed` by someone else | Tell the person who asked you. Agree who goes on; hand off if it is not you. |
25 | `work.handoff_requested` to you | `g1t work context N`, read the note, then claim it. |
26 | `overlap.detected` | Another open pull request changes the same files. `g1t pr diff OTHER`, then narrow your change or agree an order on the pull requests. |
27 | `dependency.changed` | Something this issue waits on changed. If `cleared`, the blockers are gone: pull the default branch and go on. If one was added, stop and say so. |
28 | `integration.failed` naming your pull request | Use the `fix-integration` skill. |
29 | `integration.passed` | Nothing to do; the change is landing. |
30 | `session.ended`, `work.claim_expired` | A collaborator stopped. If their work blocks yours, look at what they left with `g1t work context N`. |
31
323. **Keep your own state true.** The session's heartbeat renews your
33 claim while you work. If you change course, log why with
34 `g1t session log --kind note "TEXT"`.
354. **Hand off cleanly.** When you stop before the issue is done:
36 `g1t work handoff N --note "what is done, what is left, what to watch out for"`
37 (add `--to LOGIN` for someone in particular). When it is done, the
38 claim ends with the merge; `g1t work release N` lets go of it earlier.
395. **Stop following** when you hand off or the pull request merges: stop
40 the background command.
41
42`g1t work list` shows every active claim and session in the repository,
43for when you need the whole picture.