# 10-context-and-prompts

10-context-and-prompts takes the agent through the CLI prompt layer: reads the builder, repairs context collection on Linux, connects memory from CLAUDE.md. The last step is a script that prints the finished prompt.

- prompt · `type=prompt` · Claude Code, ChatGPT · ★ 3444 repo stars
- Author: codeaashu
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/codeaashu/claude-code/tree/HEAD/prompts/10-context-and-prompts.md
- Updated: 2026-10-14
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/prompts/10-context-and-prompts

## What it does

This is a work order for anyone rebuilding the prompt layer of the CLI. Parts A through F cover the whole path: what `getSystemPrompt()` returns, which sections land in the final text, how tool descriptions and `MACRO.ISSUES_EXPLAINER` get resolved, and where `.claude.md` and `CLAUDE.md` files are picked up.

Part B is the one that bites. `src/context.ts` collects OS, shell and git data, and some of those paths were written on macOS. On Linux the gathering breaks, so the agent is told to find those spots and fix them. Part D leaves you a way to look at the result: `scripts/test-prompt.ts` prints the assembled prompt and its length, started with `bun scripts/test-prompt.ts`.

The memory check is concrete. A test `CLAUDE.md` goes into the project root, the builder runs, and that memory has to show up in the output. Final verification wants a complete dump with no `undefined` values and no `MACRO.` leftovers. Everything assumes you work inside `/workspaces/claude-code`.

## Install

### Claude Code (native platform)

**Manually: put the files in place**
- File: `.claude/commands/10-context-and-prompts.md`

### ChatGPT

**How to use**
- Paste the text at the start of a chat or into project instructions

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/codeaashu/claude-code/tree/HEAD/prompts/10-context-and-prompts.md

## When to use it
- map the sections that make up the system prompt
- fix OS and git context gathering on Linux
- hook `CLAUDE.md` memory into the system prompt
- dump the assembled prompt to see what the model receives
- clear unresolved `MACRO` references out of the prompt text

## Example prompts
- \`/10-context-and-prompts` Do Part A only and show me the signature and return type of `getSystemPrompt()`.
- \`/10-context-and-prompts` Run Part C: drop a test `CLAUDE.md` in the root and confirm the memory reaches the output.
- \`/10-context-and-prompts` Handle Part D and run `bun scripts/test-prompt.ts` so I can read the full prompt.

## Similar
- [context-engineering-collection](https://affpapa.org/en/nevibecode/skills/context-engineering-collection.md) — skill · 4500 installs
- [context-engine](https://affpapa.org/en/nevibecode/skills/context-engine.md) — skill · 585 installs
- [saving-workspace-context](https://affpapa.org/en/nevibecode/skills/saving-workspace-context.md) — skill · 545 installs
- [context-loader](https://affpapa.org/en/nevibecode/skills/context-loader.md) — skill · 117 installs
- [git-context-controller](https://affpapa.org/en/nevibecode/skills/git-context-controller.md) — skill · 82 installs
- [context-restore](https://affpapa.org/en/nevibecode/commands/context-restore.md) — command · ★ 42780 repo stars

From the same set: [codeaashu/claude-code](https://affpapa.org/en/nevibecode/by/codeaashu/claude-code.md) — 17 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
