Skip to content
fromtheoutfitPublic

About

Automated review-and-revise loop for pull requests, built on Claude Code workflows. Reviews a PR, fixes what it finds, re-reviews the fixes, and hands off to a human reviewer.

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Redline

Redline is a Claude Code plugin that reviews a pull request, fixes what is worth fixing, and hands the PR to a teammate once a round finds no new correctness item to fix or ask about. It is one command, /redline <pr>, run by the author on their own PR; the second developer's review stays in place. Every item the review verifies ends one of four ways: Redline fixes it in this pull request, defers it to a drafted issue when it is worth doing and not here, declines it with a reason when it is not worth doing, or puts it to you. It asks on a real split only, every decision it makes alone is posted with its reason, where you can overrule it, and a deferred item is never left as a sentence in a thread: its issue is opened, or its draft is written where you said.

The loop, per round: review the PR (the built-in code-review skill finds over the whole PR at the round's head; Redline's reviewer verifies each candidate and states what is true, never what to do about it) and post one review with inline comments; shape: the shaper decides every verified item (fix it, decline it with a reason, defer it to a drafted issue when it is worth doing elsewhere, or ask you) and writes a spec for the fixes through Agent OS; approve the plan; implement one commit per finding; check the repository's gate; file each deferred item's drafted issue; push and reply in each finding's thread, saying where a deferred item went; re-review: the coverage pass again over the whole PR at the new head, and the fix diff rechecked. A round is bought by what it finds: a new correctness item that Redline fixes or asks you about runs another round, and a round with none ends the run. An item deferred with nothing shipped buys none, and neither does a low-severity bug in the previous round's own fixes, which is fixed and read once more by a final pass. Redline then resolves the threads it opened, requests review from your teammate, and posts the handoff comment, which lists every item by what became of it. It was built and proven end to end on seeded pull requests in a production Laravel application before it was packaged as a plugin.

