Run a repo locally
Someone sent you a repo — a link, or an invite you accepted. Now you want the thing it builds actually running on your machine. The fast way: hand the whole repo to your own agent and let it figure out the setup. It reads the project, installs what's missing, and starts it.
Time: ~2 min of your input on the agent path (it does the install/run); the slow part is whatever the project itself needs to download. You'll need: Claude Code, and the repo's link or a copy on disk. Last verified: 2026-06-07 · works on macOS, Windows, and Linux.
No agent yet? Set up Claude Code first (~10 min once) — then come back. Prefer to do it all by hand? Jump to the manual path at the bottom.
The default: point your agent at it
With Claude Code running, give it the repo and one instruction. If the sender gave you a link:
Clone https://github.com/alice/their-project, then read it, install what it needs, and run it. Tell me the URL or command to open it when it's up.
Already have the files in a folder? Start claude inside that folder and say:
Read this project, install what it needs, and run it. Hand me back the URL or command to open it.
Your agent reads the project's own setup notes (the README, the dependency files), installs the toolchain and packages, runs the start command, and tells you where to look — a localhost URL for a web app, or a command to type for a script. You don't need to know what language it's in. [confirmed — gh repo clone is the documented clone command]
One thing only you can do: if it needs a key or password the project doesn't ship (an API key, a database login), your agent will pause and ask. Paste it in, or tell it where yours lives.
You're done when
Your agent says it's running and gives you something to open — a http://localhost:… link, or a command. Click or run it, and the thing the sender built appears. If it's a website, leave the terminal open: closing it stops the app. [confirmed]
If it doesn't work
gitnot found / agent can't clone → the machine has no git yet. Tell your agent "install git for my OS first, then clone it." (git ships with Xcode tools on most Macs; Windows and many Linux setups need a one-time install.)[confirmed]- A private repo gives "404" or "permission denied" → you haven't been let in, or git isn't logged in as you. Accept the invite first (check your email / github.com/notifications), then connect the GitHub CLI so your agent clones as you.
[confirmed] - "Port already in use" /
EADDRINUSE→ something else is already using that port. Tell your agent "run it on a different port" — it'll pick a free one.[estimate — common Node/Python dev-server behaviour] - It installed but won't start — "missing key" / "connection refused" → the project needs a secret or a service (database, API key) you haven't supplied. Look for a
.env.exampleor a "Configuration" note in the README; ask the sender for the values. Your agent can scaffold the rest.[estimate] - It runs but the page is broken or empty → you may be opening the wrong URL, or it's still building. Ask your agent which URL to open and whether it finished compiling. Re-running rarely hurts.
- A ZIP they sent has files but won't run → a downloaded ZIP is a snapshot with no git history and sometimes no hidden config files. It can still run, but if it's missing pieces, ask for the repo link (or an invite) instead and clone that.
[confirmed — ZIP archives exclude history] - Anything else → hand the exact error text back to your agent ("here's what it printed — fix it"). Reading and fixing setup errors is what it's best at.
Prefer to do it by hand?
No agent, or you'd rather drive it yourself. Three steps: get the files, read the project's own instructions, run them.
1. Get the files
=== "Has git installed"
Open a terminal and copy the repo down. Replace the URL with yours:
```bash
git clone https://github.com/alice/their-project
cd their-project
```
Private repo? Clone with the [GitHub CLI](connect-the-github-cli.md) instead, which carries your login: `gh repo clone alice/their-project`. `[confirmed]`
=== "No git (just the ZIP)"
On the repo page, click the green **`<> Code`** button → **Download ZIP**, then unzip it. You get every source file — but **no version history**, and you can't send changes back this way. `[confirmed]`
Don't have git and want it? [git-scm.com/downloads](https://git-scm.com/downloads) has a one-click installer for every OS (macOS often already has it via Xcode tools). `[confirmed]`
2. Read the project's own instructions
Open the README in the folder. A good one names the exact setup: which toolchain, which install command, which run command. This is the source of truth — the steps below are only the common shape when the README is thin. [confirmed — READMEs conventionally hold setup/run steps]
3. Install and run
The install and start commands depend on what the project is built with. The usual pattern: install dependencies once, then run a start command. Common cases:
- A website / app (has a
package.json):npm install, thennpm run dev(ornpm start). Open thelocalhostURL it prints.[estimate — standard Node convention] - A Python tool (has
pyproject.tomlorrequirements.txt):uv run …orpip install -r requirements.txt, then run the entry script the README names.[estimate — standard Python convention] - Anything else → follow the README's commands verbatim. If there's no README, that's the moment the agent path above earns its keep.
Leave the terminal open while a web app runs; closing it shuts the app down.
Watch / read
- Best written walkthrough: GitHub's own Cloning a repository — the authoritative source for
git cloneandgh repo clone, with the exact commands this page uses. Running the project afterwards depends on the project, so its README is your second source of truth.[confirmed] - Video — clone: How to clone a GitHub Repository to your Local Machine — Coderama, ~2:16. Short and on the precise getting-the-files step. Caveat: couldn't pull its transcript to verify line-by-line from this environment (YouTube blocked the request 2026-06-07) — title and length match the task.
- Video — clone + install + run: GitHub for Beginners: Clone, Install, and Run Any Repository — Alphastack, ~3:44. Covers the whole arc on this page, not just cloning. Same caveat: transcript unverifiable here; judged on its on-task title and length.
Sources
- Cloning a repository (
git clone,gh repo clone) — checked 2026-06-07 - Downloading source-code archives (ZIP — no git history) — checked 2026-06-07
- Git downloads — installers for macOS / Windows / Linux — checked 2026-06-07