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 | --- |
| 2 | name: fix-integration | |
| 3 | description: Fix a g1t pull request that failed when the merge queue tested it together with other pull requests (an integration.failed event). Use when g1t reports an integration failure, or a queued pull request was removed from the merge queue because a combined check failed. | |
| 4 | argument-hint: "[pull request number]" | |
| 5 | allowed-tools: Bash(g1t:*) Bash(git:*) | |
| 6 | --- | |
| 7 | ||
| 8 | # Fix an integration failure | |
| 9 | ||
| 10 | The merge queue tests pull requests together, in queue order. A pull | |
| 11 | request can pass on its own and still fail once another one is merged | |
| 12 | with it. g1t then records an `integration.failed` event naming the pull | |
| 13 | request it holds responsible, the combination it tested (the pull requests | |
| 14 | merged together, in order), the failing check and its link, whether it | |
| 15 | bisected the combination to find the culprit, and the suspects when it | |
| 16 | could not tell. | |
| 17 | ||
| 18 | Pull request: $ARGUMENTS (if empty, use the current branch's pull request). | |
| 19 | ||
| 20 | 1. **Read what failed.** `g1t work events --type integration.failed --json` | |
| 21 | for the event (narrow it with `--issue N`), and `g1t work context N` for | |
| 22 | the issue, which shows the last integration failure, the pull requests | |
| 23 | on it and the decisions so far. | |
| 24 | 2. **Open the failing check's log** from the event's check link, or with | |
| 25 | `g1t run logs --failed` on that run. Find the first real error. | |
| 26 | 3. **Read the other pull requests in the combination.** | |
| 27 | `g1t pr diff OTHER` for each one tested with yours, and look for what | |
| 28 | meets your change: the same function changed two ways, a renamed or | |
| 29 | removed name you still use, a migration, a fixture or a test that | |
| 30 | assumes the old behaviour. | |
| 31 | 4. **Reproduce it locally.** Merge the default branch and the other pull | |
| 32 | requests' branches into a scratch branch in the same order, and run the | |
| 33 | failing check's command. | |
| 34 | 5. **Fix it on your branch.** Change only what the failure needs. If the | |
| 35 | right fix belongs in the other pull request, say so on it | |
| 36 | (`g1t pr comment OTHER`) instead of working around it, and tell the | |
| 37 | person who asked you. | |
| 38 | 6. **Push, then queue again.** Push the fix, wait for `g1t pr checks | |
| 39 | --watch` to pass, and merge again with `g1t pr merge`, which puts it | |
| 40 | back in the queue. | |
| 41 | 7. **Leave a record.** `g1t session log --kind note "Integration failure | |
| 42 | with #OTHER: CAUSE. Fixed by CHANGE."` so the next person can see why | |
| 43 | the change looks the way it does. | |
| 44 | ||
| 45 | If the event says the failure was not bisected and lists several | |
| 46 | suspects, check that yours really is one before changing anything: run the | |
| 47 | check on your branch with only the default branch merged in. |