Switching between AI coding assistants usually means re-explaining your project, pasting files back and forth, and hoping the new tool “gets” what you were doing. This guide shows you a practical, tool-agnostic workflow to carry your project’s context — architecture, decisions, current task, and conventions — from one agent to another in minutes, not hours. You’ll learn how to build a portable context bundle that any coding agent can read, and how to restore it so the new agent starts productive, not from scratch.
What You’ll Need
- Access to the source code repository (local or remote).
- A text editor or IDE (VS Code, JetBrains, etc.) to create and edit files.
- The command line (Terminal, PowerShell) for running a few commands.
- Optional: a tool like
tree(Unix) ortree /f(Windows) to generate a file listing, or you can use your IDE’s file explorer. - No special plugins or paid tools required — this works with any coding agent (GitHub Copilot, Cursor, Claude Code, Codeium, etc.).
Step-by-Step
- Create a dedicated context folder. In your project root, create a folder named
.agent-context(or similar). This keeps all context files in one place and can be easily excluded from version control if you prefer. - Write a project brief. Inside that folder, create a file named
PROJECT.md. In 10–15 bullet points, describe: what the project does, its main tech stack (languages, frameworks, key libraries), the overall architecture (e.g., “React frontend, Node/Express backend, PostgreSQL database”), and any critical design patterns (e.g., “uses Redux for state management”, “API routes follow REST conventions”). Be specific but concise — this is the elevator pitch for the new agent. - Document the current task. Create
TASK.mdin the same folder. Write down: what you’re currently working on, the goal of the task, what’s already been done, what’s left to do, and any specific constraints or requirements (e.g., “must support dark mode”, “performance budget under 200ms”). If you have a ticket or issue number, include it. This file is the most important one for continuity. - List key decisions and conventions. Create
DECISIONS.md. Record important architectural choices and why they were made (e.g., “we chose MongoDB over Postgres because of flexible schema”). Also note coding conventions: naming styles, file organization, error handling patterns, testing practices. If you have a style guide or linting rules, mention where they live. - Generate a file tree. Run
tree -L 3 -I node_modules(ortree /f /aon Windows) and save the output to.agent-context/FILETREE.txt. This gives the new agent a map of your project structure without having to explore everything. If you can’t usetree, just copy the folder structure from your IDE’s explorer. - Include key file snippets (optional but helpful). If there are specific files that define the project’s core logic or configuration, copy their paths or a few key excerpts into
KEYFILES.md. For example, the main server file, database schema, or a complex utility module. Don’t paste entire files — just the essential parts. - Commit or export the context folder. If you use version control, commit the
.agent-contextfolder (or push it to a branch). If not, compress it into a ZIP file and store it somewhere accessible (e.g., cloud storage, a USB drive). This is your portable context bundle. - When switching agents, import the context. Open your new coding agent and provide it with the context files. Most agents allow you to attach files or paste text. Give it the PROJECT.md, TASK.md, DECISIONS.md, and FILETREE.txt. If the agent supports a project-level memory or instructions file (like
CLAUDE.mdfor Claude Code or.cursorrulesfor Cursor), copy the contents of your context files into that file. - Start with a clear prompt. After providing the context, give the new agent a concise instruction like: “Read the files in .agent-context. I’m working on [task]. Based on the context, what’s your understanding of the project and the next step?” This forces the agent to process the context before acting.
- Verify and refine. Ask the agent to summarize the project and task back to you. If anything is missing or misunderstood, update your context files and re-import. Once the agent demonstrates accurate understanding, you can proceed with your work.
Common Mistakes
- Not updating context files regularly. If you only create them once, they become stale. Update TASK.md and DECISIONS.md as you make progress or change direction.
- Including too much or too little detail. A 50-page document will overwhelm the agent; a single line won’t help. Aim for concise, high-signal information.
- Forgetting to exclude sensitive data. Never put API keys, passwords, or personal data in context files. Use environment variables or secret management instead.
- Assuming the new agent knows your conventions. Even if you think they’re obvious, spell them out. “We use tabs for indentation” is better than hoping.
- Not verifying the agent’s understanding. Jumping straight into a task without checking comprehension leads to wasted effort. Always ask for a summary first.
- Storing context in a single file that’s hard to edit. Keep separate files for different aspects (project, task, decisions) so you can update one without rewriting everything.
Tips
- Use a standard format. Write context files in Markdown with clear headings and bullet points. Most agents parse Markdown well.
- Keep a template. Create a blank template of your context files so you can quickly start a new project with the same structure.
- Automate the file tree. Add a script to your project that generates the file tree automatically, so you don’t have to remember the command.
- Leverage agent-specific memory files. Many agents support a persistent memory file (like
AGENTS.mdorCLAUDE.md). Put your most stable context there — project overview and conventions — and keep task-specific info in a separate file you update often. - Review context before switching. Spend 5 minutes updating the context files right before you switch. It’s much easier to do it while the details are fresh.
- Use version control for context. If your context files are in git, you can see how the project evolved and roll back if needed.
Troubleshooting
- The new agent seems confused or ignores the context. First, make sure you actually provided the files — some agents require you to explicitly attach or reference them. If you did, try rephrasing your prompt to be more direct, like “Use the information in .agent-context/PROJECT.md to answer.” If it still fails, the context might be too vague. Add more specific details or examples.
- Context files are too large to paste. Break them into smaller, focused files. Instead of one massive DECISIONS.md, split it into ARCHITECTURE.md and CONVENTIONS.md. Or, provide only the most relevant parts for the current task.
- The agent asks for information you didn’t include. That’s a sign your context is incomplete. Add a section for “Open Questions” in TASK.md and fill it as you go. When the agent asks, update the file and re-import.
- You lost the context folder. If you committed it to version control, you can restore from the last commit. If not, you’ll need to recreate it from memory — which is why it’s a good practice to keep it in git.
- The agent gives answers that don’t match your codebase. Double-check that the file tree is up-to-date. If you’ve added or renamed files since generating it, the agent may be working with an outdated map. Regenerate the tree.
- Switching between agents with different context formats. Some agents use a specific file (like
.cursorrulesvsCLAUDE.md). Instead of maintaining multiple copies, keep your master context in the.agent-contextfolder and copy the relevant parts into the agent’s preferred file when you switch. Or, use a tool like a pre-commit hook to auto-generate them.
Frequently Asked Questions
Do I need to do this every time I switch agents?
No, only when you switch to a different agent that doesn’t have the context. If you switch back and forth, you can maintain separate context files for each agent, but it’s simpler to keep one canonical set and copy it as needed.
Can I use this method for switching between local and cloud agents?
Yes, the context files are plain text, so they work anywhere. Just make sure you have access to the files (e.g., push to a remote repo or download from cloud storage).
What if I’m using an agent that doesn’t support file attachments?
You can paste the content directly into the chat. For long contexts, paste the most critical parts first, then mention that more details are available if needed. Some agents have a character limit, so you may need to be selective.
How often should I update the context files?
At minimum, update TASK.md whenever you finish a significant milestone or change direction. Update DECISIONS.md when you make a new architectural choice. The project overview (PROJECT.md) changes less frequently, but review it periodically.
Is it safe to include code snippets in context files?
Yes, but only include code that isn’t proprietary or sensitive. If you’re working on a commercial project, be cautious about copying large chunks of code. Instead, describe the logic or include minimal examples.
Can I automate the context generation?
Partially. You can write a script that generates the file tree and maybe extracts key metadata from your package.json or README. But the narrative parts — task description, decisions — require human input. You could use an AI to help draft them, but you’ll still need to review.
Related
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.
More cards in this drawer
- Google Assistant IFTTT Recipes: 7 Useful Automations
- OLED TVs in Dark Rooms: Why They Look Better and When They Don’t
- Philips DST7060/20 7000 Series Iron: Specs & Fit
- Coal Fueled Jet Aircraft: Could It Work?675 L
- Remote Desktop on Raspberry Pi: How to Enable It
- Word Select Last Line in Paragraph?