<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: intoffset</title>
    <description>The latest articles on DEV Community by intoffset (@intoffset).</description>
    <link>https://dev.to/intoffset</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3892989%2Fd32230a4-58df-4059-9131-dd2cb9b6e218.png</url>
      <title>DEV Community: intoffset</title>
      <link>https://dev.to/intoffset</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/intoffset"/>
    <language>en</language>
    <item>
      <title>How I Use ~/Agents as a Safe Workspace for Claude Code and Codex</title>
      <dc:creator>intoffset</dc:creator>
      <pubDate>Wed, 22 Apr 2026 19:09:19 +0000</pubDate>
      <link>https://dev.to/intoffset/how-i-use-agents-as-a-safe-workspace-for-claude-code-and-codex-156e</link>
      <guid>https://dev.to/intoffset/how-i-use-agents-as-a-safe-workspace-for-claude-code-and-codex-156e</guid>
      <description>&lt;h2&gt;
  
  
  The problem
&lt;/h2&gt;

&lt;p&gt;The more I used Claude Code and Codex, the more I realized I needed a clearer boundary between real projects, temporary clones, and experiments.&lt;/p&gt;

&lt;p&gt;Sometimes the problem was not the agent. It was my filesystem.&lt;/p&gt;

&lt;p&gt;I was asking agents to work across real projects, temporary clones, half-finished playgrounds, and writing notes without giving them a clear place to start.&lt;/p&gt;

&lt;p&gt;That made every task slightly more fragile.&lt;/p&gt;

&lt;p&gt;Was this repository safe to edit? Was that clone only for reference? Should the agent create a reproduction inside the product repo, or somewhere else? Was this note supposed to be committed?&lt;/p&gt;

&lt;p&gt;So I created a dedicated workspace: &lt;code&gt;~/Agents&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;It is not a framework or a tool. It is a filesystem boundary that tells both me and the agent what is safe to touch, what is reference-only, and where experiments should go.&lt;/p&gt;

&lt;p&gt;This article describes the layout I use for that workspace.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why create a dedicated workspace?
&lt;/h2&gt;

&lt;p&gt;Agent-assisted development often does not fit neatly inside a single project.&lt;/p&gt;

&lt;p&gt;In a normal week, you may ask an agent to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;compare multiple Git repositories&lt;/li&gt;
&lt;li&gt;clone an external project and inspect its implementation&lt;/li&gt;
&lt;li&gt;build a small playground to test a library&lt;/li&gt;
&lt;li&gt;keep research notes while writing an article&lt;/li&gt;
&lt;li&gt;prototype something without touching a production repository&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Putting all of that inside &lt;code&gt;~/src&lt;/code&gt; or &lt;code&gt;~/work&lt;/code&gt; can get messy fast.&lt;/p&gt;

&lt;p&gt;The problem is not only visual clutter. The bigger issue is losing track of what is safe to touch.&lt;/p&gt;

&lt;p&gt;Is this directory a long-lived project? Is it a temporary clone? Can an agent edit it? Is it reference-only? Is this file supposed to be committed, or is it just scratch work?&lt;/p&gt;

&lt;p&gt;Humans can often infer that from memory. Agents need more explicit boundaries.&lt;/p&gt;

&lt;p&gt;That is why I keep agent-related work under &lt;code&gt;~/Agents&lt;/code&gt;. It gives me a simple way to say:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;This is the workspace. These are the projects. This one is read-only. Put the experiment over there. Write the notes here.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  What belongs in &lt;code&gt;~/Agents&lt;/code&gt;?
&lt;/h2&gt;

&lt;p&gt;In my setup, &lt;code&gt;~/Agents&lt;/code&gt; has four main responsibilities:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;group multiple independent Git repositories&lt;/li&gt;
&lt;li&gt;host playgrounds and experiments&lt;/li&gt;
&lt;li&gt;keep external clones and investigation notes nearby&lt;/li&gt;
&lt;li&gt;define a clear working area for AI agents&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The important point is that &lt;code&gt;~/Agents&lt;/code&gt; itself is not a giant monorepo.&lt;/p&gt;

