Git-native intent memory

Stop coding agents from repeating old engineering mistakes.

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.

Install 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

Replace session auth with JWT

Decision
JWT for mobile stateless auth
Rejected
Remove OAuth middleware
Pin
refs/notes/mainline/intents
0

forbidden-list violations in intent-first eval runs

9

violations from code-first agents across the same scenarios

Git

stores repo memory in refs and notes, not one vendor workspace

The failure mode

Reasonable code. Wrong histórical reason.

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.

01

Pre-edit memory

Agents read relevant decisions, risks, constraints, and anti-patterns before non-trivial edits.

02

Review intent

Reviewers compare the implementation against the stated why instead of inferring intent backward from a diff.

03

Intent governance

Teams can see coverage gaps, low-quality sealed intents, risky changes, and overlapping in-flight work.

04

Long-term memory

Future maintainers know which approaches were tried, abandoned, superseded, accepted, or pinned to commits.

Agent loop

Read prior intent. Make the change. Record new intent.

  1. mainline context --current --jsonRetrieve repo memory before edits.
  2. mainline start "Add JWT auth"Claim a real unit of work.
  3. mainline append "Implemented middleware"Record decisions, pivots, and risks.
  4. mainline sealPreserve the durable decision record.

For solo builders

Preserve continuity between agents, branches, and future sessions. Your next agent should know why the last one abandoned an approach.

For teams

Make repo truth shared before review. See proposed work, file-level constraints, open risks, and intent coverage without Slack archaeology.

Public alpha

Coding agents should inherit engineering memory.

Mainline is usable today for early teams that want Git-native repo memory before agent-generated changes reach review.