ArticlesLeer en españolLire en français
ArticleBy Piotr MyszkiewiczPublished: Nov 22, 20264 min read

Claude Code Mode: Try It on a Workspace Audit

Suppose you maintain a JavaScript monorepo and want to know which packages are missing a test command. You could ask Claude to read each manifest and reason about it in turn. The interesting part is that the decision is identical for every file. Once you have defined what counts as missing, a short program can do the checking and return just the exceptions.

Code Mode lets Claude write that program in JavaScript and run it in your Claude Code session. A script can make several tool calls, use the result of one to choose the next, and select what to send back to the model. You give Claude the task in ordinary language. Anthropic introduced the experimental opt-in in its November 12 release of Claude Code v2.1.323 .

Start one terminal session

Use the native Claude Code build in an interactive terminal. Check your version first. On macOS, Linux or WSL, launch a single session with:

claude --version
CLAUDE_CODE_EXPERIMENTAL_CODE_MODE=1 claude

You need version 2.1.323 or later. On the first launch, accept the Code Mode prompt and check for the experimental-mode indicator after Claude Code restarts. To resume that conversation later, launch the terminal with the flag enabled again. A fresh session started without the flag uses your usual settings. Anthropic's setup and resume instructions

As of November 22, the documented models are Opus 5.5, Sonnet 5.5, Haiku 5.5 and Fable 5.2. Access requires a Claude subscription or Console account. Gateway and cloud-provider connections, zero data retention and HIPAA configurations are excluded. The VS Code panel, Desktop app and cloud sessions are also outside the supported surfaces. If the indicator is missing, check the account, installation and organization settings before trying a different prompt. Requirements and troubleshooting

Give the script a check you can verify

Try this read-only prompt in a workspace whose packages live one directory below packages/:

Inspect packages/*/package.json. Report each path whose scripts.test
is missing, empty, or only whitespace. List unreadable or invalid
manifests separately. Include the number of manifests examined.
Read files only. Do not run package scripts or change files.

The count matters. An empty exception list could describe a healthy repository or a search that matched nothing. Keeping parse errors separate also prevents a broken manifest from quietly disappearing from the result.

Package manifests flow through a parse check into three groups: usable test command, missing command, or unreadable manifest.
One possible audit. The count covers every matched path, including parse failures. Diagram: sAIgnals.

For a small fixture, imagine three packages. api declares a test command, web has only a build command and docs contains malformed JSON. The expected report is three examined, web missing a test command and docs needing inspection. This is a worked example with a known answer. To check a real run, open one reported manifest and compare the path count with the repository tree. A package that declares a test command may still have failing tests.

Inspect what actually ran

Press Ctrl+O and expand a Code row to read the generated JavaScript. In this example, look at how it selected the files, handled parsing errors and decided what to return. If it scanned installed dependencies or treated a parse error as an empty object, give Claude the narrower rule and repeat the check. The normal conversation shows the underlying tool actions. Transcript and tool behavior

Tool permission rules still apply. In auto mode, the classifier reviews the script before execution and cannot inspect values computed while it runs. For this audit, file reads are enough. A request to execute a package script deserves a closer look because it falls outside the task. Permission checks

When the extra machinery pays off

Code Mode fits exploratory work where many files need the same check and a short exception list is enough for the next decision. For one known manifest, opening the file is quicker. If this check becomes a release requirement, put a reviewed script in the repository and run it in CI. That gives every pull request the same file selection and pass criteria.

Filtering tool output inside a script can reduce what the model needs to read. The size of that benefit depends on the task and the script Claude writes. This guide is based on Anthropic's documentation and a worked example. We did not measure token use, latency or cost.

Your next step

Keep building with Claude Code

Explore Claude Code updates and practical guides in one place.

Explore Claude Code →

Keep up at your pace

Get useful changes, a workflow to try, and a repository to explore. Choose a twice-weekly, weekly or monthly briefing.

Preview the briefing and subscribe →

Explore these tool hubs

Claude Code

Related guides

4 min readWhat Is Kody Koala? Shared Memory, Tools, and Automations for Your AI Agents

Build a weekly merged-PR report in Kody, share it between Claude Code and Codex, and check its results, permissions, and scheduled-job costs.

4 min readHUMANS.md: Tell Your AI Agent When to Ask

Give your AI coding agent a portable profile for reply language, routine decisions and interruptions. Includes a sample HUMANS.md and Claude Code setup.

4 min readReview a Revised Agent Patch with Git range-diff

Review a revised patch series with Git range-diff. A runnable retry-limit example shows how to check unmatched commits and verify the final file.