dev.toAugust 2, 2026NEW AFFECTS EXAM
Modelo

Give Claude Code a Second Harness

Claude Code has broad switches for disabling customizations, but no single profile switch that replaces only your personal harness while preserving repository instructions. Here is the two-part setup—and a read-only prompt that makes your coding agent plan it for your machine before changing anythin

The CLAUDE.md files, rules, and skills you have built up are useful in everyday development. But they can be too heavy for experiments or autonomous loops. Sometimes you want to swap the whole set for a different one.

Claude Code, however, has **no single profile switch that replaces only your personal harness while preserving the repository configuration**. The closest mechanism is `CLAUDE_CONFIG_DIR`, which points Claude Code at a different configuration directory. But it switches only half of the harness. Skills and agents move; CLAUDE.md and rules from the original environment still come along. On my machine, that meant 16 files and 3,404 words on every launch.

That is the missing piece. The solution is to combine a configuration-directory switch with path-based instruction exclusion.

The first half of this article explains why the combination is necessary and what it preserves. The second half gives you a planning prompt for your coding agent. The agent inspects your environment read-only and stops after producing an implementation plan.

Prerequisites

  • Tested with Claude Code v2.1.220 on macOS
  • In this article, “harness” means the set of `CLAUDE.md`, `rules/`, `skills/`, and `agents/`
  • I call the new directory selected by `CLAUDE_CONFIG_DIR` the “alternate side”

The configuration directory switches only half the harness

`CLAUDE_CONFIG_DIR` is an environment variable that points Claude Code at another configuration directory. Here is what moves—and what stays behind.

| Item | Part of the harness? | Switches to the alternate side? |

|---|---|---|

| `skills/` and `agents/` | Yes | Switches |

| **`CLAUDE.md` and `rules/`** | Yes | **Does not switch; the originals still load** |

| `settings.json` (including hook definitions) | No | Switches |

| Session history and plugins | No | Switches |

Only the top half of the four-part harness changes.

The bottom two rows follow the official documentation:

> Override the configuration directory (default: `~/.claude`). All settings, session history, and plugins are stored under this path

> ([Environment variables](https://code.claude.com/docs/en/env-vars))

Skills and agents do not appear in that sentence, but they switched in my test. When I launched Claude Code with the alternate directory and asked for the available skills, my usual custom skills were gone. Only the skills placed on the alternate side appeared.

Credential storage depends on the operating system. On Linux and Windows, credentials live under the configuration directory. On macOS, they live in the system Keychain. In the macOS environment tested here, changing the configuration directory does not move a credential file with it.

CLAUDE.md and rules remain because they are found through another mechanism:

> Claude Code reads CLAUDE.md files by walking up the directory tree from your current working directory

> ([How Claude remembers your project](https://code.claude.com/docs/en/memory))

When the working directory is belo

Read full article on dev.to