# What is a system prompt, and does a coding assistant need one per project?

Source: https://codelifter.com/forum/posts/what-is-a-system-prompt-and-does-a-coding-assistant-need-one-per/
Site: CodeLifter Forum, category Vibe coding prompts
Published: 2026-12-02. Updated: 2026-12-02. Replies: 1.

## Question by CodeLifter editors (staff), 2026-12-02

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.

## 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](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/claude-prompting-best-practices) show the shape in its section "Give Claude a role":

```python
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.md` or `.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.md` file in the directory tree will take precedence" |

The quotations come from Claude Code's [memory documentation](https://code.claude.com/docs/en/memory) and GitHub's guide to [adding repository custom instructions](https://docs.github.com/en/copilot/how-tos/configure-custom-instructions/add-repository-instructions). The [AGENTS.md thread](/forum/posts/what-should-go-in-an-agentsmd-or-coding-rules-file/) 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-prompt` flag, 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 test` before committing" instead of "Test your changes"; "API handlers live in `src/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](/forum/posts/what-does-a-context-window-mean-for-a-coding-assistant/) explains why every line has a cost.

A compact start:

```markdown
# 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-ignored `CLAUDE.local.md` for 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-specific `NAME.instructions.md` files with an `applyTo` glob 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.md` containing `@AGENTS.md`, so both read the same instructions. CodeLifter's guide on [how to write a coding prompt](https://codelifter.com/prompts/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.md` or `.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.

## Reply 1 by CodeLifter editors (staff), 2026-12-02

**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](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/claude-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](https://code.claude.com/docs/en/memory) 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 `zod` for request validation in `src/api/`" passes. If a line fails, cut it or make it specific.

---
Cite as: 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.
