Context — the current session workspace

Claude Code does not retain a complete “memory” of the project. It works with the data present in the current session window: messages, files it has read, command results, rules, memory, code fragments, and other supplied materials.

A new session is not complete amnesia: persistent instructions may be loaded again. But previous reasoning, logs, and hypotheses do not transfer automatically unless they are recorded in an accessible artifact.

Included in contextExample
Conversation historyPrompts, clarifications, and accepted decisions
Files and codeRead modules, tests, and configurations
Tool resultsCommands, logs, and search results
InstructionsCLAUDE.md, rules, and memory
Multimedia materialsSupplied fragments, screenshots, and UI context

Why Claude may not know the obvious

  • The fact, file, or log was not supplied in the current session.
  • An important detail was lost among a large number of messages.
  • The new request conflicts with project rules or earlier constraints.
  • The assumption was phrased unclearly and has no way to be verified.

A task header for a new session

  1. Clearly state the goal and the observable problem.
  2. List the files or directories to inspect.
  3. State the change boundaries, prohibitions, and hypotheses.
  4. Carry over decisions already made and verification results.
  5. Define one immediate action for the new session.
Minimal portable context
## Task
- Goal: what should change
- Scope: permitted files or modules
- Non-goals: what we are not changing
- Constraints: technical and process rules
- Evidence: verified facts and short logs
- Next step: the nearest action

Artifacts that preserve context

  • CLAUDE.md — stable project rules;
  • rules — instructions for specific areas;
  • TASK_SPEC.md — goal, scope, constraints, and criteria;
  • EVIDENCE_LOG.md — facts, logs, reproduction steps, and open questions;
  • test results and a list of files for the next step.

Summary

Response quality depends on the presence, freshness, and consistency of signals in the context. Manage it deliberately: provide the needed data, avoid unnecessary logs, and record important decisions outside the session.

Canonical lesson source · JavaRush

Open JavaRush material