← Back to articles

Level Up Claude with a Persistent System Prompt

A five-minute setup that makes Claude behave like a senior engineer instead of an eager intern.

May 10, 2026·Developer Tools·3 min read
ClaudeZsh
aiclaudecli
Level Up Claude with a Persistent System Prompt

If you use Claude CLI daily, you've probably hit this: you describe a task, and Claude immediately starts writing code. No questions, no tradeoffs, no pushback. It just goes. The output isn't wrong — but it's rarely right either. It misses context, over-engineers, or solves a slightly different problem than the one you had.

The fix is a system prompt. Here's how I set mine up.

The Setup

Claude CLI supports an --append-system-prompt-file flag that injects a file into every session. I added this to my .zshrc:

alias claude='claude --append-system-prompt-file "$HOME/.claude/system-prompt.md"'

Now every Claude session starts with the same behavioral rules — without me having to repeat them.

What's in the System Prompt

I based mine on andrej-karpathy-skills, a set of guidelines designed to reduce common LLM coding mistakes. I added a specific role on top:

You are a senior full-stack engineer with deep expertise in React, React Native, Node.js, .NET, and Python. You treat the user as a peer engineer — no hand-holding, no over-explaining obvious things.

When context is missing (stack, framework version, project structure), ask before assuming.

The rest of the file covers four rules:

1. Think Before Coding — state assumptions, surface tradeoffs, ask when unclear

2. Simplicity First — minimum code that solves the problem, nothing speculative

3. Surgical Changes — touch only what you must, don't refactor things that aren't broken

4. Goal-Driven Execution — define success criteria before writing a single line

Before vs After

The difference was immediate.

Before: I'd describe a task and get code back in seconds. Claude would pick an interpretation silently and run with it. Sometimes it was right. Often it added abstractions I didn't ask for, or skipped considerations that mattered.

After: Claude pauses. It asks clarifying questions before writing anything. It tells me when something is unclear, presents options when multiple interpretations exist, and pushes back when a simpler approach exists. It feels less like a code generator and more like a peer reviewing your approach before touching the keyboard.

How to Test It

Restart your terminal after updating .zshrc, then run:

claude

Ask it directly:

What is your current role and rules you must follow?

If the system prompt loaded correctly, Claude will describe the role and list the behavioral rules. If it gives a generic answer, the file path or alias isn't wired up correctly.

Why This Works

LLMs default to being helpful in the most direct way possible — which usually means writing code immediately. A system prompt shifts the default. It doesn't make Claude smarter; it makes it behave more like a careful engineer rather than an eager intern.

The tradeoff is speed. Claude will ask more questions, which adds a round-trip before you get code. For trivial tasks that's noise. For anything non-trivial, it's exactly what you want.

One file, one alias. Takes five minutes to set up.