What is a system prompt, and does a coding assistant need one per project?
A system prompt is the instructions given to a language model apart from the conversation, setting its role, rules and context before your first message. Coding assistants already ship with their own. Each project needs not a new system prompt but a short instructions file, such as CLAUDE.md, AGENTS.md or .github/copilot-instructions.md, that the tool adds for you.
Cite
CodeLifter Forum, "What is a system prompt, and does a coding assistant need one per project?", https://codelifter.com/forum/posts/what-is-a-system-prompt-and-does-a-coding-assistant-need-one-per/, accessed 2026-12-02.- CodeLifter editorsStaffStaff, CodeLifter ·
What is a system prompt?
When a program calls a model through an API, it usually sends two kinds of text: a system prompt that frames the whole exchange, and the messages that make up the conversation. Anthropic's prompting best practices show the shape in its section "Give Claude a role":
message = client.messages.create( model="claude-opus-5-5", max_tokens=1024, system="You are a helpful coding assistant specializing in Python.", messages=[ {"role": "user", "content": "How do I sort a list of dictionaries by key?"} ], )The same page says: "Setting a role in the system prompt focuses Claude's behavior and tone for your use case. Even a single sentence makes a difference." Other providers use the same idea under slightly different names, such as instructions or a developer message.
Do coding assistants already have one?
Yes. A coding assistant is a program built around a model, and that program writes the system prompt: what tools exist, how to edit files, how to ask for permission, what format to answer in. You normally cannot see or replace it, and you do not need to. If you build your own agent on an API, writing that system prompt is your job.
So what does a project need?
A project instructions file. The tools read it at the start of a session and add it to what the model sees. Each tool has its own file name:
Tool Project file How the docs describe loading it Claude Code CLAUDE.mdor.claude/CLAUDE.md"loaded into the context window at the start of every session" GitHub Copilot .github/copilot-instructions.md"automatically added to requests that you submit to Copilot" Copilot, other agents AGENTS.md, anywhere in the repository"the nearest AGENTS.mdfile in the directory tree will take precedence"The quotations come from Claude Code's memory documentation and GitHub's guide to adding repository custom instructions. The AGENTS.md thread covers what to write in one.
Is a project file the same as a system prompt?
Not exactly, and the difference explains some surprises. Claude Code's memory page says plainly: "CLAUDE.md content is delivered as a user message after the system prompt, not as part of the system prompt itself. Claude reads it and tries to follow it, but there's no guarantee of strict compliance, especially for vague or conflicting instructions." For instructions that must sit at system prompt level, it points to the
--append-system-promptflag, which "must be passed every invocation, so it's better suited to scripts and automation than interactive use."The same page draws the line between guidance and enforcement: "Settings rules are enforced by the client regardless of what Claude decides to do. CLAUDE.md instructions shape Claude's behavior but are not a hard enforcement layer." So a rule such as "never touch
.env" belongs in permission settings as well as in the instructions file.What should go in a project file, and how long should it be?
Facts the assistant cannot work out from the code, written so they can be checked. The Claude Code page gives three good examples of specific over vague: "Use 2-space indentation" instead of "Format code properly"; "Run
npm testbefore committing" instead of "Test your changes"; "API handlers live insrc/api/handlers/" instead of "Keep files organized". It recommends a target of "under 200 lines per CLAUDE.md file", because "Longer files consume more context and reduce adherence." The context window thread explains why every line has a cost.A compact start:
# Project notes for coding assistants - Build: `npm run build`. Test: `npm test`. Run both before saying a task is done. - TypeScript strict mode. No `any`. - UI strings live in `src/i18n/en.json`; never hard-code them. - Do not add dependencies without asking.Do you need one file per project, or one for everything?
Both, at different levels. Claude Code's page lists scopes from broadest to most specific: an organisation-wide managed file, a personal
~/.claude/CLAUDE.md"for all projects", the project's own file "shared with team members via source control", and a git-ignoredCLAUDE.local.mdfor personal notes on one project. They are "concatenated into context rather than overriding each other", with the more specific ones read later. GitHub adds path-specificNAME.instructions.mdfiles with anapplyToglob for rules that only apply to some files.The practical answer is: personal habits in your user-level file, project facts in the committed project file, and nothing duplicated between them. If a repository serves several tools, the Claude Code docs suggest a
CLAUDE.mdcontaining@AGENTS.md, so both read the same instructions. CodeLifter's guide on how to write a coding prompt covers the task prompts that sit on top.Checked on 12 November 2026.
Short version
- A system prompt frames a model's behaviour before the conversation; coding tools write their own.
- Per project, write an instructions file the tool loads:
CLAUDE.md,AGENTS.mdor.github/copilot-instructions.md. - These files are context, not enforcement; put hard limits in permission settings.
- Keep them short and specific; Claude Code suggests under 200 lines.
- Use user-level files for personal habits and the project file for shared facts.
Write something first.
Give people something to work with: at least 30 words on what happened and what you tried.
That is too long. Keep it under 6,000 characters.
Write the question as the title, 15 to 140 characters, no links.
Pick a category.
Add a name (2 to 40 characters, no links).
That email address does not look right.
That was quick. Read the thread, then try again.
The form expired. Reload the page and post again.
Something went wrong with the form. Reload and try again.
Please complete the check and post again.
Limit reached for now. Try again later.
This thread is closed to new replies.
This thread no longer accepts replies.
Something went wrong with the form. Reload and try again.
Post a reply or question first (name and email), then this browser can vote, edit and accept answers.
You cannot vote on your own post.
Only the author (within 30 days) or the forum team can do that.
That email already has an account. Use your sign-in link instead.
New accounts are paused for the moment. Try again later.
That was already posted.
1 answer
- CodeLifter editorsStaffStaff, CodeLifter ·
Should you paste a long "you are a senior engineer" persona into the project file? Usually not; a line of role is plenty and the rest is better spent on facts. Anthropic's prompting best practices say a role in the system prompt "focuses Claude's behavior and tone" and that "Even a single sentence makes a difference." The coding tool's own system prompt already establishes that the model is a coding assistant, so repeating it at length adds tokens and little else.
What the model cannot infer is your project: which test command is authoritative, which directory is generated and must not be edited, which library you chose and why. The Claude Code memory page puts it as writing down "what you'd otherwise re-explain", and suggests adding to the file when "Claude makes the same mistake a second time" or "A code review catches something Claude should have known about this codebase."
A useful test for every line: could a reviewer check whether the output followed it? "Write clean, idiomatic code" fails that test. "Use
zodfor request validation insrc/api/" passes. If a line fails, cut it or make it specific.