APL 3 · Dev Setup
Safe Git Practices with Agents
The right approach depends on who you are. Choose your guide.
Overview
When an agent writes code, the mental context you would normally have does not exist. Git fills that gap - it records what changed, lets you see it, and lets you undo it. The core principles are the same for everyone. The workflow is not.
Choose your guide
Solo builder / indie hacker
Personal or client project, one person working. Speed matters. The branch rule exists for rollback, not review. Includes aliases, multi-terminal setup, and the fast commit workflow.
Team
Two or more people sharing a codebase. Strict branching required. PRs, reviews, and CI checks are not optional. Agent-generated code follows the same rules as human-generated code.
Non-dev building systems
Authors, designers, managers using AI on non-code artifacts. Git concepts apply, tooling is lighter. In plain language - no commands required to understand the principles.
The three rules that apply to everyone
Save state before sessions
Commit your current state before any agent session starts. If the session produces bad output, you have a clean return point.
Review what changed
After the agent works, look at the diff before accepting anything. Look for files you did not expect to change, deleted content, and new dependencies.
Commit in small pieces
One agent session should not be one giant commit. Break it by logical unit so you can revert precisely if something breaks later.