Skip to content

Where people and agents ship software together. The open-source git platform for the whole job: issues, agents, checks and deploys to the edge.

g1t.sh

Commit

Agents are told how a commit closes an issue: on flagon-io/g1t #47 the billing session pushed its work straight to main with commits ending "(#47)", which only links the issue, so #47 stayed open after it shipped and was closed by hand. The plugin's SessionStart and subagent context (TRAILER in hooks/g1t.mjs), the work-on-issue skill's Finish step, the system prompt of sessions on Claude Managed Agents (for a repository's first commit) and the MCP server's instructions now say that a pull request's merge closes its issue, and a commit pushed straight to the default branch closes one only when its message says Closes #N (Fixes, Resolves), never with a bare (#N); the MCP instructions add that issue close with commit closes one after the fact. The Claude Code plugin guide says so. Deploy: api and integrations; the plugin ships with its next release. Checked: node --test of plugins/claude-code/test (56), cargo test -p g1t-api mcp (5), cargo test -p g1t-integrations agent_sessions (11).

G1t-Session:
ses_01m4z4sf18ew2v1nk04etwrkcb
syntaqxcommitted Parent6d9ce07Browse files
5 files+12−50/5 viewed
+1−1
1313 const INSTRUCTIONS: &str = "g1t is where your code, its history and the work around it live: repositories, issues, pull requests, workflows, deployments and packages. You bring your own agent; these tools are how it reads and changes what is on g1t, as the person or token it acts for. Repositories are named \"owner/name\"; issues and pull requests in one share a sequence of numbers.
1414 Tools are resources, each with an `action`: search, repository, issue, pull_request, session, workflow, observability, package, secret, webhook, access, team, workspace, ai, billing, security, notifications, account, artifact. The `action` field lists each action and the fields it needs. You see only what your token's scopes allow; a refusal names the scope it needs.
1515 Find a repository: account whoami lists your workspaces; repository list or search finds one.
16−Work on an issue: issue work (everything about it: what done means, who is on it, its pull requests, what it waits on), issue claim (advisory: it tells you who else is on it), then pull_request create with the issue's number: you get a draft with its own fork to clone and push to. Push your commits, then pull_request ready with a summary. Watch `overlaps` and `behind` on pull_request get, and its checks there: `statuses` from the repository's workflows and `required_checks`, which must pass before it merges. If one fails, read why with workflow get_run and job_logs, push a fix, and the checks run again.
16+Work on an issue: issue work (everything about it: what done means, who is on it, its pull requests, what it waits on), issue claim (advisory: it tells you who else is on it), then pull_request create with the issue's number: you get a draft with its own fork to clone and push to. Push your commits, then pull_request ready with a summary. Watch `overlaps` and `behind` on pull_request get, and its checks there: `statuses` from the repository's workflows and `required_checks`, which must pass before it merges. If one fails, read why with workflow get_run and job_logs, push a fix, and the checks run again. Merging closes the pull request's issue; a commit pushed straight to the default branch closes one only when its message says `Closes #N` (or Fixes, Resolves), never with a bare `(#N)`, and issue close with commit closes one after the fact.
1717 Coordinate: session start once per run of your harness (harness_session_id makes it idempotent), session update as a heartbeat, session get between work steps to read pending updates. Reading does not acknowledge: consider relevant changes, record a public decision summary, then session record with acknowledge containing only the exact update IDs considered. Keep your own session ID explicit, especially when sharing a checkout. Separate scopes may proceed concurrently; agree ownership before overlapping edits. session end when done; issue release or handoff (with a note) when you stop.
1818 Record public summaries only, never private chain-of-thought, credentials or secrets. As you work, pull_request record_session appends user-facing decisions, evidence and tool activity to the pull request's session, so reviewers see why the change is what it is; pull_request read_session reads it back. pull_request record_decision keeps a decision (why the change is made this way, or what fixed a failure) and list_decisions reads them; repository why says why a line of code is the way it is.
1919 Merge queue: when your pull request fails combined with the ones ahead of it, g1t says which of them it breaks with and the check that failed (on the pull request, its issue and its session, and as integration.failed). Fix it and push: once its checks pass, it rejoins the queue by itself.
+3−1
146146
147147 Claude is also told to put the trailer `G1t-Session: $G1T_SESSION` on the
148148 commits it makes, so g1t ties them, and the pull request they land in, to
149−the session.
149+the session, and that a commit pushed straight to the default branch which
150+finishes an issue says `Closes #N` in its message: a bare `(#N)` only links
151+the issue (see [Closing issues](/guides/pull-requests/#closing-issues)).
150152
151153 A session started from a hand-off (**Start a session** without an
152154 Anthropic [AI provider](/guides/ai/), or `g1t work dispatch N --handoff`) runs as
+1−1
892892 // --- the hooks ---------------------------------------------------------
893893
894894 /** What every session is told about trailers, so commits find their way back. */
895−const TRAILER = "Add the trailer `G1t-Session: $G1T_SESSION` to the commits you make (git commit --trailer), so g1t ties them to this session.";
895+const TRAILER = "Add the trailer `G1t-Session: $G1T_SESSION` to the commits you make (git commit --trailer), so g1t ties them to this session. A commit pushed straight to the default branch that finishes an issue says `Closes #N` in its message: a bare `(#N)` only links it, and the issue stays open.";
896896
897897 /**
898898 * SessionStart: marks the session as one in a g1t working copy, and
+5−1
7373 `g1t pr ready --summary "what changed and why"`, then `g1t pr merge`
7474 when you are allowed to merge. With the merge queue on, merging adds the
7575 pull request to the queue; if the queue reports an integration failure,
76− use the `fix-integration` skill.
76+ use the `fix-integration` skill. The merge closes the issue the pull
77+ request was made for. Where you commit straight to the default branch
78+ instead, the commit that finishes the issue says `Closes #N` in its
79+ message (`Fixes` and `Resolves` work too); a bare `(#N)` only links the
80+ issue, and it stays open.
7781 9. **Let go.** If you stop before it is done, hand it off rather than
7882 leaving a claim to expire: `g1t work handoff N --note "where it stands,
7983 what is left, what to watch out for"`.
+2−1
112112 The setup makes your commits the person's who started you: never set another author or committer.\n\
113113 - Work on a branch whose name starts with the issue number, and open a draft pull request early. Never push to the default branch, \
114114 except a repository's first commit when it has none yet: there is nothing to open a pull request against, so the first version goes \
115− straight to it.\n\
115+ straight to it. That commit says `Closes #N` in its message for the issue it finishes: a bare `(#N)` only links the issue, \
116+ and it stays open.\n\
116117 - A push to the default branch of a project with deployments on deploys production. When you push there, watch it with \
117118 `g1t deploy list` until it is live or failed; if it failed, read why, fix it and push again. Say where it is live in your report.\n\
118119 - Never write `@g1t` in what you post on g1t: that asks g1t for another session.\n\

Comments

Sign in to comment.