Skip to content

Advanced workflows with coding agents

Once you've mastered the basics of working with AI tools, standardized your agent behavior, and set up safe automation, you can explore more advanced workflows that leverage coding agents in specialized contexts. These patterns build on the foundations we've established, applying the same principles to specific use cases.

Working with specialized tools

Some tools have unique characteristics that require specific workflows when working with coding agents. Marimo notebooks, for example, have constraints that differ from traditional Jupyter notebooks, and coding agents need explicit guidance to work with them effectively.

At SciPy 2025, my friend Trevor Manz showed me a neat trick for writing Marimo notebooks. Apart from launching a Marimo notebook in sandbox mode, you add a --watch flag. When edits are made to the source file, they're reflected in the browser as well. This opened up a powerful workflow: AI coding assistants can write your Marimo notebooks for you, and you can see the changes in real-time.

This combines two powerful tools: AI coding assistants for rapid code generation, and Marimo notebooks, the modern alternative to Jupyter that offers better reproducibility and cleaner Python development. Together, they create a powerful combination for rapid prototyping and iterative coding in data science workflows. I explored how combining AI coding assistants with Marimo notebooks can supercharge your Python development and data science workflows in a blog post, but here's how to put it into practice.

Marimo's --watch flag

The workflow starts with the --watch flag. When you launch a Marimo notebook with this flag, any edits made to the source file are automatically reflected in the browser:

uvx marimo edit --sandbox my_notebook.py --watch

This means you can have an AI coding assistant write code directly in the notebook file, and see the results immediately in the browser without manually refreshing or reloading. It's a seamless development experience that enables rapid iteration.

Ensure code quality with marimo check

AI coding assistants can write your Marimo notebooks for you, but they're not always going to be correct the first time. After all, the latest features of Marimo are not going to be part of the large language model training sets.

Marimo ships with a check command that validates notebooks and catches syntax errors, duplicate variable definitions, and other Marimo-specific issues:

uvx marimo check my_notebook.py

I've found this particularly valuable when working with AI coding assistants, as they may not be familiar with all of Marimo's constraints. In my Llamabot project's AGENTS.md, I've documented this requirement explicitly. Here's what it says:

Notebooks: All notebooks in this repository are Marimo notebooks. When agents create or edit notebooks, they must run uvx marimo check <path/to/notebook.py> to validate the notebook and fix any issues raised by the check command. Always run uvx marimo check on notebooks before considering them complete - this catches critical errors like duplicate variable definitions and other Marimo-specific issues. CRITICAL: Fix ALL issues found by marimo check, including warnings. Do not leave any warnings unfixed.

This ensures that any Marimo notebook created or edited by an AI agent is validated before it's considered complete, preventing syntax errors and other issues from propagating.

This connects to the automation philosophy we discussed earlier. By documenting this requirement in AGENTS.md, the agent automatically validates notebooks without me having to remember to ask for it. It's automation that ensures code quality.

Advanced functionality using MCP and built-in AI features

It doesn't stop there, though. There's a new --mcp flag that makes a notebook an MCP server that coding agents can connect to. Marimo also has built-in AI editing capabilities itself as well. These features open up even more possibilities for integrating AI assistance directly into your Marimo workflow.

The combination of AI coding assistants with Marimo's reactive programming model creates a powerful development environment. You can have an agent write code in a Marimo notebook file, use the --watch flag to see changes in real-time, and validate the code with marimo check to ensure it follows Marimo's constraints. This workflow enables rapid iteration and prototyping while maintaining code quality.

Working across repositories

I used to assume that coding agents like Cursor, GitHub Copilot, and Claude Code only work within a single workspace. This mental model led me to workarounds like copying files, creating complex multi-root workspace configurations, or constantly switching between projects.

But coding agents can already read and write files from anywhere on your file system, not just the current workspace. The limitation wasn't in the tools; it was in my awareness of what they can do. You don't need to add folders to workspaces, create multi-root workspaces, or jump through configuration hoops. If you know where a repository lives on your disk, you can reference it directly. It's painfully obvious in hindsight, but I spent way too long working around a limitation that didn't actually exist. I wrote about how to leverage file system access for cross-repository code access in a blog post, but here's how it fits into your workflow.

How to reference code from other repositories

The key is being explicit about file paths. Modern AI coding assistants like Cursor, GitHub Copilot, and Claude Code can access your entire file system, not just the current workspace. You just need to tell them where to look.

I do most of my writing in an Obsidian vault, which isn't a Git repository; it's just a folder on disk. Sometimes I need to reference code from my LlamaBot repository, or other code repositories in which I am doing development. Instead of copying files or creating complex workspace configurations, I just tell the agent to read directly from the other directory.

When I need the agent to understand something from LlamaBot, I can say "read the implementation from ~/github/llamabot/llamabot/bot/simplebot.py" and it works immediately. The key is being explicit with the path. You can also search by filename within a directory: "find the notebook named pocketflow_testdrive.py in ~/github/llamabot". The agent reads the file directly from disk, no workspace configuration needed. You don't need to document paths anywhere; just reference them directly when you need them. That said, if you have commonly accessed paths, documenting them in AGENTS.md can be helpful for quick reference.

I used this method while writing about code implementations. I was drafting in my Obsidian vault, but the actual code examples lived in a Marimo notebook within the LlamaBot repository. Rather than copying code snippets or switching workspaces, I had the agent read directly from ~/github/llamabot to pull in the exact implementation details I needed. This let me write about the code while staying in my writing environment, with the agent able to reference the actual source files to ensure accuracy.

