Pre-edit memory
Agents read relevant decisions, risks, constraints, and anti-patterns before non-trivial edits.
Git-native intent memory
Mainline gives AI coding agents the histórical why before they edit the current what: abandoned approaches, superseded decisions, reviewer constraints, risks, and in-flight intent.
curl -fsSL https://raw.githubusercontent.com/mainline-org/mainline/main/install.sh | bash $ mainline context --current --json
{
"anti_patterns": [
{
"what": "do not remove legacy /oauth",
"why": "callbacks still require session state",
"severity": "high"
}
],
"risks": ["billing migration still has duplicate-event risk"]
} Intent sealed
forbidden-list violations in intent-first eval runs
violations from code-first agents across the same scenarios
stores repo memory in refs and notes, not one vendor workspace
The failure mode
A coding agent can grep the repo, inspect a TODO, and finish the half-built Redis queue. That may still be the wrong move if the team already abandoned Redis because replication lag caused duplicate billing events.
Code search tells agents what exists now. Mainline records the decision memory that explains what should not be repeated.
Agents read relevant decisions, risks, constraints, and anti-patterns before non-trivial edits.
Reviewers compare the implementation against the stated why instead of inferring intent backward from a diff.
Teams can see coverage gaps, low-quality sealed intents, risky changes, and overlapping in-flight work.
Future maintainers know which approaches were tried, abandoned, superseded, accepted, or pinned to commits.
Agent loop
mainline context --current --jsonRetrieve repo memory before edits.mainline start "Add JWT auth"Claim a real unit of work.mainline append "Implemented middleware"Record decisions, pivots, and risks.mainline sealPreserve the durable decision record.Preserve continuity between agents, branches, and future sessions. Your next agent should know why the last one abandoned an approach.
Make repo truth shared before review. See proposed work, file-level constraints, open risks, and intent coverage without Slack archaeology.
Public alpha
Mainline is usable today for early teams that want Git-native repo memory before agent-generated changes reach review.