ChatGPT Projects and GitHub: Connecting Repository Context
To give a ChatGPT Project repository context, you supply code and files in a way that ChatGPT can read. Here is how to do it, how to verify freshness, and how to keep the decisions and lessons that repository files alone do not capture.
Updated 6 min read
Connecting a GitHub repository to a ChatGPT Project means making the code, documentation and configuration files available as context when you ask ChatGPT questions about the project. There is no single "connect repository" button; you supply the context through files, a GitHub connector, or by pasting relevant content directly.
The practical challenge is freshness: code changes constantly, and any context you supply is a snapshot of one moment. Tools like fenbs address the side of a software project that code files do not capture—the decisions, the lessons from past work, and where the current session should continue.
Ways to supply repository context to a ChatGPT Project
The most reliable option depends on how much context you need and how often the code changes. For a small or slow-moving project, uploading key files to the project's knowledge base works well. For an active codebase, you need a method that refreshes regularly.
| Approach | Best for | What to watch |
|---|---|---|
| Upload files to project knowledge | Stable files: README, architecture docs, conventions, API contracts | Files do not update automatically; re-upload after significant changes |
| Paste content into instructions | Short, critical context that rarely changes: a list of conventions, a schema definition | Instructions have a length limit; keep to the most essential content |
| GitHub connector (where available) | Active repositories where ChatGPT Work supports a GitHub connection | Verify the connector's read permissions and which files it indexes |
| Export selected files and upload | Specific files from a large repo without uploading the whole thing | Manual process; plan how often you will refresh the uploaded versions |
Before building a workflow around the GitHub connector, check ChatGPT's current documentation for which plans support it and what it can actually read. Connectors in ChatGPT Work are being updated alongside the platform's broader changes.
What to include and what to leave out
A full repository export is usually too large and too noisy. ChatGPT has a context window limit; filling it with lock files, generated code, or test fixtures crowds out the content you actually want to reference.
A practical starting set for a software project might include: the README, the architecture or design document, the API contract or schema, a list of coding conventions, and any runbooks or setup guides. Leave out generated files, dependency directories, and large binary assets.
- README and architecture docs: high value, changes slowly, worth uploading.
- API contracts and schemas: essential context for anyone working on the project.
- Coding conventions and style guides: rules that should apply across every session.
- Lock files (package-lock.json, yarn.lock, etc.): omit; they are machine-generated and add noise.
- Generated build output: omit; it is derived from the source.
- Source code for active features: paste the relevant file when you need it rather than uploading everything.
Checking freshness before you rely on it
Code changes faster than context documents. A schema you uploaded last week may not match the schema that was merged this morning. Before asking ChatGPT to make decisions based on a project file, confirm the version it has matches what is in the repository.
One practical approach: at the start of a session, ask ChatGPT to describe the current schema or architecture. Compare the answer to the live code. If there is a mismatch, re-upload the relevant file before continuing. This is an extra step, but it prevents the project from drifting in a direction based on outdated information.
For the project's best-practices guide, see ChatGPT projects best practices for a broader look at what makes a well-maintained project.
What repository files do not capture
Even a complete and current export of a repository does not tell an assistant why a particular decision was made, what was tried and rejected, or where the current session should pick up. Code is the result of decisions, not the record of them.
Say a team decided to switch from a REST API to a GraphQL schema after a performance review. The schema file shows the current state; it does not explain the reasoning, what the migration plan is, or what risks were identified. That context belongs in a decisions and lessons record.
Keep the decisions and lessons repository files do not hold
fenbs stores the decisions, lessons and current progress that the code itself does not record. Connect a supported assistant via MCP from Integrations, and it reads the project context—Rules, Where we left off, lessons from past work—alongside whatever repository files you supply. The code explains what was built; fenbs explains why and where to continue.
Create a free accountFree for one person · No credit card · Works with Claude, ChatGPT, Cursor and more
Lessons from previous sessions
When an assistant finds a subtle bug, runs into an unexpected dependency conflict, or discovers that a particular approach causes test failures, that lesson is worth preserving. Repository files may capture the fix but not the backstory.
A lessons record in a work tool gives future sessions the benefit of past mistakes without anyone having to remember to mention it. Something like "every time we changed the auth middleware, it broke the test fixture for the payment flow" is the kind of lesson that prevents repeated debugging sessions.
How to do this with fenbs
- Create a free account and add the software project to your fenbs board. List the active tasks and write the architectural decisions and conventions in Decisions and rules.
- Upload the stable documentation files—README, architecture doc, API contract—to the ChatGPT Project knowledge base.
- After any session where something significant was learned, add a lesson to fenbs: what happened, what was learned, and what to do differently.
- Connect ChatGPT to fenbs via MCP by following the developer-mode setup at Integrations. At the start of each session, ChatGPT reads the fenbs context alongside the project files.
- When a code file changes significantly, update the version in the ChatGPT Project knowledge base so the context stays current.