At a glance
- Claude Code can access files in its active working directory and permitted project subdirectories, including common code, text, configuration, and documentation files, and can inspect or modify them when authorized. It does not automatically have unrestricted access to every file on the computer; access outside the working scope depends on explicit paths, permissions, or configured tools. PDFs and .env files may be accessible as local files, but handling depends on the available tools and permissions, and sensitive .env contents should be protected.
- Run Claude Code from the project directory containing the files, or explicitly provide an allowed path.
- Reference the relevant file or directory in your request and verify the tool or permission approval when needed.
- Use CLAUDE.md and appropriate .claude configuration for persistent project instructions.
- Restrict or deny access to secrets and unrelated directories; review permissions before allowing edits or commands.
Claude Code can access files in its active working directory and permitted project subdirectories, subject to permissions and configuration—not every file on your computer automatically.
Within that authorized scope, it can inspect, read, edit, create, and use common code, text, configuration, and documentation files when those operations are approved. PDFs and .env files may also be accessible locally, but their handling depends on the available tools and permissions.
Claude Code’s filesystem boundary
The main boundary is the folder from which you start Claude Code and the project subdirectories it is allowed to use. This typically includes a local codebase, its documentation, and project configuration. For broader guidance on securing these filesystem boundaries, see Claude Code security best practices.
Claude Code does not automatically have unrestricted access to every file on the computer. Files outside the working scope may require an explicit path, permission, approval, or configured tool. Operating-system permissions and custom permission settings can also affect access. For a detailed explanation of access beyond the project boundary, see Claude Code access outside your project.
For a practical setup, run Claude Code from the project directory containing the files it needs. If a required file is elsewhere, reference its path explicitly and review the requested access before approving it. For the specific case of working across project boundaries, see reading files from another project.
What Claude Code can do inside the project
Inspect and read files
When authorized, Claude Code can inspect directories and read relevant files in its permitted project scope. You can ask it to locate a file, explain code, compare configuration, investigate an error, or review project documentation.
Edit, create, and use files
Claude Code can edit existing files and create new ones, including source code, Markdown documentation, JSON or YAML configuration, and tests. It can also run terminal commands that work with the project, subject to applicable permissions and approvals.
Move, rename, and delete operations depend on the command or tool used, your permissions, and any required approval. Review these potentially destructive changes before allowing them.
Project and configuration files
CLAUDE.md
A project-root CLAUDE.md file is automatically read when a Claude Code session starts. It provides persistent project instructions, such as coding conventions, build commands, and repository-specific guidance.
That automatic reading applies to project instructions; it does not give Claude Code unrestricted access to unrelated files or directories.
The .claude and ~/.claude locations
Claude Code uses project and global configuration for items such as settings, permissions, hooks, rules, skills, commands, agents, workflows, and memory.
Global Claude Code data may also include personal settings, plugin configuration, history, transcripts, tool results, and user-level memory. Exact locations and availability depend on the installation, permissions, and configuration. These categories do not imply unrestricted access to the rest of the home directory. For the specific location and organization of session history, see where Claude Code stores chat history.
| File or location | Typical access status | Important condition |
|---|---|---|
| Project code, text, configuration, and documentation | Usually available within the permitted project scope | Claude Code can inspect, read, edit, create, or use them when authorized. |
CLAUDE.md | Automatically read from the project root at session start | It supplies persistent instructions; it is not permission to access unrelated locations. |
Project .claude files | Used for project settings and instructions | Behavior depends on configured rules and permissions. |
Global ~/.claude data | May include settings, plugin configuration, history, transcripts, tool results, and memory | Availability depends on the setup and does not imply unrestricted home-directory access. |
| PDF files | May be accessible as local files | Local access does not guarantee reliable PDF reading, extraction, editing, or analysis. |
.env files and credentials | May be exposed when within an accessible scope or otherwise provided | Protect secrets; there is no universal rule that every .env file is always readable or always blocked. |
| Files outside the working folder | Conditional | They may require an explicit path, approval, permission, or configured tool. |
| Claude.ai web projects | Not directly available to Claude Code | Move the files into the local scope or connect them through another tool. |
Does access depend on file type?
Claude Code does not have a complete, universal file-extension list that makes every format equally readable, editable, or useful. Common source-code, text, configuration, and documentation files are the natural focus of a project-based coding session, but handling varies by format and tool.
There is an important difference between filesystem access and reliable format handling. Claude Code may be able to reach a local file without being able to interpret or modify it in the same way it handles plain text or code.
Can Claude Code access PDFs?
PDFs may be accessible when stored in an authorized local location or made available through an approved tool. However, local visibility does not establish universal behavior for reading, extracting, editing, or analyzing every PDF.
If a PDF is relevant, place it in the permitted project scope or provide an approved path, then ask Claude Code to use it and verify the result. Do not treat Claude.ai upload-format support as a definitive Claude Code access rule.
Does Claude Code have access to .env files?
.env files may be exposed if they are inside an accessible project or otherwise made available to Claude Code. The same concern applies to API keys, passwords, tokens, credentials, SSH keys, and other sensitive documents. For guidance on protecting and choosing between these credential types, see OAuth versus API keys for AI agents.
No universal rule makes every .env file automatically readable or automatically blocked. Before starting a session, remove secrets where possible, relocate them, restrict access with appropriate permission rules, or use safer substitutes. Do not assume that hiding a filename protects its contents.
Access does not mean automatic context loading
A file being accessible does not mean it is automatically loaded into the model’s context. Claude Code may need to discover it through an allowed directory operation, or you may need to name or reference it in your request.
This distinction matters in large repositories and projects containing sensitive information: a file can be available for a specific operation without every file being continuously read or included in context.
Claude Code versus Claude.ai
Claude Code’s local filesystem access is separate from Claude.ai file uploads and web-app projects. A file uploaded to Claude.ai, or a project created there, is not directly available in a local Claude Code session. Transfer the files into the local working scope or connect them through another tool.
Claude Code does not use file-format lists or limits for chat uploads as a universal Claude Code file list.
Permissions, privacy, and safer setup
- Start Claude Code in a narrowly scoped project folder rather than a directory containing unrelated personal or system data.
- Reference only the files and directories needed for the task.
- Review approval requests and permission rules before allowing file changes or terminal commands.
- Remove, relocate, or protect
.envfiles, credentials, private keys, and other secrets. - Create a Git snapshot or backup before allowing substantial changes.
Bottom line
Claude Code can work with common files in an authorized project scope: it can inspect folders, read and edit files, create files, and run commands when permitted. Files outside that scope require additional authorization or configuration. PDFs and .env files are conditional cases, and sensitive secrets should be protected.
Use a narrowly scoped working folder, reference only what is needed, review approvals, and remember that accessible files are not automatically loaded into context. Claude Code’s local filesystem model is separate from Claude.ai uploads and web projects.