File system access for AI coding assistants enables this

Coding agents that have file system access can perform read and write operations anywhere they have permission. Tools like Cursor, GitHub Copilot, and Claude Code aren't restricted to the current workspace directory. This works because agents have access to shell tools, the most generic, text-based interface to computers. Shell commands produce text output that agents can read and understand, and they can execute commands anywhere on your system.

This means you can reference code from any repository on your machine, pull in documentation from other projects, compare implementations across different codebases, reference configuration files from related projects, and modify files across multiple repositories when needed. The only requirement is that you know the path and can tell the agent where to look.

Common scenarios

This capability opens up several useful workflows. When writing about code, you can reference implementation details from your repositories. The agent can read the actual code to ensure accuracy, pulling in exact examples without copying files or switching workspaces.

For architecture decisions, you can compare how similar problems are solved across different projects. The agent can read multiple implementations and help you understand trade-offs.

Before copying code, have the agent check if similar functionality exists elsewhere. It can read files from other repos to find existing solutions.

When working with a library you maintain, reference the library's source code directly. The agent can read implementation details to help you use it correctly.

You can also update related files across multiple repositories simultaneously. For example, update documentation in one repo while modifying the implementation in another, or sync configuration changes across related projects.

Step-by-step workflow for cross-repository code access

The key trick is being explicit with paths or explicit instructions about how to get to files. Here's how to do it.

For repositories you already have cloned locally, reference the absolute path directly when asking the agent: "read ~/github/llamabot/src/llamabot/bot/simple.py". Or search by filename within a directory: "find the notebook named pocketflow_testdrive.py in ~/github/llamabot". The agent reads the file immediately, no workspace configuration needed.

For repositories you don't have locally, tell the agent exactly how to get to the file: "clone the repo owner/repo into a temporary directory, then find the file at relative path path/to/file.py". You can also specify a specific commit, branch, or tag: "clone the repo owner/repo at commit abc123 into a temporary directory, then find the file at relative path path/to/file.py" or "clone the repo owner/repo and checkout branch feature-branch, then find the file at relative path path/to/file.py". The agent executes these commands using command line tools like gh CLI or git, reads what it needs, and can clean up the temporary clone when done.

No workspace management. No file copying. No complex configuration. Just explicit paths or explicit instructions. The agent needs clear direction on where to find files, whether that's an absolute path on your system or step-by-step instructions to clone and navigate to a file.

Practical considerations

You might wonder whether you need special workspace configuration to make this work. You don't. Unlike traditional IDE workspace configurations, there's no need to add folders to workspaces or create multi-root setups. Just reference paths directly when you need them.

Managing paths across many repositories is simpler than you might expect. I don't document them anywhere special; I just reference paths directly when asking the agent to read files. If you find yourself referencing the same paths repeatedly, you can optionally document them in AGENTS.md for convenience, but it's not required. You can also use MCP server prompts like /remember from my personal productivity MCP server to automatically capture frequently-used paths. The /remember prompt reviews your conversation, identifies important learnings like repository paths, and adds timestamped entries to AGENTS.md in the appropriate section.

One thing to be mindful of: agents can modify files in other repositories, not just read them. While this is powerful, it's easy to accidentally change files you didn't intend to modify. I recommend treating cross-repository access as read-only unless you specifically need to make changes elsewhere.

For repositories you don't have cloned locally, you can have the agent clone them temporarily. The agent can use gh CLI or git commands to clone repositories into temporary directories, read what it needs, and clean up afterward.

See this in action

These advanced workflows demonstrate how specialized tools and cross-repository patterns can be integrated into your AI-assisted workflow. The practices here connect to several core concepts.

Automation philosophy

The practice of documenting marimo check requirements in AGENTS.md connects to the Automation philosophy. By specifying validation requirements once, the agent automatically ensures code quality without repeated instructions. Cross-repository workflows eliminate the manual work of copying files, switching workspaces, or creating complex configurations. By leveraging the agent's file system access, you automate the process of referencing code across projects.

Single source of truth

AGENTS.md serves as the Single source of truth for notebook validation requirements and repository paths. Just as we consolidate configuration in pyproject.toml, AGENTS.md consolidates agent instructions for working with specialized tools and cross-repository access patterns.

Just-in-time adoption

These are specialized workflows that you can adopt when you need them. If you're working with Marimo notebooks and AI coding assistants, the --watch flag and marimo check validation create a powerful development environment. But you don't need to set this up until you're actually using Marimo notebooks in your workflow.

Similarly, cross-repository code access is a capability you can use when you need it. You don't need to set up anything special; just reference paths directly when you need to access code from other repositories. Start simple, and add path documentation to AGENTS.md only if you find yourself referencing the same paths repeatedly.

Thanks to shell tools, coding agents like Cursor, GitHub Copilot, and Claude Code aren't limited by workspace boundaries. They can access your entire file system for both reading and writing, so you can build workflows that span multiple projects without complex tooling.

The simplicity is the point. You don't need special workspace configurations or multi-root setups. You just need to know where things live and tell the agent where to look. Reference paths directly, or have the agent clone repositories temporarily when needed.

When you need to reference code from another repository, the agent can read it directly. Just point it to the path. This technique works with any AI coding assistant that has file system access, making it a universal solution for cross-repository code access.