Requirements

  • Claude Code with dynamic workflows (proven on 2.1.303 to 2.1.318) and its built-in code-review skill, the coverage pass (coverage off runs without it)
  • gh 2.48.0 or newer, signed in as the person who runs Redline
  • jq and python3
  • Agent OS in the repository, with a Verification Gate task in .claude/commands/agent-os/shape-spec.md. Stock Agent OS has none, so you add one first: two steps are enough (docs/setup.md, "The gate task"; #70 makes it optional)

Install

From the repository you want to use it in:

claude plugin marketplace add fromtheoutfit/redline
claude plugin install redline@redline --scope project

--scope project records the plugin in the repository's .claude/settings.json. Commit that file before /redline:setup, which needs a clean tree; teammates get the plugin from it. Updating and developing the plugin: docs/upgrading.md, CONTRIBUTING.md.

Quick start

  1. From the repository's root, on the default branch with the install and the gate task committed, in a Claude Code session: /redline:setup. It reads what it can off the repository, asks about the rest, writes the per-repository contract on a branch, runs the gate once, and hands you the files to commit (docs/setup.md).
  2. Check out a PR's branch, clean, at the pushed head, and type the command on a line of its own:
/redline 21
/redline 21 review only
/redline 21 dry run review only
/redline 21 autopilot
/redline:redline 21 max 2 rounds correctness only
/redline 21 defer at end defer to spec
/redline-revise 21 review @sam

/redline and /redline-revise are the short aliases setup writes; /redline:redline, /redline:redline-review and /redline:redline-revise are the namespaced forms, which always work. The words can come in any order. review only posts the review and revises nothing; dry run posts and pushes nothing and writes every body under the round's spec folder; autopilot never stops for you. The first launch asks for the settings it was not given and remembers them. What happens next, start to finish: docs/running.md.

Dials

Six settings shape a run besides the PR number, typed on the command line or remembered from the last run, and one word, coverage off, is typed per run and never remembered. interrupt says where the run stops for you:

Word Stops What you do there
autopilot Never Nothing. At a judgment call the shaper's recommendation becomes the decision, attributed redline (autopilot), and the run goes on; a deferred item's draft is filed as drafted
guided (default) When the shaper returns a judgment call (ask), which it does in five cases only (docs/running.md, "Dispositions"), or defers an item, whose drafted issue you see before it is filed (docs/running.md, "Deferred items") Answer the calls, one at a time, in the session (a pick per call, or one line <id>: <choice>. <reason>). The skill then lists what Redline declined in that round, and a line <id>: fix. <reason> overrules one (at a stop after the round's first resolve or its plan approver has run, it says to overrule one after the run instead). Then it shows each deferred item's drafted issue: let it go ahead, give it your own title, drop it, or make it a fix. Type relaunch; the run relaunches with the decisions
plan After shaping, every round See every finding's disposition (fix, decline, defer, ask) with the shaper's one-sentence recommendation and, for a decline, its reason. Approve as-is, change a disposition to fix, defer or accept (which overrules a decline), answer an ask or a deferred item's draft, then type relaunch; the run relaunches and stops again after the next round's shaping
review After the round 1 review is posted Pick the findings to act on, then type relaunch; each one not picked is dropped with a reason, which is posted in its thread. Later rounds stop as guided does
review only After the round 1 review Nothing is revised
Setting Words Default
interrupt as above guided
scope correctness only: anything that is not a correctness item is declined with the scope as its reason, listed once, and there is no final nit pass, except after a round that fixed a low-severity bug in the previous round's fixes; otherwise every verified item is decided, and a round that committed fixes and bought no further round (nits, or such a low-severity bug) ends in one final nit pass all
rounds max N rounds: the revise rounds before the run stops with a cap-hit comment 3
revise revise fable or revise opus: the model that shapes and implements the fixes; the other roles' models are in .claude/redline.json Opus 5.5
deferred items, when defer each round or defer at end: when a deferred item's drafted issue is put to you before it is filed. Each round: at the round's stop after shaping, with its judgment calls, and a round with only deferred items stops too. At the end: no stop inside the rounds, and one stop before the handoff, only when the run deferred something. autopilot asks nothing and files each draft in its round each round
deferred items, where defer to github, defer to spec or defer to print: Redline opens a GitHub issue per deferred item (a project board that takes new issues gets a card for each), writes the draft into the round's spec folder, or writes it there and prints its title and body when the run ends deferTo in .claude/redline.json, else a GitHub issue
coverage coverage off: every round runs the reviewer alone, without the coverage pass, under the same model (it reports what it verified, and the shaper decides); the fallback when the code-review skill is absent or its recipe has drifted, never the default on, at models.coverage in .claude/redline.json

reviewer @handle overrides the configured teammate for one run; no push keeps the commits local. A seventh setting, the repository's ask rules (what a person is always brought in for), is declared in .claude/redline.json and never typed (docs/contract.md).

Files

Path in the plugin What
.claude-plugin/plugin.json, .claude-plugin/marketplace.json The manifest and the single-entry marketplace, carrying one semver version
skills/redline/SKILL.md /redline:redline: the settings, the precheck, the launch, the hand-offs; redline-review and redline-revise beside it are the two halves
skills/setup/SKILL.md /redline:setup, the fourteen steps of docs/setup.md
workflows/redline-loop.js The loop: phases, the coverage pass, done rule, cap, the interrupt dial's stopping points, decision owners, the human review pass (docs/running.md)
agents/redline-*.md The eight roles: reviewer, shaper, resolve, plan-approver, standards-approver, implementer, checker, github
hooks/hooks.json, scripts/redline-guard.sh The per-role guard, a PreToolUse hook on Bash and the file tools (docs/guard.md)
scripts/redline-gh.sh Every GitHub call
scripts/redline-prefs.sh The saved launch settings and the run markers in .claude/redline.local.json
scripts/redline-gate.sh The gate stamp: extract, stamp, check
scripts/redline-background.sh A long gate run in the background for the checker and the implementer
scripts/redline-setup.sh The scriptable parts of setup
scripts/checks-template.sh What a repository's checks.sh is generated from (docs/contract.md); the headers of every script are quoted in docs/scripts.md
templates/ The per-repository files setup writes: the allow list and its retired entries, redline.json.example, the unattended section and its frozen history, the CLAUDE.md sentence, the two alias commands
tests/ The seven harnesses the gate runs: guard-test.sh over guard-cases.tsv, loop-test.mjs, prefs-test.sh, gate-test.sh, setup-test.sh, gh-test.sh, background-test.sh, with their fixtures
docs/ The reference, linked under Documentation below
CONTRIBUTING.md, CHANGELOG.md Developing, CI, the Docs step and releases; one changelog heading per tagged version

Git rules for Redline agents

These apply when the prompt says the session is a Redline run. Outside a Redline run the repo's CLAUDE.md Git section stands unchanged: never commit, push or stage.

  1. One commit per finding. Each finding fixed in a round is its own commit. The standards retrospective, when it changes anything, is one more commit on its own. The spec folder (agent-os/specs/<ts>-<pr>-review-round-<n>/, or <ts>-<pr>-human-review-<n>/ for a human review pass) is committed in the round's first commit or on its own; never mixed into a finding's commit. Its As built notes land in the round's last commit. So a round makes the spec commit, one commit per finding, the standards commit when there is one, and the as-built commit: three findings make six commits. A run that finishes (handed off, capped, a review only run after its post, a revise-only run after its replies) then makes one more, the run-record commit: after the handoff or cap-hit comment (and before it, the PR description when one was posted and the sweep that resolves the settled threads Redline opened), the GitHub agent stages, by name, every file under each round's <specFolder>/redline/ that no commit holds yet (the replies, the closing comment or a human review pass's summary, the description's backup, the ingested human review, and the review and findings of a round that had no revise pass), plus snapshot-start.json if it is untracked, and commits them as redline: record the run's replies, reviews and handoff for PR #<pr> (#<issue>). When nothing is left to stage there is no commit.
  2. Stage files by name. git add <path> [<path>...] only. Never git add -A, git add ., git add -u or git commit -a. A file that is not named in the plan task is not staged.
  3. redline: prefix. Every commit message starts with redline: followed by one sentence naming the finding and the change, for example redline: R1-2 reject a status outside the enum (#42). Reference the PR's issue number the way the repo's other commits do.
  4. No AI attribution. No Co-Authored-By, no "Generated with", no model or vendor names, in commits, PR bodies, comments, issues or spec files. Redline labels its own work as Redline (Redline round 2, Redline handoff, redline:), which is a tool name, not vendor attribution.
  5. Push only when args.push is true. The implementer never pushes. The GitHub agent pushes once per round, after the checker passed, and once more after the run-record commit, with git push to the PR's head branch and nothing else (no --force, no other refs). With push: false the commits stay local and the replies say so.
  6. Never merge, approve, rebase or amend. Reviews post with the COMMENT event. History is append-only during a run.
  7. A clean tree at the start and at the end. A fresh launch requires the PR's head branch, a clean tree and HEAD equal to the PR's head SHA. During a run the only expected uncommitted state is under the spec folders: the round's folder before its commit, and the reply files written after the round's last commit. A run that finishes leaves a clean tree, because the run-record commit holds the rest; a review only or revise-only run finishes the same way. A run that stops for the person (a hand-off, the review dial, an error) leaves its spec folder uncommitted and a marker in .claude/redline.local.json: a relaunch or a resume picks it up, and a fresh launch names the folders to commit or remove.

Known limits

  • Correctness inside one function is found reliably; a race between two commands is not. Across three seeded PRs, every planted bug that sits inside one function was found on the right line, 7 of 7: a missing status filter, a tie counted as a win, a streak one short, a missing value read as 0, an undocumented sort order, a method named for the wrong end of a copy, and a docblock that disagreed with its code. The one planted race was missed.
  • The missed race. One command copies an archived day file by file. A scheduled prune deletes days once they age out, and the oldest day is the one most worth keeping. When both run at once, part of the day is lost for good, and the copy fails with an error that reads as a storage fault. The reviewer read the prune and its schedule, and tested a failed copy against a mocked disk. It reported only that the failure path had no test, a nit. So round 1 had no correctness finding, and the run handed the PR to the teammate with the race still in it.
  • What a clean run means. The last round found no new correctness item that Redline fixed or asked about: every candidate of that round's coverage pass, and everything in the fix diff it rechecked, was refuted, collapsed into something already reported, settled, carried or tracked in full by an issue or a teammate's comment (the part an issue does not track is judged on its own), declined by Redline with a reason, deferred to a drafted issue with nothing shipped in this pull request, or not a correctness item (docs/running.md, "Rounds", step 7). A run can also end one step later: a round that committed fixes and bought no further round (nits, or a low-severity bug in the previous round's fixes) is followed by a final nit pass, which reads those fixes alone, and what that pass fixes is not read again. That is not a promise that no correctness bug remains. With the pass on, the reviewer verifies the candidates and runs no discovery pass of its own, so a bug no pass sampled is never read (see "Each coverage pass is a sample" below). What the run found and did not fix is all in the handoff: what Redline declined on its own, each with its reason, under Declined by Redline; what it deferred under Deferred, each with the issue Redline opened or the path of its draft; and every candidate the last covered round's verifier set aside (refuted, collapsed or already tracked), folded, with its outcome and ref, so you can overrule one (#85). A decided finding a later candidate still reproduced is in that block as settled, naming the earlier id (#80, R3-4). With coverage off, it means no correctness bug in the changed code that the reviewer could read or reproduce. It says nothing about the change running at the same time as a scheduled command or a queued job. The reviewer is now asked for that overlap (agents/redline-reviewer.md, "Scheduled and queued work on the same data"). Until a seed shows the check working, concurrency belongs to the human review.
  • The coverage pass runs outside the guard. The built-in code-review skill, the finder on every whole-PR and fix-diff round, runs as a fork of a plain workflow agent, and the fork carries no Redline agent_type, so the guard does not see its commands; a Redline role cannot host the pass either, since the fork would escape the role's row the same way and a role's output schema can swallow the fork's result. The pass's safety is the skill's own read-only recipe (read-only git, cat, grep and gh reads, in every run so far) and the session's permission mode; a default-mode session may be asked once by the fork. The one exception is the guard's main-session approval (#50): the fork is a non-role session to the guard, so the plugin's own scripts, checks.sh and read-only git are approved for it with no prompt; of redline-gh.sh, only the read subcommands, so a subcommand that posts, replies, comments, creates an issue or resolves threads meets the session's permission prompt (#80, R2-5). In bypass-permissions, the mode the launch warning offers an inline session (#76), that prompt does not exist, which removes the one check the guard cannot provide (#83, R1-6). A fresh launch with coverage off runs without the pass (docs/running.md, "The coverage pass").
  • Each coverage pass is a sample. The skill is stochastic and attends to what moved, so one pass does not find everything a second would; that is why it runs on every round and why the run goes on while a round finds a new correctness item to fix or ask about. A hand-run pass after a Redline run can still find something, and maxRounds bounds the rounds and their cost, about one skill pass each.
  • A decline is Redline's judgment. Redline decides alone whatever falls outside the five cases it asks about, a decision to decline included. Each decline is posted with its reason in the finding's thread, in the handoff and in the session's closing summary, and is settled: no later round raises it again, except one declined because it could not be confirmed, which a later round with the coverage pass raises as new once its verifier confirms it from a candidate; with coverage off it stays settled. Read the list; overruling one is a reply in its thread (a pull request review naming it, for one in the review body) and a human review pass, or a typed line at a stop the run already makes before the round's plan approver has run (docs/running.md, "Overruling a decline").
  • A deferred item becomes a GitHub issue, and a board that takes new issues gets a card. With drafts going to GitHub, the default, Redline opens one plain issue per deferred item, with no label, and does nothing about a project board: a repository that routes new issues onto a board gets a card for each, and GitHub notifies whoever watches the repository's issues, as it does for any new issue. On every dial but autopilot you see each draft first and can drop it. On autopilot each is opened as drafted with no question, in its round. defer to spec or defer to print, or "deferTo": "spec" in .claude/redline.json for the whole team, keeps the drafts as files in the round's spec folder (docs/running.md, "Deferred items").
  • An issue is opened once per finding, within one run. The round's record, and a lookup on GitHub for the draft's last line, make filing safe to repeat: a relaunch, a resumed round or a rerun of the filing step is given the issue already opened. The lookup is the second layer, for a run that died between opening an issue and recording it, and it is best effort, since GitHub's search can lag by seconds: a resume inside that window can open a second issue. A fresh run is outside both: it carries an unanswered finding forward under a new id, which neither the record nor the lookup can match, so there it is the reviewer's known-finding check, an issue search, that finds the earlier issue and reports the finding as already tracked.
  • With deferred items raised at the end, a run that never finishes leaves their threads unanswered. At that setting a deferred item's reply and its issue wait for the one stop before the handoff. A run that ends in an error it is not resumed from, or at a stop nobody relaunches, never reaches it: those threads carry no Redline reply and no issue exists. The next run finds those findings with no disposition and carries them into its first round, where they are verified and decided again. Raised each round, the default, an item's issue and reply are posted in its own round.
  • A deferred item's draft is the shaper's judgment, and its title is posted as written. What was found, why it is not fixed here and the fix proposed are written by the agent that deferred the item, and the issue stands on its own, so read a draft before letting it go ahead: on every dial but autopilot you are its only reader before it is filed, and on autopilot it has none. The body is escaped as review text is; the title is not, since GitHub shows an issue title as plain text, decoding no entity and linking no @word (measured on public issues' rendered titles). Whether an @word in a title notifies by some path other than a link was not measured; it is expected not to. A title is made one line and cut to 256 characters, so a longer one loses its end.
  • No commit is demanded of a deferral. A deferred item's mitigation is optional, so the check never fails for one and a deferral never stops a round. The cost: a mitigation task the implementer skips is not retried, and the item is posted as deferred to #<n> with nothing mitigated; and a mitigation committed under a subject that does not open redline: <id>, and not reported for the finding, is not counted, so it is pushed with the round, named in no reply and read by no Redline pass unless something else in the round earns a final nit pass or a next round, whose review range holds it. When the round planned the task, a warning in the run's result names the finding and the planned files; when nothing was planned for it, nothing warns (docs/running.md, "Deferred items").
  • What an answer to a judgment call ends in is stated by the agent that applies it. An answer names no disposition, so the resolve agent states whether it ends in a fix, a deferral or no change, and Redline reads the answer from that statement (docs/running.md, "Deferred items"). A statement the same agent's plan contradicts is caught before anything is built: a deferral with no deferred entry, a fix with no task that names files or an accept beside one that does stops the run at stage resolve, and a deferred entry beside a fix or an accept is dropped with a warning. An answer misapplied whole is not caught: a "Mitigate" answer planned as a full fix and stated as one agrees with itself, since the statement and the plan are one agent's output, so no issue is filed and nothing warns. The reply in the finding's thread says what was done (Applied in <sha>, with Deferred to #<n> or without), and that is where it shows.
  • A subscribed teammate gets one notification per reply. Every item Redline decides has a thread, and each reply is its own post, so someone subscribed to the pull request is notified once for a round's review and once more for each reply: about a dozen in a large round. GitHub can deliver a round's replies as one notification; Redline does not do that yet (docs/running.md, "How the review is posted").
  • A binary file, and a file whose diff GitHub takes no comment on, anchor nothing. GitHub's files listing leaves patch out of a binary file and of a text file whose patch is over about 100 KiB (56 of the 336 files of Losers League #778: built assets, lockfiles, generated code), and diff shows such a file as a header and one (no patch: ...) line, so the reviewer opens it in the tree only when a finding points there. A finding in such a text file is still placed inline, with a thread: the hunks come from GitHub's whole-PR diff, read on a PR of 300 files or fewer, and, for a file that diff does not give, from the clone, on a PR of any size (#96). What stays in the review body, behind <!-- redline:<id> --> and under one line saying why, where later rounds reply with an issue comment quoting the marker: a finding in a binary file, or in a file renamed with no text changes, neither of which has hunks; one in a file whose diff is past a size at which GitHub refuses every comment (measured on this repository: accepted at 290 KB of diff, refused at 1.25 MB); one on a line outside the diff's hunks, or in a file the PR does not change; one in a patch-less file neither source gives the hunks of: a file whose path a diff header quotes whatever git is told (a tab, a newline, a quote or a backslash in it), or one the whole diff does not give (a PR over 300 files, a refused read) when the clone does not hold the PR's base and head commits and their merge base; and, when GitHub refuses a review for any reason but a file's size, every finding on a file whose hunks came from the whole diff or the clone, since post-review then posts again from the listing's patches only.
  • A self-review that edits an agent file runs its later rounds under the edit. A relaunch runs the workflow script the run launched with, but agent files cannot be pinned: an agent run from a copy has no role, so no guard. The skill says which agent files changed, and the handoff comment repeats the list as the run's last hand-off or review-dial stop read it: a resume after an error or a stopped run keeps that list, so it never posts the comment twice (docs/running.md, "Hand-off and relaunch"). Two things were not measured: whether an interactive session reloads an agent file mid-session, and whether a relaunch from the pinned script runs with no prompt in bypass-permissions and asks exactly once in any other mode (#81).
  • A finding's description, its proposed fix and Redline's replies are posted as written. The finder's and the verifier's short fields are escaped, and their mentions neutralised (docs/running.md, "How the review is posted"). An inline comment's description and proposed fix, and a reply's text, are multi-line markdown with code fences, which that rule would escape whole, so they are posted as written; #88 tracks a rule for them. A bare @word there notifies the account it names. A bare tag formats what follows it in that comment; for a comment moved into the review body under Not placed inline, that is the rest of the body. The reviewer, shaper, resolve and implementer agent files ask for every @ identifier in backticks. Neutralised text has its own costs:
    • copying it from the page carries an invisible U+2060 after each neutralised @, since GitHub decodes the &#8288; the workflow writes;
    • an email address holding @x keeps its text but loses its link, and a bare URL holding @x shows &#8288; after the @ and its link breaks, though an @ inside an autolink is never a mention;
    • an inline link whose destination holds @x keeps its text, but its href gets the joiner after the @ (%E2%81%A0), so the link looks right and leads to another page, though an @ in a link destination is never a mention (#89, R3-1);
    • in a text escaped whole (one holding ](, ][, ://, www. in any case, a backslash before a backtick, a carriage return or a newline), a code span holding <, & or @x shows the entity (&lt;, &amp;, @&#8288;x); a backslash anywhere else, as in a namespace (App\Models\User), triggers nothing, so that text keeps its spans as written (#89, R3-3);
    • a backslash typed before < or & outside code shows the entity text, in any text (\<b> reads &lt;b>).
  • A thread a human opened or commented in is never resolved by Redline. Redline posts from the author's login, so it tells its own comments by the ids it posted, not by author: a thread from an earlier run is swept only when this run carried its finding forward or resolved it (its root and its replies are then in the list), and never one with a hand-written comment anywhere in it. Those stay open for the teammate to resolve; the handoff comment names them.
  • A paths ask rule refuses the writes the guard can see. The guard checks every write target it can extract (the Write and Edit tools, redirections, tee, sed -i, mv, cp, rm, mkdir, touch, git add), so a Redline role cannot write under a rule by any of those with a literal path. A Bash operand holding *, ?, [ or { is refused outside the temp directory, so a role names its files (#53); git add of a file whose name holds one is allowed when the file exists, since the path then names it exactly (#54). It does not see the files a build tool writes (php artisan make:, a formatter, npm run build), the operands xargs supplies to the implementer, or the files find -exec visits (it checks the starting directory). The checker's allowed list is the PR's files plus the approved plan, so a file under a rule that the PR already changes is not caught there either; the guard, the forced ask and the plan approver's bounce are the enforcement.
  • A stopped run resumes only from its own session, and only onto its own HEAD. The harness replays a run's cached agents from the session that launched it, so a resume from another session is refused with the claude --resume command to reopen the right one. Only a run that stopped with an error accepts a hand commit, and only under .claude/: a hand commit after a hand-off, the review dial or a stopped run, a hand fix outside .claude/, or any hand commit when the repository under review is this plugin, is a fresh run, refused before launch: its first round carries the earlier findings forward (#10).
  • A run on this repository runs the PR's own code only when the plugin loads in place. Started with claude --plugin-dir <checkout> (or from the local-directory marketplace), the skill, workflow, agents and guard that review a Redline PR are the PR branch's; from the GitHub marketplace they are the cached release's, and the launch precheck says so (#16). Loaded in place, the guard refuses the guard script and the hook registration to every role here, so a run cannot loosen the guard that vets it, and everything else the PR changes is what runs. Loaded from a cached release, the guard treats this checkout as an ordinary repository and does not refuse those two files: only point 11 of the unattended section in .claude/commands/agent-os/shape-spec.md and the teammate's review keep a change to them out of a run, behind the precheck's warning. A finding in either file is deferred, mitigated by a tests/guard-cases.tsv row pinning today's decision or a line here, and a person makes the change after the run. The same holds for .claude/redline/checks.sh: a run cannot restamp it, so a finding whose fix changes the gate's backticked text in shape-spec.md, or how scripts/redline-gate.sh computes the hash or writes the stamp line, is deferred to a person too. So is a finding whose fix touches scripts/checks-template.sh below its header, or changes the text redline-setup.sh checks writes into this repository's checks.sh: the setup test regenerates checks.sh from checks.json and compares it with the committed file, and no role may regenerate it, so a person makes the change, regenerates checks.sh and restamps after the run.
  • checks.sh's kept result has gaps a person is to close (#94, round 6). Each needs a change to scripts/checks-template.sh below its header, which a Redline run may not make (see the bullet above), so a person makes it, regenerates checks.sh and restamps after the run; until then:
    • with TMPDIR unset, as is usual on Linux, the kept result is under /tmp/redline-checks/, created with the default umask, and nothing checks who owns that directory. On a host shared with other users, any of them can read every kept file (each check's command and the tail of its output, the changed paths, the commit subjects), and one who creates the directory first can replace a file between the checker's run and its verdict, so that a failing gate reads as passing when the result spilled. On a shared host, set TMPDIR to a directory only you can read before launching; macOS gives each user one already (R6-2).
    • the budget's figures (at most 22,960 bytes with every check failing, under 25 KB) assume that a byte left in a stream encodes as at most two: jq writes each byte that is not valid UTF-8 as three, so failing checks whose output is mostly Latin-1 or binary can reach about 28 KB. Over the Bash tool's inline limit the workflow reads the verdict, which carries no check's output (R6-4).
    • a run that cannot write the kept directory keeps nothing and removes nothing, so an earlier run's file for the same commit stays, and a --verdict after it reads that file as its own when its mode and snapshot match, though the template's comment says it finds nothing. It needs the directory to lose its write permission between two runs at one commit, which no Redline role can cause (R6-7).
    • a failure while keeping the result (a full temp filesystem, another checks.sh run for the same root removing the temp file before its rename, or an entry in a shared kept directory this user cannot remove) ends the script before it prints, and the run stops at check though the gate passed: free the space or stop the other run, and resume (R6-8).
  • The person's last typed line reaches every agent. On an interactive relaunch the harness relays it with precedence over the agent's task, and a sentence in the prompt was not enough: on PR #59 the answer Refuse it stopped the snapshot. Redline relaunches only from relaunch or a line holding only a Redline command; an answer reaches the run only through args.decisions, args.selected, args.approvedPlans and args.deferrals, and a hand-off answer typed in any other words is a question, not a decision, until it is given as a pick or in the answer form (#60).

Documentation

  • docs/setup.md: what /redline:setup reads, asks and writes, step by step, with the by-hand equivalent
  • docs/contract.md: the per-repository contract: checks.json and checks.sh, the output contract, the gate stamp, redline.json, redline.local.json, the allow list, the unattended section, the CLAUDE.md sentence, the snapshot files
  • docs/running.md: a run start to finish: precheck, rounds, dispositions, hand-off and relaunch, the handoff comment, the run record, decided by
  • docs/guard.md: what each role may run and write, the hook, how to read guard-cases.tsv, the self-hosted rules
  • docs/upgrading.md: updating the plugin, and what a template bump means for a set-up repository
  • docs/scripts.md: every script's header, quoted verbatim
  • CONTRIBUTING.md: developing the plugin, CI, the Docs step, releases
  • CHANGELOG.md: what each version changed and which changes need a rerun of /redline:setup

About

Automated review-and-revise loop for pull requests, built on Claude Code workflows. Reviews a PR, fixes what it finds, re-reviews the fixes, and hands off to a human reviewer.

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages