10-context-and-prompts — Claude Code prompt: what it does
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.
no license ★ 3,444 updated 2026-10-14
.claude/commands/10-context-and-prompts.mdWhat 10-context-and-prompts 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.
What it helps with
- map the sections that make up the system prompt
- fix OS and git context gathering on Linux
- hook
CLAUDE.mdmemory into the system prompt - dump the assembled prompt to see what the model receives
- clear unresolved
MACROreferences out of the prompt text
Example prompts for the agent
/10-context-and-promptsDo Part A only and show me the signature and return type ofgetSystemPrompt()./10-context-and-promptsRun Part C: drop a testCLAUDE.mdin the root and confirm the memory reaches the output./10-context-and-promptsHandle Part D and runbun scripts/test-prompt.tsso I can read the full prompt.
How to install 10-context-and-prompts
Manually: put the files in place
.claude/commands/10-context-and-prompts.mdHow to use
Paste the text at the start of a chat or into project instructions
Questions about 10-context-and-prompts
How do I install 10-context-and-prompts in Claude Code?
Put the file in your project at .claude/commands/10-context-and-prompts.md. It then runs as /10-context-and-prompts.
What does 10-context-and-prompts do?
It hands the agent a step-by-step job on the CLI prompt layer: read the builder, repair context collection, connect the memory files, and leave a script that prints the finished prompt.
What do I need before running it?
The project at /workspaces/claude-code and bun, since the inspection script is started with bun scripts/test-prompt.ts.