Andromeda Workshop
Concepts & tools
Version control
Running models
What makes an AI agent?
An agent is an AI system that can perceive its environment, reason about what to do, act through tools, and iterate on the results — all without step-by-step human guidance.
You describe a task in plain English
↓
Agent reads your codebase (file tree, key files)
↓
Agent plans: what files to change, what commands to run
↓
Agent edits files, runs tests, reads output
↓
Agent fixes errors, re-runs, iterates
↓
Agent commits result to git — you review the diff
Why does this matter for you?
You do not need to be a software engineer to benefit. If you write R or Python for data analysis, a coding agent can help you refactor scripts, find bugs, write documentation, and manage your git history — all from plain English.
| Feature | Claude Code | OpenCode |
|---|---|---|
| Provider | Anthropic | Open-source community |
| Cost | Subscription / API | Free (with free models) |
| Models | Claude (default) | 75+ providers |
| Local models | Via providers | Full Ollama support |
| Privacy | Proprietary | No data stored |
Both support: CLAUDE/AGENTS.md, git integration, GitHub PRs, subagents.
claude.ai/code/review-pr, /deploy-staging, shareable across teamsSign in with a claude.ai Pro/Max account, or set an API key:
VS Code: install the Claude Code extension from the marketplace.
The key insight: git as long-term memory
Every session starts fresh. These files give the agent durable context: coding conventions, architecture decisions, which files to avoid, what tests to run. Commit them to git — they travel with your project.
Claude Code treats git as a first-class citizen:
git log at session start to understand recent history.github/workflows/opencode.yml to automate agent tasks in CI/CD/connect command — interactively add provider API keysOn first run, OpenCode prompts you to connect a provider with /connect.
OpenCode is configured with an opencode.json file in your project root:
Provider credentials: run /connect <provider> inside OpenCode — never hardcode keys in the config.
Tip
Already use git daily? This section is a quick visual refresher — the agent-specific patterns come next.
Have you ever done any of these?
analysis_final.R, then analysis_final2.R, then analysis_FINAL_v3.RVersion control is the solution — and git is the tool everyone uses.
| Term | Meaning |
|---|---|
| Repository (repo) | A folder tracked by git |
| Commit | A saved snapshot of your files at a point in time |
| Branch | An independent line of work within a repo |
| Remote | A copy of the repo hosted online (GitHub, GitLab) |
Two different things
Git runs locally on your machine — it is the version control tool.
GitHub is a website that hosts git repositories online — where you push commits to back them up or collaborate with others.
You can use git without GitHub. GitHub is just a convenient remote storage and collaboration platform.
Tell git who you are (once, on each computer):
Start tracking a project:
That’s it. Your folder is now under version control.
Every file in a git project lives in one of three places:
Working tree Staging area Repository
(your files) (the "index") (git history)
Edit file → git add filename → git commit
The two-step process (add then commit) lets you craft clean, logical commits even when you have changed many files at once.
Good commit messages
Write in the imperative mood: “Add regression table”, not “Added” or “Adding”. Keep it under 72 characters. Future you (and future agents) will thank you.
You do not need to memorise commands — VS Code and Positron have a built-in Source Control panel:
VS Code Source Control panel
Tip
Open with Ctrl+Shift+G (Windows/Linux) or click the branch icon in the left sidebar.
Ctrl+Enter)The ... menu gives access to pull, push, create branch, stash, and more — all without the terminal.
Click any changed file in the Source Control panel to open a diff view:
VS Code inline diff — green lines added, red lines removed
Tip
Right-click any hunk to stage only that block — keeps commits focused and logical.
When git cannot automatically merge two branches, VS Code opens a 3-way merge editor:
VS Code 3-way merge editor
Tip
Click Accept Current, Accept Incoming, or Accept Both — no manual marker editing needed.
Git is your safety net
AI agents make many changes fast. Without git, you cannot know what changed, when, or why — and you cannot undo it safely. With git, every agent action is traceable, reversible, and reviewable.
Pull before pushing
Always pull before pushing, even when working alone. Agents may have pushed to the remote since your last pull.
git diffReview every agent diff
Before accepting an agent’s work, always run git diff or git diff --staged. Agents are fast but not infallible.
Lines starting with + are additions; lines with - are deletions.
git loggit log --oneline # one line per commit
git log --oneline --graph --all # visual branch tree
git log --author="Bas" # filter by author
git log --since="1 week ago" # filter by date
git log -- src/analysis.R # history of a single file
# Example output:
# * a3f9c12 (HEAD -> main) Fix NA handling in income variable
# * 8d21e05 Add regression table output
# * 4b0a317 (feature/new-plot) Add density plot for wagesAgents read this output to understand what has been done and what still needs doing.
Always work on branches — especially with agents:
Two merge types:
| Type | When | Result |
|---|---|---|
| Fast-forward | No new commits on main since branch | Linear history |
| Merge commit | Diverged histories | Preserves branch structure |
Best practice with agents: one task = one branch = one PR.
A conflict happens when two branches changed the same lines:
<<<<<<< HEAD
model <- lm(wage ~ education, data = wages)
=======
model <- feols(wage ~ education, data = wages, vcov = "hc1")
>>>>>>> feature/robust-se
Edit the file to keep what you want, delete the markers, then:
Tip
git add src/analysis.R → git commit — that’s all it takes to complete the merge.
git log = the agent’s memory of what has been donefeature/add-regression-table, fix/missing-data-pipeline)A well-maintained git history lets an agent pick up exactly where the last session left off:
A well-configured agent follows this pattern:
git checkout -b feature/summary-statsmain directlyThe safest way to work with agents:
You: "Add a regression table comparing OLS and IV estimates"
↓
Agent creates branch, writes code, commits
↓
You: git diff main..feature/regression-table
↓
You review — approve, or request changes
↓
Merge to main
Never skip the diff review
Reading git diff before merging is the single most important safety habit when working with AI agents. It takes 2 minutes and prevents hours of debugging.
Five rules for working with AI agents and git:
maingit diff or PR before merginggit log to Brief Your AgentStart complex sessions by asking the agent to read the log directly:
$ claude "Read git log and summarise what has been done in the last week,
then identify what is still incomplete"
This turns git history into a briefing document — no need to re-explain the project every session.
macOS: brew install ollama or download the desktop app from ollama.com.
| Model size | RAM needed | Disk space |
|---|---|---|
| 7B | 8 GB | 5 GB |
| 14B | 16 GB | 9 GB |
| 32B | 32 GB | 20 GB |
Add to your opencode.json:
Ollama’s default context window is 2K tokens — too small for coding agents. Increase it before use:
All options below are free except the last:
| Provider | Model | Best for |
|---|---|---|
| Google Gemini Flash | gemini-2.0-flash |
Fast, everyday tasks |
| Mistral Devstral | devstral-latest |
Code-focused tasks |
| Groq | llama-3.3-70b |
Speed |
| Ollama + Qwen Coder | qwen2.5-coder:7b |
Privacy, offline |
| Anthropic Claude | claude-sonnet-4-5 |
Highest quality (paid) |
/connect googleopencode.json:No credit card required. Works from any machine.
npx opencode@latest/connect google (Gemini) or set up OllamaVersion Control in the Age of Agentic AI