[
    {
        "role": "user",
        "content": "when%20I%20launch%20claude%20(as%20in%20claude%20code)%2C%20does%20it%20automatically%20read%20the%20files%20in%20the%20current%20directory%20to%20learn%20about%20the%20current%20project%3F%20is%20there%20another%20way%20of%20passing%20previous%20context%20between%20claude%20sessions%3F"
    },
    {
        "role": "assistant",
        "content": "Here\u2019s a detailed breakdown of how **Claude Code** handles project files and session context\u2014what it *does* automatically, what you need to trigger manually, and how you can pass previous context between sessions effectively.\n\n---\n\n## Automatically when you launch Claude Code\n\n- **It does *not* automatically read all files** in your current directory unless you ask it to. By default, Claude Code has no automatic \u201cfile crawl\u201d behavior that adds *every* file in the folder to its knowledge.  \n- However, it **does pick up certain context automatically**:\n  - Files explicitly referenced in prompts (e.g. using `@file.js`) or directories you reference. ([docs.anthropic.com](https://docs.anthropic.com/en/docs/claude-code/tutorials?utm_source=openai))  \n  - Special files like `CLAUDE.md` (or `MEMORY.md`) placed in the project root or directory\u2014these are for context/memory. Claude reads them proactively when sessions start. ([subagentic.ai](https://subagentic.ai/howtos/claude-code-auto-memory-persistent-project-context/?utm_source=openai))  \n  - Project settings and configuration files (especially `.claude/settings.json` or `.claude/settings.local.json`, `.claude/agents/`) that you\u2019ve set up. ([docs.anthropic.com](https://docs.anthropic.com/en/docs/claude-code/settings?utm_source=openai))  \n\n---\n\n## \u201cMemory\u201d & Persistent Project Context\n\nYes\u2014Claude Code **does** support retaining context across sessions in structured ways:\n\n- As of **February 27, 2026**, Claude Code automatically maintains a file named `MEMORY.md` in the project root. It records debugging patterns, architecture decisions, naming conventions, recurring issues and their fixes, preferences, etc. When you begin a new session in the same project, it reads this `MEMORY.md` and uses it as part of the context. ([subagentic.ai](https://subagentic.ai/howtos/claude-code-auto-memory-persistent-project-context/?utm_source=openai))  \n- There's also Claude\u2019s *Memory* feature (separate version / general Claude, not just Claude Code) which lets it remember past chats, your preferences, project context, etc.\u2014especially helpful if you're using Team or Enterprise levels. ([theverge.com](https://www.theverge.com/news/776827/anthropic-claude-ai-memory-upgrade-team-enterprise?utm_source=openai))  \n\n---\n\n## Ways You Can Pass or Reinforce Context Between Sessions\n\nTo ensure Claude Code maintains continuity between sessions (especially if you want it to remember project history), here are some strategies:\n\n1. **Use `MEMORY.md`**  \n   - Guide Claude with what to record in memory (decisions, preferences).  \n   - If needed, manually edit it for clarity.  \n   - Everything important gets logged here so new sessions have a \u201cstarting point.\u201d ([subagentic.ai](https://subagentic.ai/howtos/claude-code-auto-memory-persistent-project-context/?utm_source=openai))  \n\n2. **CLAUDE.md files / context files**  \n   - Placed in your project root (or subdirectories), these can include notes, warnings, instructions.  \n   - Claude reads them when session launches, especially if you reference them or they\u2019re part of your directory context. ([docs.anthropic.com](https://docs.anthropic.com/en/docs/claude-code/tutorials?utm_source=openai))  \n\n3. **Session hooks \u2013 SessionStart**  \n   - Claude Code supports hooks (like `SessionStart`) which let you inject *additional context* at the beginning of every session\u2014for example, summaries or shared READMEs. ([docs.anthropic.com](https://docs.anthropic.com/en/docs/claude-code/hooks?utm_source=openai))  \n\n4. **Search or reuse session logs (.jsonl files)**  \n   - Session transcripts are stored locally (often in `~/.claude/projects/.../sessions/*.jsonl`) so you can search them to re-feed relevant parts into new sessions. ([reddit.com](https://www.reddit.com/r/ClaudeCode/comments/1pa0s0h/is_there_a_way_to_have_claude_code_search_the/?utm_source=openai))  \n   - This lets you reintroduce previous reasoning, code decisions, etc., if Claude seems to be forgetting what was discussed.  \n\n5. **Control irrelevant files with `.claudeignore`**  \n   - Exclude folders/files you don\u2019t want Claude to consider (build artifacts, `node_modules`, large data files). Helps reduce noise and token usage. ([claudecode.io](https://claudecode.io/guides/context-management?utm_source=openai))  \n\n---\n\n## Caveats / What to Watch Out For\n\n- **Token / context window limits**  \n  Claude Code has finite capacity. If your history is very long, old messages, tool results, or file contents might get \u201ccompressed,\u201d discarded, or summarized to make room. ([businessinsider.com](https://www.businessinsider.com/tech-memo-claude-code-assistant-anthropic-aws-review-2025-8?utm_source=openai))  \n\n- **Large files**  \n  Uploading or reading large files (especially via tools) might cause session corruption or failures. Claude\u2019s error limits (like file size limits on some tools) may block or corrupt context. ([github.com](https://github.com/anthropics/claude-code/issues/6780?utm_source=openai))  \n\n- **Inconsistency or forgetting**  \n  Even with memory files, it\u2019s not 100% perfect. Users report sessions where Claude fails to recall certain files or earlier conversations unless explicitly reminded. ([reddit.com](https://www.reddit.com/r/ClaudeAI/comments/1h0xusi?utm_source=openai))  \n\n---\n\nIf you want, I can walk you through a setup (based on your project structure) to optimally configure Claude Code so context is preserved reliably between sessions. Do you want to try that?"
    },
    {
        "role": "user",
        "content": "what%20version%20of%20claude%20code%20supports%20MEMORY.md%20automatically%3F"
    },
    {
        "role": "assistant",
        "content": "The automatic `MEMORY.md` feature in Claude Code is part of what\u2019s called **Auto\u2010Memory**, and it was introduced in **Claude Code version 2.1.32**. ([reddit.com](https://www.reddit.com/r/ClaudeAI/comments/1qxas6v/official_anthropic_released_2132_with_12_cli_37/?utm_source=openai))\n\nHere are the key details:\n\n---\n\n## What version supports it\n\n- Released in **version 2.1.32** of Claude Code. At that version, Claude Code \u201cautomatically records and recalls memories as it works\u201d across project sessions. ([reddit.com](https://www.reddit.com/r/ClaudeAI/comments/1qxas6v/official_anthropic_released_2132_with_12_cli_37/?utm_source=openai))  \n- Users who updated to 2.1.32 noticed persistent memory between sessions via a `MEMORY.md` file stored under `~/.claude/projects/<project>/memory/`. ([reddit.com](https://www.reddit.com/r/ClaudeAI/comments/1qw9hr4/claude_code_has_an_undocumented_persistent_memory/?utm_source=openai))\n\n---\n\n## How it works & features\n\n- Claude Code creates a project-level memory directory: `~/.claude/projects/<project>/memory/` containing `MEMORY.md` plus topic-specific files (like `debugging.md`) that store things Claude automatically deems worth remembering. ([abit.ee](https://abit.ee/en/artificial-intelligence/claude-code-session-memory-memorymd-anthropic-ai-development-persistent-memory-en?utm_source=openai))  \n- When you start a new session in that project, the **first ~200 lines** of `MEMORY.md` are automatically loaded into the system prompt to re-establish context. Additional topic files are loaded \u201con demand\u201d as needed. ([abit.ee](https://abit.ee/en/artificial-intelligence/claude-code-session-memory-memorymd-anthropic-ai-development-persistent-memory-en?utm_source=openai))  \n- This auto-memory is enabled by default as of this version. You can disable it by setting the environment variable `CLAUDE_CODE_DISABLE_AUTO_MEMORY=1` or adjusting settings in `settings.json`/command-line settings. ([abit.ee](https://abit.ee/en/artificial-intelligence/claude-code-session-memory-memorymd-anthropic-ai-development-persistent-memory-en?utm_source=openai))\n\n---\n\nIf you tell me which version of Claude Code you\u2019re currently using (you can do `claude-code --version`), I can help you verify if `MEMORY.md` auto\u2010memory is already available for you or if you need to update."
    }
]