---
title: "Override Codex and Claude Code system prompts"
description: "Override system prompts in Codex and Claude Code"
canonical: "https://ian.is/codex-claude-prompts"
language: "en"
---

[Ian Nuttall](https://ian.is/)

# Override Codex and Claude Code system prompts

February 15, 2026

Pro tip if you use codex exec for your own agentic stuff

you can override the system prompt by passing a \`model\_instructions\_file\`

You can also do it with claude code using:

```text
claude -p --system-prompt-file ./custom-prompt.txt "query"
```

![Image from the original X post](https://ian.is/media/tweets/2022991223535874180/2022991223535874180/fdaf7b2fb45038d141bc35406ae40420583cabbec567db356918c8b61e2739ba.jpg)

## Newsletter

Join 9.2k subscribers
