claude-code-project
A reference page for the claude-code-project resource
The claude-code-project resource manages per-project Claude Code configuration. It writes project-scoped instructions, settings, and MCP servers under a specific directory — leaving global configuration untouched. Use it alongside the claude-code resource, which handles installation.
Parameters
-
directory: (string, required) Path to the project directory. All configuration files are written relative to this path:
<directory>/.claude/CLAUDE.md<directory>/.claude/settings.json<directory>/.claude.json
-
claudeMd: (string, optional) Content for
<directory>/.claude/CLAUDE.md. Accepts inline text, anhttps://URL, or acodify://documentId:fileIdcloud URL. Claude Code reads this at the start of every session within the project, making it ideal for project-specific conventions, preferred libraries, and review checklists. -
settings: (object, optional) Key-value pairs to merge into
<directory>/.claude/settings.json. On apply, the declared keys are written; on destroy, only the declared keys are removed. Supports the same keys as the global settings:model— override the default Claude model for this projecteffortLevel—"low"|"medium"|"high"|"xhigh"editorMode—"normal"|"vim"permissions—{ allow: [...], deny: [...] }env— environment variables injected into every sessionhooks— lifecycle hooks (PreToolUse, PostToolUse, SessionStart, etc.)
-
mcpServers: (array, optional) MCP servers to register for this project in
<directory>/.claude.json. Each entry requires anameandtype, plus transport-specific fields:- stdio:
{ name, type: "stdio", command, args?, env? }— local process server - http:
{ name, type: "http", url, headers? }— remote HTTP (streamable-http) server - sse:
{ name, type: "sse", url, headers? }— remote SSE server (deprecated; prefer http)
- stdio:
Example usage
Per-project instructions and permissions
[
{
"type": "claude-code-project",
"directory": "~/projects/my-api",
"claudeMd": "# Project Instructions\n\nThis is a Node.js API. Always use async/await.\nRun `npm test` before committing.",
"settings": {
"permissions": {
"allow": ["Bash(npm run *)", "Bash(git *)"],
"deny": ["Bash(rm -rf *)"]
}
}
}
]Per-project instructions with an MCP server
[
{
"type": "claude-code-project",
"directory": "~/projects/my-api",
"claudeMd": "# Project Instructions\n\nAlways check types with `npm run typecheck` before submitting.",
"mcpServers": [
{
"name": "project-db",
"type": "stdio",
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-postgres", "postgresql://localhost/mydb"]
}
]
}
]Per-project CLAUDE.md from a remote URL
[
{
"type": "claude-code-project",
"directory": "~/projects/my-api",
"claudeMd": "codify://my-document-id:my-file-id"
}
]Or from a public HTTPS URL:
[
{
"type": "claude-code-project",
"directory": "~/projects/my-api",
"claudeMd": "https://raw.githubusercontent.com/my-org/dotfiles/main/CLAUDE.md"
}
]Global install + per-project config together
[
{
"type": "claude-code",
"settings": {
"model": "claude-opus-4-7"
}
},
{
"type": "claude-code-project",
"directory": "~/projects/my-api",
"claudeMd": "# My API\n\nNode.js + TypeScript. Run `npm test` before any commit."
}
]Notes
- The
claude-coderesource must be applied beforeclaude-code-project(it declares a dependency automatically). If Claude Code is not installed, this resource will report as not present. - Multiple
claude-code-projectentries can coexist — each uniquedirectoryis a separate resource instance. - Destroying a
claude-code-projectresource removes only the per-project files (CLAUDE.md, the declaredsettingskeys, and the declaredmcpServers). The Claude Code binary and global configuration are left untouched. - The
settingsparameter merges only the declared keys. Existing project settings not in your Codify config are left untouched. - The
claudeMdparameter manages the entire file. On destroy, the file is removed. - MCP servers are stored in
<directory>/.claude.jsonunder themcpServerskey. Removing an MCP server from your config removes it from the file; other servers are untouched.