Welcome to vibe coding.
Before asking an agent to write, refactor, or review code, prepare the environment.
Without that, you add noise. You lose history. You mix tools. You leave important decisions hidden in loose chat windows.
This guide covers the initial setup for working with VS Code, Codex, and GitHub on Windows or macOS.
1. Understand Codex access
Codex is OpenAI’s coding agent. It can work through the app, the CLI, the IDE extension, and the web.
Today, the most direct way to start is to sign in to a Codex client with your ChatGPT account. Usage is available through eligible ChatGPT plans, with limits that vary by plan.
API usage also exists for specific technical workflows, automations, and organizations that prefer to provision keys manually.
Before configuring your environment, check the current documentation:
If you choose to use an API key:
- Open the OpenAI developer platform.
- Create an account or sign in.
- Configure billing in
Settings > Billing. - Create a key in
API Keys. - Store the key safely. It should never be committed to the repository.
2. Install VS Code
Visual Studio Code will be the base workspace.
You can download it from the official website or install it from the terminal.
On Windows, using PowerShell:
winget install -e --id Microsoft.VisualStudioCode
On macOS, using Homebrew:
brew install --cask visual-studio-code
After installing it, open VS Code and confirm that the integrated terminal works.
3. Reduce conflict between assistants
If you already use GitHub Copilot or another assistant, decide which tool will lead the session.
For vibe coding, it is better to avoid two agents competing in the same workspace. Aggressive autocomplete, duplicated shortcuts, and constant suggestions can make it harder to read what the main agent is doing.
You do not need to remove everything forever. But during a Codex session, it is worth pausing or disabling competing extensions.
In VS Code:
- Open
Extensions. - Search for
GitHub Copilotor another AI extension. - Click
Disablefor the workspace or disable it temporarily.
The goal is simple: one session, one director, one main agent.
4. Install and authenticate Codex
Choose the Codex client that best fits your workflow:
- Codex CLI;
- Codex extension for VS Code;
- Codex app;
- Codex on the web.
To start with the CLI, install the official package:
npm install -g @openai/codex
Then sign in:
codex
or, when applicable:
codex --login
Follow the authentication flow shown in the terminal.
If you are using the VS Code extension, install it from the extensions panel, open the Codex panel, and follow the sign-in instructions. Prefer ChatGPT sign-in when available. Use an API key only when that is the workflow you chose.
5. Configure Git and GitHub
Vibe coding without Git becomes short memory.
Before asking for real changes, configure your identity:
git config --global user.name "Your Full Name"
git config --global user.email "you@example.com"
Then, inside the project folder:
git init
git status
If the project is not on GitHub yet, use the VS Code Source Control panel or the GitHub CLI to publish the repository.
With GitHub CLI:
gh auth login
gh repo create repository-name --private --source=. --remote=origin --push
Make small commits. Each step should be understandable.
6. Create the project direction files
The agent needs persistent context.
Create at least:
AGENTS.md
README.md
PLANS.md
docs/
Use AGENTS.md for working rules.
Use README.md to explain the project.
Use PLANS.md to organize small steps.
Use docs/ to record decisions, risks, and conventions.
A useful first prompt:
Read AGENTS.md, README.md, and PLANS.md.
Understand the goal of the project.
Do not implement anything yet.
List risks, open questions, and a first small implementation step.
7. Understand the difference between chat and agent
Much frustration comes from treating different tools as if they were the same.
| Chat | Codex integrated into the environment |
|---|---|
| Answers questions and suggests snippets. | Reads files, understands structure, and can edit the project. |
| You copy, paste, and decide where things fit. | The agent navigates the repository and proposes concrete changes. |
| Works well for explanation and exploration. | Works well for implementation, review, and validation. |
| Depends heavily on the context you paste. | Uses the local workspace context within authorized limits. |
Chat helps you think.
The agent helps you execute.
Both are useful. But they do not do the same job.
8. Start with a small cycle
After setup, do not ask for the whole system.
Ask for one step:
Read AGENTS.md and PLANS.md.
Implement only the first step.
Before editing, say which files you intend to change.
Then run the available validations and update the necessary documentation.
That is the correct start.
Environment ready. History protected. Agent with context. Human still directing.
Welcome to vibe coding.