2.0 KiB
Claude Code Working Rules
Mandatory command constraints
These rules exist because previous long shell commands and streamed responses caused tool failures.
- Do not use heredocs.
- Do not use long
node -ecommands. - Do not use long
python -ccommands. - If helper code is needed, create a small script file and run it.
- Keep shell commands short and readable.
- Break complex work into several commands.
- Write large outputs to files instead of printing them.
- Do not print full JSON responses or graph objects.
- Do not paste complete large files into chat.
- Prefer: tool → file → concise summary.
- Keep final reports concise.
- Do not narrate every implementation step.
Change discipline
Before editing:
- state the current branch;
- inspect
git status; - identify the relevant files;
- explain the smallest intended change.
Work on one component or concern at a time.
Do not combine unrelated cleanup with the requested task.
Do not reformat unrelated files.
Do not modify production reasoning code during UX tasks.
Testing discipline
Use focused tests.
Do not run the full test suite unless requested or genuinely necessary.
Do not call Ollama in unit tests.
Do not run live multi-scenario evaluations for ordinary UI changes.
Do not run Playwright unless the task specifically requires it.
Do not weaken existing reasoning tests to make UI changes pass.
Git discipline
Before committing:
- inspect the diff;
- confirm no secrets;
- confirm no internal IP addresses;
- confirm no raw provider responses;
- confirm no screenshots;
- confirm no temporary scripts;
- confirm no generated test outputs;
- confirm only intended files changed.
Use a focused commit message.
Do not merge or tag unless explicitly requested.
Response discipline
At the end of a task, normally report only:
- branch;
- commit hash, when committed;
- files changed;
- behaviour changed;
- tests;
- lint/build;
- manual result, if performed;
- remaining limitation;
- git status.
Stop after reporting. Do not begin the next task automatically.