Title: project_utils | deepagents_code | LangChain Reference
Open Graph Title: project_utils | deepagents_code
X Title: project_utils | deepagents_code
Description: Python API reference for project_utils in deepagents_code. Part of the LangChain ecosystem.
Open Graph Description: Python API reference for project_utils in deepagents_code. Part of the LangChain ecosystem.
X Description: Python API reference for project_utils in deepagents_code. Part of the LangChain ecosystem.
Opengraph URL: https://reference.langchain.com/python/deepagents-code/project_utils
Domain: reference.langchain.com
| og:image | https://reference.langchain.com/og/python/deepagents-code/project_utils |
| og:image:width | 1200 |
| og:image:height | 630 |
| og:image:alt | project_utils | deepagents_code |
| og:type | article |
| twitter:card | summary_large_image |
| twitter:image | https://reference.langchain.com/og/python/deepagents-code/project_utils |
Links:
| LangChain Reference home page | https://reference.langchain.com/ |
| GitHub | https://github.com/langchain-ai |
| Main Docs | https://docs.langchain.com/oss/python/deepagents |
| Deep Agents | https://reference.langchain.com/python/deepagents |
| LangChain | https://reference.langchain.com/python/langchain/overview |
| LangGraph | https://reference.langchain.com/python/langgraph/overview |
| Integrations | https://reference.langchain.com/python/integrations/overview |
| LangSmith | https://reference.langchain.com/python/langsmith |
| Deep Agents Code | https://reference.langchain.com/python/deepagents-code |
| Deep Agents Code | https://reference.langchain.com/python/deepagents-code |
| deepagents-code | https://reference.langchain.com/python/deepagents-code |
| attributeSERVER_ENV_PREFIX: strEnvironment variable prefix used to pass CLI config to the server subprocess. | https://reference.langchain.com/python/deepagents-code/_env_vars/SERVER_ENV_PREFIX |
| attributelogger | https://reference.langchain.com/python/deepagents-code/project_utils/logger |
| functionfind_git_rootLocate the repository root for a path. | https://reference.langchain.com/python/deepagents-code/_git/find_git_root |
| functionget_server_project_contextRead the server project context from environment transport data. | https://reference.langchain.com/python/deepagents-code/project_utils/get_server_project_context |
| functionfind_project_rootFind the project root by looking for git metadata. | https://reference.langchain.com/python/deepagents-code/project_utils/find_project_root |
| functionfind_project_agent_mdFind project-specific AGENTS.md file(s). Checks two locations and returns ALL that exist: project_root/.deepagents/AGENTS.md project_root/AGENTS.md Both files will be loaded and combined if both exist. Candidates with symlinked path components are followed only when the resolved target stays inside project_root. The returned Path is the resolved target when any symlink component was traversed, so FilesystemBackend.download_files opens a regular file rather than tripping O_NOFOLLOW on the link itself. Symlinks pointing outside the project root, symlink loops, and unreadable parents are skipped with a warning. Broken symlinks are treated as missing files (no warning), matching the pre-existing behavior for absent candidates. Why: project AGENTS.md is auto-discovered and loaded into the system prompt before the first model call. Without the in-tree check, a malicious clone could ship AGENTS.md -> ~/.ssh/config (or any other locally-readable file) and have its contents injected as agent instructions on first run. | https://reference.langchain.com/python/deepagents-code/project_utils/find_project_agent_md |
| classProjectContextExplicit user/project path context for project-sensitive behavior. | https://reference.langchain.com/python/deepagents-code/project_utils/ProjectContext |
| View source on GitHub | https://github.com/langchain-ai/deepagents/blob/019900734024a7665fd65bd75235c6307d5da003/libs/code/deepagents_code/project_utils.py |
Viewport: width=device-width, initial-scale=1