You want an existing project investigated, but you don't want code fixed or settings changed. In that case, run Codex in read-only mode, start Claude Code in Plan mode, and ask it for "investigation and advice only." The names are similar, but the two tools don't work the same way.
Conclusion: start with this one line
Codex
Read-only, with no extra approvalscodex --sandbox read-only --ask-for-approval neverIn the app or IDE, choose a read-only-equivalent restriction under Sandbox settings.
Claude Code
Start in Plan modeclaude --permission-mode planIn Desktop, VS Code, and the web, select Plan in the mode selector near the input box.
Check the settings screen and shared settings. Don't decide based on the approval menu alone; check the file write restrictions.
Select Plan in the interface. A Plan selected in the interface applies only to that conversation.
Go to Codex CLI, Claude Code CLI, or Claude on the web and mobile. Also check the environment where the commands run.
1. Asking for "no changes" vs. permission restrictions
For example, if you ask, "Look into problems in the login process," it's unclear whether you want fixes after the investigation or just a report of the problems. Saying "don't fix anything" conveys your goal, but it doesn't by itself remove the editing tools' or shell's ability to write files.
Separate telling the goal from stopping execution
Request
What you want doneSpecify "Investigation and advice only. Do not implement." Also set the report format and end conditions.
Product permission controls
Which tools are allowedUse Plan or tool restrictions to limit the operations used for implementation. Check the conditions under which approvals or mode changes alter the scope.
Execution environment restrictions
How to protect write destinationsLimit actual writes with sandboxing or OS permissions. Check which processes are covered and what exceptions apply.
Claude Code's official documentation also explains that while prompts and CLAUDE.md influence what the model tries to do, the permission system decides which operations are allowed. If you write prohibitions in Codex's AGENTS.md, keep in mind that they serve a different role from actual permissions. Source: Claude Code permissions.
2. Codex: App, IDE, and CLI settings
Desktop: Check write restrictions from the settings screen
In the desktop app, open Settings → Configuration from the app menu. The shortcut to open settings is Ctrl+, on Windows and Cmd+, on macOS. The official Configuration screen shows Approval policy and Sandbox settings separately.
Check approvals and writes separately
If Sandbox settings is Workspace write, writing to the workspace is allowed. For investigation-only use, check that a read-only-equivalent restriction is set.
Approval policy controls how execution outside the constraints is handled. A setting that asks for approval alone cannot prohibit editing the workspace.
Before sending your request, check the permission controls below the input box and the active settings. If existing work is running, stop it first.
Sources: Official Configuration screen, How to open settings, Permission controls in the input box.
If you can't find it in the screen: check config.toml
You can open the config file from Settings → Configuration → Open config.toml. User settings are usually in ~/.codex/config.toml. In the legacy sandbox settings, the following values correspond to read-only and to a policy of not asking for additional approval.
sandbox_mode = "read-only"
approval_policy = "never"
User settings also affect the apps, IDE extensions, and CLI that read the same settings. Trusted projects' .codex/config.toml, startup overrides, and managed policies are also involved, so having two lines in a file doesn't mean they're in effect. In the CLI, you can check the execution conditions and where settings come from with /status or /debug-config. If you want to check only for one run without changing permanent settings, use the CLI example below.
Permission profiles are a beta feature: a separate configuration method that selects built-in profiles such as :read-only. When used together with legacy sandbox_mode or --sandbox, the legacy setting may take precedence, and managed policies may make exceptions. Don't add both settings without checking which method is already in use. Source: Routes for opening the config file, Settings precedence, Permission profiles.
Ask for approval does not mean "no editing"
Ask for approval in the input box means that work inside the allowed workspace is handled automatically. Approve for me sends eligible approvals to automatic review. Neither setting makes the workspace read-only just by selecting it. Full access is not a substitute for investigation-only use either.
Codex's /plan asks for a plan before implementation. It is not a setting that restricts file writes. It is also different from Claude Code's Plan. Source: Codex /plan.
IDE extension: open Codex Settings from the gear icon
Check shared settings from the gear icon → Codex Settings at the top of the Codex sidebar, and check details under Open config.toml. Also check the permission controls in the input box. The editor extension settings and the config.toml that the agent reads are separate. Turning off the IDE context that passes open files does not prohibit the agent from reading files. Source: Developer settings by client.
CLI: Set it with startup options for that run
If Codex CLI is already available, start it from a terminal opened in the folder you're investigating, as shown below. You don't need to permanently rewrite your config file. If your organization has managed policies, those take precedence.
codex --sandbox read-only --ask-for-approval never
--sandbox read-only
Choose the write restrictionReads accessible files and runs commands inside a read-only sandbox.
--ask-for-approval never
Proceed within constraints without asking for approvalDoes not ask for additional approval. Instead of widening the constraints to continue, operations that can't run are reported as things that couldn't be done.
never does not mean full permissions. The sandbox type and the approval policy are separate settings, and the official combination table includes examples that pair read-only with never. Source: Agent approvals & security.
With --ask-for-approval on-request, you may be asked for approval for operations that go outside the sandbox, and approving them breaks the read-only boundary. Use "Ask before making changes if needed" and "make no changes this time" as separate instructions.
Operations to avoid during investigation
Don't switch to Full access or approve out-of-constraint execution on the spot to clear an error. For investigation only, it is enough to record "this check was not run."
Web, Cloud, and Remote: distinguish the device you're viewing from where commands run
Work on the web runs in a managed execution environment and does not read your local Codex config file. Writing the two lines above on your PC does not by itself make Cloud execution read-only. For Cloud, check the controls provided in the usage screen and the workspace.
When you view PC work from another screen in Remote, the settings you need to protect are the conditions on the side where commands actually run. Don't assume the device you view from is read-only. The environment differences are explained in how to choose between Codex local, Remote, and Cloud. Source: Differences between web and local settings.
3. Using Claude Code for investigation and planning only
Claude Desktop: Select Plan next to the send button in the Code tab
This applies to the Code tab in Claude Desktop. Settings in Chat or Cowork are separate from Claude Code's permission modes. The mode names are the official English labels. For differences between the modes, see our explanation of Claude Code permission modes.
Check the execution location and Plan before sending
Check whether Environment is Local, Cloud, SSH, or WSL, and whether Project folder is the target you want to investigate.
Manual is a mode where edits are made with approval. Accept edits is a mode where edits are approved automatically. For investigation only, select Plan.
Give it the request below, read the plan, and finish. Continue the investigation in Plan as well.
Plan selected in the mode selector applies only to that session. Selections of other modes are remembered per folder and take precedence over permissions.defaultMode in the settings file. If you want investigation-only even in new conversations, check that Plan is displayed every time. Source: Desktop permission modes and what is saved.
VS Code: Select Plan from the mode indicator below the input box
Open the Claude Code chat panel and select the mode indicator below the input box → Plan.
Detailed VS Code settings (make new conversations Plan too; autosave)
Depending on the version, you can also switch by sending /plan in the panel. Even if the plan opens as a Markdown document, don't approve implementation; read it as investigation results.
If you want new conversations to start in Plan too
- Open VS Code settings (Ctrl+, on Windows/Linux, Cmd+, on macOS)
- Under Extensions → Claude Code, check the user setting for
claudeCode.initialPermissionMode - To fix the starting mode to Plan, set
planin that user setting - Open a new conversation and check that Plan is actually displayed
Under the current official specification, workspace settings for claudeCode.initialPermissionMode are ignored. Also, selecting Plan in the chat only affects that conversation. Don't assume that putting permissions.defaultMode in your project's .claude/settings.json will always change the VS Code starting mode. Check the precedence of the extension's starting setting, the last normal mode you selected, and managed and user settings.
Be careful with unsaved files as well. The extension's claudeCode.autosave is a setting that saves editor changes before Claude reads or writes files. Check AI source edits and saves by the editor separately. A setting that automatically attaches open files is also separate from prohibiting file access. Source: VS Code mode operation, extension settings, and precedence.
Operating on the web, mobile, and JetBrains
On the web and mobile, too, select Plan from the mode selection. JetBrains operates the same way as the CLI.
Operations by screen, and notes on Cloud
Select Plan from the mode menu near the input box. Cloud supports Accept edits and Plan. Auto requires organization permission and a supported model, and Bypass permissions is not available.
In a Claude Code conversation, choose a mode from the "+" button in the input box → Permission. With Remote Control, be aware that this changes the permissions of the session already running on your device.
The plugin uses the CLI in the IDE's terminal. Use the CLI startup example below or Shift+Tab, and don't reuse VS Code-specific setting names.
In Cloud, normal file edits are pre-approved, so for investigation, explicitly select Plan and give a request that prevents moving on to implementation after the report. Source: How to switch on each screen, Cloud modes.
CLI: Start in Plan and don't approve implementation
With Claude Code CLI, you can start in Plan mode with the following option. A normal Plan reads files, examines structure and problems, and plans proposed changes. It normally blocks changes made by source-editing tools, but it does create plan files.
claude --permission-mode plan
Stop when you receive the investigation results
In an interactive terminal, you can switch with Shift+Tab. Also check whether the startup state makes Bypass permissions available.
Make a report that cites target files and line numbers the completion condition, rather than editing or building.
When a plan appears, read it or choose No, keep planning to continue the investigation. Choosing Yes gives you the option to exit Plan and move on to implementation.
How shell commands are handled during Plan
Shell commands during Plan are not limited to read-only commands across the board. When Auto mode is available and useAutoModeDuringPlan is on, there is a path where a classifier reviews and allows commands. When Auto is not available, for example, commands outside the built-in read-only command set require approval. Source: Permission modes, Plan explanation.
There are conditions under which edit blocking is lifted even in Plan
According to the official documentation, in an interactive terminal session where Bypass permissions is available, Plan's edit and command restrictions are not enforced. Even when Plan is displayed, attempted edits or commands may run, so check the startup options and settings that enable bypass (-p, the SDK, and the VS Code chat panel are handled differently). Source: bypassPermissions explanation.
When you don't want shell or editing tools used
If reading the structure and code is enough, you can narrow the built-in tools with --tools. The following example limits file-investigation tools to Read, Glob, and Grep, and also denies MCP tools. EndConversation, used to end a conversation, remains. Investigation ability is narrower than a normal Plan, and checks that require running commands can no longer be done.
claude --permission-mode plan --tools "Read,Glob,Grep" --disallowedTools "mcp__*"
Don't substitute --allowedTools here. That option specifies tools that can be used without confirmation, not a restriction limiting usable tools to that set. Also, --tools alone does not restrict MCP, so a separate option is needed. Source: CLI reference.
Handling in Desktop, and the stricter --restricted
Desktop has no session-level UI option equivalent to the CLI's --allowedTools or --disallowedTools. Permission rules in settings files still apply, but selecting Plan alone does not produce the same state as this tool-restriction example. Source: Desktop and CLI feature coverage.
This example also does not make the entire PC read-only, including the app's own saving processes or the settings, hooks, and so on that get loaded. If you open an unfamiliar project, also check separately how existing hooks, plugins, and external connections are handled. --restricted, used for stricter operation, is a feature from v2.1.248 onward and changes not only tools but also the scope of settings loaded. It is not an alias for Plan that keeps your usual environment as is.
To manage tool permissions on an ongoing basis, see Claude Code allow, ask, and deny settings. If you need to isolate Bash, see sandbox setup and limits. Isolation that allows writing to the working folder by default serves a different purpose from investigation-only use.
4. Ready-to-use investigation-only request
Once permissions are set, request that the task end with a report. Rather than "fix it" or "improve it," specifying what to investigate and in what form to return the results to finish reduces misunderstandings that lead to implementation.
For this turn, only investigate the current state and give advice. Do not implement anything.
Target: The login process and the authorization boundaries in this project.
Allowed: Read accessible source code and explain the structure and problems.
Prohibited: Creating, editing, or deleting files; changing settings; adding dependencies;
building, testing, database operations, commit or push, deployment, and changes to external services.
Do not expand permissions in order to run hooks or scripts.
Deliverables:
1. The flow of processing, and the files and line numbers you investigated
2. For each candidate problem: the basis, impact, and priority
3. Improvement proposals you do not implement, and the checks needed if they are implemented
4. Points that cannot be determined from reading alone, and checks not performed
If changes are needed, do not execute them; stop at the proposal.
Once you submit the investigation results, end at that point.
"Investigate candidate causes of saved data disappearing, from the save and load processing and exception handling." If logs contain secrets, first decide what can be shared.
"Explain the module dependencies and point out places where responsibilities overlap." Do not include actual refactoring in the deliverables.
"Review ownership checks, authentication, authorization, and input validation." Running attack code or sending requests to production is handled as separate work.
Even if you agree with an improvement proposal, in the investigation conversation reply "Keep it as an adoption candidate. Do not implement." Move implementation to a separate development conversation with a re-defined scope.
5. What to check before starting and after finishing
Don't stop at "the model said it made no changes." Confirm it through the display, settings, and diffs.
Before starting: align the purpose and execution conditions
- Confirm the folder to investigate and the information you allow it to read
- For Codex, check file permissions and approval policy; for Claude Code, check the startup conditions for Plan and bypass
- Check whether the same mode persists in new conversations, and whether shared settings affect other clients
- Decide the scope of operations used in the investigation, such as shell, MCP, browser, and external apps
- Understand your own uncommitted changes and untracked files, and keep a baseline for comparison after the investigation
- Make submitting the report the end condition, and have checks that can't be run due to insufficient permissions returned as not performed
If under Git, compare the diffs
For example, the following commands let you check changed files and staged and unstaged diffs. Check both before and after the investigation, and don't mistake your own pre-existing changes for AI changes. This example assumes the target repository already uses Git.
git status --short
git diff --stat
git diff --cached --stat
git diff does not reflect changes to untracked files, ignored files, files outside the working folder, databases, or external services. An operation that changed something and then reverted it will not appear in the final diff, so record separately the targets you were able to check and the ones you did not. Git official docs: git status, git diff.
After finishing: don't read the report as implementation results
- Does each problem candidate cite its file, line number, and the basis in the code?
- Are judgments from static reading separated from results actually reproduced or tested?
- Is there any unexplained change in the diff before and after the investigation?
- Are items that couldn't be checked due to insufficient permissions or prohibited execution clearly stated?
- Are the next required tasks recorded as proposals, rather than started on their own?
6. Investigations you can't do, and remaining risks
Tests and builds also write files
Even without editing code, tests may write temporary files or snapshots, builds may write artifacts, and package management may write caches. Even if a test fails in read-only mode, the failure may be the expected result of the restriction rather than a bug.
For things you can only learn by running them, don't allow writes to a production database or a sensitive device. Plan to reproduce them in a separate test environment.
Write restrictions on source code alone don't protect this much
Information you have permission to read may be used in the investigation. Read-only mode and denying reads of secret files are separate measures.
MCP servers and connected apps may be able to change tickets, repositories, and so on. Check this separately from local write restrictions.
Saving conversations and plans is separate from editing the target source. The startup examples here do not reduce all writes on the PC to zero.
Codex's network restrictions also distinguish between command communication inside the sandbox and service communication such as model and authentication traffic. Read-only is a restriction on writing, so the content that is read is still passed to the model as before. Training use is a separate setting. Source: Scope of Permissions. For measures that stop secret files from being read, see Codex secret files and permissions; for training use and storage settings, see ChatGPT and Codex training use and privacy.
When the restriction doesn't work as expected
- The setting is missing: check the product and version you're using, where it runs, and any organization-managed restrictions. Don't switch to settings that bypass the restriction.
- Tests fail: separate whether writes are needed from whether the code has a problem. Record unperformed checks in the report.
- You restricted it midway: changes already made will not be reverted. Stop the work in progress, check the diff, then start a new investigation conversation.
When you split work by folder in a monorepo, also check when subdirectory CLAUDE.md and AGENTS.md files are loaded and how to make AI follow the rules with automated checks.
Summary
Specify read-only and the approval policy for Codex, and for Claude Code check the startup conditions for Plan and, if needed, also narrow the tools it can use. On top of that, give it a request that ends once it submits its report. In both cases, you can operate with "investigating" and "executing changes" kept separate.
Even if some items remain unchecked, don't switch to full permissions. Instead, receive the list of unperformed checks and next verification proposals.
Premise of this article: written on October 9, 2026, based on official documentation from OpenAI and Anthropic. The startup examples have not been run on actual devices, so before using them, check the on-screen display and whether the settings are applied.
Related article: to reduce waiting for approvals in development where editing is allowed, see how to choose between Codex Goal mode and automatic approval review.
FAQ
If I ask it to "just investigate," does it become read-only?
Your goal gets across, but its actual editing ability and command permissions don't change. Along with your request, use Codex's sandbox or Claude Code's Plan and tool restrictions, and check what is restricted.
With Claude Code's Plan, are files never changed?
No. It normally blocks source edits, but it does create plan files. There is also an official exception: in an interactive terminal where Bypass permissions is available, Plan restrictions are not enforced. It is not a mode that prohibits all writes on the PC.
Does Codex's never run everything without asking?
It is a setting that doesn't ask for approval, and it does not mean lifting the sandbox. Combined with read-only, it investigates within those constraints. Distinguish it from a launch that grants full permissions.
If it's read-only, can a security review be called complete?
No. Problem candidates found by reading source code and results reproduced by running it are different things. If you can't verify settings, the execution environment, and dependent services, the conclusions remain limited. Report the basis and the unverified items, and plan any necessary demonstration in a separate test environment.
If I choose "Ask for approval" in the Codex app, won't files be edited?
That alone cannot prevent it. The approval policy and file write restrictions are separate. Check Configuration and the permissions in effect, and for investigation-only use, apply a restriction equivalent to read-only.
If I select Plan once in Claude Desktop or VS Code, will it be Plan next time too?
Plan selected in the mode selector applies only to that conversation or session. Check the display every time. To fix the starting mode in VS Code, you can use the user setting claudeCode.initialPermissionMode.