The Ultimate Guide: Setting Up Codebase for Claude Code and GitHub Copilot

The Ultimate Guide: Setting Up Codebase for Claude Code and GitHub Copilot

5 min readEstimated reading time: 5 minutes

How to Master Setting Up Codebase for Claude Code and GitHub Copilot 🚀

Picture this: It's Monday morning. Your design team has fully embraced Claude Code to rapidly prototype UI components, while your hardcore backend engineers are tightly gripping their GitHub Copilot subscriptions in their editors.

Everyone is happy, right? Wrong.

As the tech lead, you’re suddenly managing an AI civil war. Every time your project’s architecture changes, you find yourself manually duplicating prompts and context across different ecosystems. You've violated the golden rule of programming: Don't Repeat Yourself (DRY).

But dry those YAML-induced tears, my friend. What if I told you there is a magical, unified way to handle this? By the end of this tutorial, you’ll be an absolute master at setting up code base for both claude code and github copilot at the same time, allowing both AI assistants to read from the exact same playbook.

Let’s dive into the ultimate cross-pollination of AI productivity.


🛠️ Prerequisites and Environment Setup

Before we unleash the AI singularity on your repository, let’s make sure you have your tools ready. You will need:

  • Vs Code with the GitHub Copilot active and logged in with your GitHub account.
  • Claude Code installed and logged in with your Anthropic account.
  • A cup of coffee (or your caffeinated beverage of choice) ☕.

🧠 Why Unifying Your AI Setup Matters

In the fast-evolving landscape of AI-assisted development, context is king. A recent development in the AI space is the heavy reliance on repository-level context files. If your AI doesn't know how your team writes code, it will just guess—usually resulting in outdated syntax, wrong architectural patterns, or code that fails your CI pipelines.

When you maintain two separate AI configurations, drift is inevitable. One AI learns about your new state-management rules, while the other keeps hallucinating the old boilerplate.

By unifying your configuration, you achieve:

  1. Zero Drift: One source of truth for all AI agents.
  2. Faster Onboarding: New developers pull the repo, and their AI of choice is instantly configured perfectly.
  3. Modern Capabilities: You can share complex hooks and tools across ecosystems, leaving older, clunky prompt methods behind.

Let’s look at exactly how to build this shared brain.


🏗️ Step 1: The "Claude-First" File Tree Architecture

The secret sauce to this whole operation is adopting a Claude-first directory structure. GitHub Copilot is incredibly flexible and can natively read Claude’s configuration files. So, we will build our AI context using Claude's standards, and then invite Copilot to the party.

Create the following file tree at the root of your project:

.
├──  CLAUDE.md
├── .claude/
│   ├──  settings.json (settings have hooks defined as well)
│   ├──  skills/
│   └──  rules/
└──  .mcp.json

Let’s break down what these files actually do:

  • CLAUDE.md: This is your AI's entry point. Think of it as the README.md but written specifically for a large language model. It should contain high-level architectural decisions, tech stack details, and core philosophies.
  • .claude/settings.json: The central nervous system. This is where you define agent lifecycle hooks—giving the AI explicit instructions on how to behave during specific events (e.g., what to trigger after a file is created or before a command is run). Note: These are agent-specific hooks, not your standard git pre-commit hooks!
  • .claude/skills/: A folder containing custom prompts and workflows with scripts or API calls that the AI can execute to gather more context.
  • .claude/rules/: Bite-sized, specific markdown files governing distinct parts of your codebase. If you are coming from the GitHub Copilot world, these are the exact equivalent to Copilot instructions.
  • .mcp.json: The Model Context Protocol configuration. This recent development allows your AI to securely connect to external local tools, databases, and APIs.

💡 The Death of Obsolete Prompts: If you are still relying on old-school Claude slash commands or GitHub Copilot's prompt.md files, it's time to let them go. They are mostly obsolete now! Instead, you should rely entirely on modern Agent Skills (.claude/skills/) to trigger complex, dynamic workflows.


🔌 Step 2: Bridging the Gap with VS Code Settings