&lt;p&gt;It is closer to a workspace root. The projects inside it remain independent. The root only contains shared policies and configuration that help agents operate consistently.&lt;/p&gt;

&lt;p&gt;That distinction matters. A monorepo implies shared ownership, shared tooling, and shared change management. This workspace is different: it groups related working contexts without pretending they are one software project.&lt;/p&gt;

&lt;h2&gt;
  
  
  Basic root layout
&lt;/h2&gt;

&lt;p&gt;A minimal root layout looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;~/Agents/
|-- AGENTS.md
|-- CLAUDE.md
|-- .gitignore
|-- .mcp.json
|-- .agents/
|   `-- skills/
|-- .claude/
|   |-- settings.json
|   |-- settings.local.json
|   `-- skills/
|-- .codex/
|   `-- config.toml
`-- ...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The names of your actual work repositories do not matter as much as the role of the root files.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;AGENTS.md&lt;/code&gt;: workspace-level operating rules for AI agents&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;CLAUDE.md&lt;/code&gt;: Claude Code compatibility entry point, usually a symlink to &lt;code&gt;AGENTS.md&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;.gitignore&lt;/code&gt;: a whitelist-style ignore file for the root repository&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;.mcp.json&lt;/code&gt;: MCP server configuration for Claude Code&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;.agents/skills/&lt;/code&gt;: the canonical location for shared skills&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;.claude/settings.json&lt;/code&gt;: Claude Code permissions and allowed commands&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;.claude/settings.local.json&lt;/code&gt;: machine-specific Claude Code settings, not committed&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;.claude/skills&lt;/code&gt;: Claude Code skill path, usually a symlink&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;.codex/config.toml&lt;/code&gt;: Codex configuration&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This root is mostly about coordination. Actual implementation work belongs in the projects under it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Keep projects as independent repositories
&lt;/h2&gt;

