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

# Override Codex and Claude Code system prompts

Feb 2026 / 6,983 views / [via X](https://x.com/iannuttall/status/2022991223535874180)

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:

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

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

## Ian's List

Join 15k\+ subscribers