Now that our Claude files are beautifully structured, it’s time to tell GitHub Copilot to stop looking for its own proprietary files and start reading the .claude directory.

This is where the magic happens. Open your editor's workspace settings (.vscode/settings.json) and drop in this exact configuration:

{
  "chat.agentSkillsLocations": {
    ".claude/skills": true
  },
  "chat.useClaudeHooks": true,
  "chat.useClaudeMdFile": true,
  "chat.instructionsFilesLocations": {
    ".claude/rules": true
  }
}

Let’s demystify this configuration:

  • "chat.agentSkillsLocations": Copilot typically looks for its own skills directory. By mapping this to ".claude/skills": true, you are granting Copilot access to the exact same custom executable skills you built for Claude.
  • "chat.useClaudeHooks": This tells Copilot to respect the agent lifecycle hooks defined in your .claude/settings.json.
  • "chat.useClaudeMdFile": The absolute game-changer. GitHub Copilot will ingest your CLAUDE.md file as its primary system prompt, giving it complete awareness of your project’s architecture.
  • "chat.instructionsFilesLocations": This maps Copilot's contextual knowledge base directly into your .claude/rules folder, treating them exactly like native Copilot instructions.

Boom. 💥 You just achieved AI harmony. Both tools are now feeding off the same high-quality data.


🎯 Step 3: Enforcing AI Best Practices

Just pointing GitHub Copilot to Claude’s files isn't enough; the content inside those files needs to be optimized for modern LLMs. Based on official best practices, here is how you should format your shared knowledge base:

  1. Keep it modular: Don't write a 5,000-word CLAUDE.md file. Keep CLAUDE.md brief and put specific technical instructions into .claude/rules/. Retrieving small, relevant rule files is much more efficient for the AI's context window.
  2. Provide "Good vs. Bad" Examples: When writing rules (like api-rules.md), don't just state what to do; show it using standard markdown code blocks. Showing an anti-pattern next to the desired pattern drastically reduces AI hallucinations.
  3. Leverage MCP: The .mcp.json file is your best friend. Use the Model Context Protocol to give both Claude and Copilot read-only access to your local dev database schema. This prevents the AI from guessing column names and writing broken queries! There are many other MCPs with different capabilities, so explore the ecosystem to see what fits your project.

🚑 Common Issues and Troubleshooting

Even with the perfect setup, the AI gods can sometimes be fickle. Here are a few common hiccups and how to fix them:

Issue: GitHub Copilot is completely ignoring my CLAUDE.md file.

  • Solution: Double-check your settings configuration. Ensure "chat.useClaudeMdFile": true is set at the Workspace level, not just your User settings. Also, ensure CLAUDE.md is in the absolute root of your project.

Issue: Agent Skills from .claude/skills are failing to execute.

  • Solution: Check your file permissions! If you wrote a bash script for a skill, ensure it is actually executable (chmod +x .claude/skills/my-skill.sh).

Issue: The AI is getting confused by contradictory rules.

  • Solution: Audit your .claude/rules directory. If you have a rule saying "Use standard CSS" and another saying "Use Tailwind," both Copilot and Claude will get confused. Keep your rules mutually exclusive and highly opinionated.

🎁 Conclusion

The era of maintaining duplicate AI context files is officially over. By leveraging the cross-compatibility of modern AI tools, you can dramatically reduce your administrative overhead while supercharging your team's development speed.

I’ve covered the core directory structure, the magical workspace settings bridge, and the some basic best practices for keeping your AI agents smart, context-aware, and perfectly aligned with your team's coding standards. Setting up code base for both claude code and github copilot at the same time is no longer a headache, it’s a massive competitive advantage.

💡 Let's Keep Building Together!

Did this unified setup save your team from an AI context nightmare? Keep following the blog for more content like this! I regularly dive into modern developer workflows, AI pair programming strategies, and architectural best practices. Share this guide with your team, and let’s make AI-assisted development a seamless experience for everyone.

If you have questions, run into edge cases, or just want to chat about AI tooling setup, feel free to contact me directly through the site. Happy coding! 🚀

Share this article