&lt;p&gt;The root of &lt;code&gt;~/Agents&lt;/code&gt; is for shared configuration. Projects, prototypes, external clones, and writing work live under it as separate directories.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;~/Agents/
|-- AGENTS.md
|-- CLAUDE.md
|-- .gitignore
|-- .mcp.json
|-- .agents/
|-- .claude/
|-- .codex/
|-- product-app/          # Long-lived product work
|-- playground-sdk/       # SDK or library experiments
|-- playground-browser/   # Browser automation experiments
|-- fork-library/         # External repository investigation
|-- docs-writing/         # Articles and documentation drafts
`-- research-notes/       # Notes from investigation work
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The naming convention does not need to be strict. The useful part is separating different kinds of work instead of pushing everything into one vague directory.&lt;/p&gt;

&lt;p&gt;With this structure, you can give an agent instructions like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Treat fork-library as reference-only.
Create the smallest reproduction in playground-sdk.
Write the investigation notes in docs-writing.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That instruction is much easier to follow when the filesystem already reflects the distinction.&lt;/p&gt;

&lt;p&gt;It also prevents experimental code from leaking into an existing project just because that project happened to be the current working directory.&lt;/p&gt;

&lt;h2&gt;
  
  
  Put workspace policy in &lt;code&gt;AGENTS.md&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;At the root, I prefer to start with workspace policy before tool-specific configuration.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;AGENTS.md&lt;/code&gt; should explain things like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;this directory contains multiple independent projects&lt;/li&gt;
&lt;li&gt;each subdirectory should be treated as its own working unit&lt;/li&gt;
&lt;li&gt;some directories may be reference-only&lt;/li&gt;
&lt;li&gt;exploratory reading is generally allowed&lt;/li&gt;
&lt;li&gt;edits should stay within the project or directory named in the task&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For example, a minimal root &lt;code&gt;AGENTS.md&lt;/code&gt; might look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gh"&gt;# Workspace rules&lt;/span&gt;

This directory contains multiple independent projects. Each subdirectory is a self-contained project.
&lt;span class="p"&gt;
-&lt;/span&gt; Treat each subdirectory as its own working unit.
&lt;span class="p"&gt;-&lt;/span&gt; Do not edit external clones unless explicitly asked.
&lt;span class="p"&gt;-&lt;/span&gt; Put experiments in &lt;span class="sb"&gt;`playground-*`&lt;/span&gt; directories.
&lt;span class="p"&gt;-&lt;/span&gt; Keep project-specific commands inside each project.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This file is not where I put detailed build commands for every project. Those belong inside each project.&lt;/p&gt;

&lt;p&gt;The root &lt;code&gt;AGENTS.md&lt;/code&gt; is more like the constitution of the workspace. It tells the agent how to think about the directory tree before it starts editing files.&lt;/p&gt;

&lt;p&gt;This follows the same idea as the &lt;a href="https://agents.md/" rel="noopener noreferrer"&gt;AGENTS.md convention&lt;/a&gt;: give coding agents a predictable, dedicated place to find project-specific instructions. README files are for humans; &lt;code&gt;AGENTS.md&lt;/code&gt; is where I put the extra operating context an agent needs before it starts editing files.&lt;/p&gt;

&lt;h2&gt;
  
  
  Use a whitelist-style &lt;code&gt;.gitignore&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;Because &lt;code&gt;~/Agents&lt;/code&gt; contains many repositories and temporary directories, tracking everything from the root repository would be a mistake.&lt;/p&gt;

&lt;p&gt;I prefer the opposite approach: ignore everything by default, then explicitly allow only the shared root configuration.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Ignore everything by default
*

# Root-level workspace policy
!.gitignore
!AGENTS.md
!CLAUDE.md
!.mcp.json
!skills-lock.json

# Agent settings
!.claude/
!.claude/settings.json
!.claude/skills
!.codex/
!.codex/config.toml

# Shared skills
!.agents/
!.agents/skills/
!.agents/skills/**
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With this setup, you can add more clones, playgrounds, and scratch directories without accidentally committing them from the root repository.&lt;/p&gt;

&lt;p&gt;The root repository only tracks the files that define how the workspace is operated.&lt;/p&gt;

&lt;h2&gt;
  
  
  Using Claude Code and Codex together
&lt;/h2&gt;

&lt;p&gt;I use both Claude Code and Codex, so I try to keep the conceptual model shared even when the actual configuration files differ.&lt;/p&gt;

&lt;h3&gt;
  
  
  Put shared rules in &lt;code&gt;AGENTS.md&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;For Claude Code compatibility, &lt;code&gt;CLAUDE.md&lt;/code&gt; can be a symbolic link to &lt;code&gt;AGENTS.md&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;CLAUDE.md -&amp;gt; AGENTS.md
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Codex can use &lt;code&gt;.codex/config.toml&lt;/code&gt;, while Claude Code can use &lt;code&gt;.claude/settings.json&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Those files are tool-specific. The workspace rules are not. Keeping the shared rules in &lt;code&gt;AGENTS.md&lt;/code&gt; avoids maintaining two separate explanations of the same workspace.&lt;/p&gt;

&lt;h3&gt;
  
  
  Make &lt;code&gt;.agents/skills/&lt;/code&gt; the canonical skills directory
&lt;/h3&gt;

&lt;p&gt;For shared skills, I use &lt;code&gt;.agents/skills/&lt;/code&gt; as the canonical location.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx skills add &amp;lt;github-url&amp;gt; &lt;span class="nt"&gt;--skill&lt;/span&gt; &amp;lt;skill-name&amp;gt; &lt;span class="nt"&gt;--agent&lt;/span&gt; codex &lt;span class="nt"&gt;-y&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If Claude Code should see the same skills, &lt;code&gt;.claude/skills&lt;/code&gt; can point to the shared directory:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.claude/skills -&amp;gt; ../.agents/skills
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This avoids maintaining separate copies for different agents.&lt;/p&gt;

&lt;h3&gt;
  
  
  Let MCP configuration differ by tool
&lt;/h3&gt;

&lt;p&gt;MCP configuration is one place where the files naturally differ by tool.&lt;/p&gt;

&lt;p&gt;Claude Code may read &lt;code&gt;.mcp.json&lt;/code&gt;. Codex may read &lt;code&gt;.codex/config.toml&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;I do not try to force those into one file. Instead, I keep the policy in &lt;code&gt;AGENTS.md&lt;/code&gt;:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The same MCP capabilities should be available from both agents where practical.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Then each tool gets the configuration format it expects.&lt;/p&gt;

&lt;h2&gt;
  
  
  Operational benefits
&lt;/h2&gt;

&lt;p&gt;The practical benefit is simple: when I start a new agent-assisted task, I already know where it belongs.&lt;/p&gt;

&lt;p&gt;New project? Put it under &lt;code&gt;~/Agents&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;External repository investigation? Clone it under &lt;code&gt;~/Agents&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Article research? Keep the notes near the experiments.&lt;/p&gt;

&lt;p&gt;The workspace keeps related things close together while still preserving repository boundaries.&lt;/p&gt;

&lt;p&gt;It also makes task prompts shorter and more precise because the directory layout carries some of the meaning.&lt;/p&gt;

&lt;p&gt;Instead of explaining every time that an external clone is reference-only, you can make that convention part of the workspace policy.&lt;/p&gt;

&lt;p&gt;The main benefits are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;fewer accidental edits to real projects&lt;/li&gt;
&lt;li&gt;a predictable place for experiments and reproductions&lt;/li&gt;
&lt;li&gt;easier prompts because the workspace already encodes intent&lt;/li&gt;
&lt;li&gt;cleaner separation between durable projects and temporary investigation work&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Things to be careful about
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;~/Agents&lt;/code&gt; should not become a dumping ground for everything.&lt;/p&gt;

&lt;p&gt;I try to keep a few rules:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;separate long-lived projects, playgrounds, external clones, and notes&lt;/li&gt;
&lt;li&gt;be careful with &lt;code&gt;.env&lt;/code&gt; files, credentials, and private notes&lt;/li&gt;
&lt;li&gt;keep workspace-level rules separate from project-level rules&lt;/li&gt;
&lt;li&gt;do not turn the root into a monorepo unless that is actually the goal&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The root &lt;code&gt;AGENTS.md&lt;/code&gt; should describe the workspace. Build commands, test commands, and project-specific constraints should live in the relevant project.&lt;/p&gt;

&lt;p&gt;That separation matters because agents follow local context. If every rule lives at the root, the root file becomes noisy and less useful.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;~/Agents&lt;/code&gt; is less about creating a special directory for AI and more about creating a clear boundary for agent-assisted work.&lt;/p&gt;

&lt;p&gt;For me, it serves three purposes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;work across multiple Git repositories&lt;/li&gt;
&lt;li&gt;create new playgrounds quickly&lt;/li&gt;
&lt;li&gt;keep lightweight investigations for Claude Code and Codex in one shared context&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You do not need to build the whole structure at once.&lt;/p&gt;

&lt;p&gt;A good starting point is:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;create &lt;code&gt;~/Agents&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;add &lt;code&gt;AGENTS.md&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;add a whitelist-style &lt;code&gt;.gitignore&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;create a &lt;code&gt;playground-*&lt;/code&gt; directory for experiments&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Claude Code settings, Codex settings, skills, and MCP configuration can be added later when they become useful.&lt;/p&gt;

&lt;p&gt;The main value is the boundary. Once the workspace has a clear shape, it becomes much easier to tell an AI agent where to read, where to write, and what not to touch.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>tooling</category>
      <category>productivity</category>
      <category>claudecode</category>
    </item>
  </channel>
</rss>
