~/.codebuddy and the project-level .codebuddy directory.~/.codebuddy/: stores user-level configurations, historical data, runtime data, and more, affecting all projects..codebuddy/ (located in the project root): stores project-level configurations, rules, skills, commands, and more, and is shared with the team through project version control.~/.codebuddy/~/.codebuddy/├── settings.json # User-level global configuration├── settings.local.json # Local personal preferences (not shared)├── CODEBUDDY.md # User-level memory file├── mcp.json # Global MCP server configuration├── statusline-command.sh # Custom status line script (optional)│├── agents/ # User-level custom subagents (available in all projects)├── rules/ # User-level rule files (available in all projects)├── skills/ # User-level skills (available in all projects)│├── projects/ # Runtime data for sessions and subagents of each project├── sessions/ # Session data├── plans/ # Plan files generated in plan mode│├── logs/ # Runtime logs├── traces/ # Execution trace data (OpenTelemetry)├── file-history/ # File change history├── history.jsonl # Conversation history├── blobs/ # Binary resources (images, screenshots, etc.)├── tasks/ # Task tracking data├── teams/ # Runtime data for Agent teams├── shell-snapshots/ # Bash sandbox snapshots│├── plugins/ # Installed plugins├── local_storage/ # CLI key-value persistent storage├── channels/ # Channel configurations (WeChat, etc.)│├── computer-use/ # Computer Use feature records├── debug/ # Debug information└── usage-data/ # Usage statistics
settings.json/config command or by direct editing.{"language": "Simplified Chinese","model": "gpt-5","reasoningEffort": "high","permissions": {"defaultMode": "default","allow": ["Bash(git:*)"],"deny": ["Read(./.env)", "Read(./secrets/**)"]},"env": {"NODE_ENV": "development"},"memory": {"autoMemoryEnabled": true,"typedMemory": true},"trustedDirectories": ["~/workspace/myproject"]}
settings.local.jsonCODEBUDDY.md## Tool Preferences- Use pnpm instead of npm- Prefer a functional programming style## Code Style- Use 2-space indentation
mcp.json.mcp.json:{"mcpServers": {"filesystem": {"command": "npx","args": ["-y", "@modelcontextprotocol/server-filesystem", "/tmp"]}}}
agents/.md file:~/.codebuddy/agents/├── code-reviewer.md # Code review agent└── translator.md # Translation agent
---name: code-reviewerdescription: Code review expert. Use proactively after writing code.tools: Read, Grep, Glob, Bashmodel: inherit---You are a senior code reviewer, focusing on code quality, security, and practical tutorials...
rules/.md files are loaded automatically, and subdirectories are supported:~/.codebuddy/rules/├── preferences.md # Personal coding preferences└── workflows.md # Common workflow standards
---alwaysApply: falsepaths: src/**/*.ts---# TypeScript Standards- Prefer `interface` over `type`.- Do not use `any`.
skills/SKILL.md file:~/.codebuddy/skills/└── pdf/└── SKILL.md
Directory | Description |
projects/ | Runtime data for each project, including session records ( .jsonl) and subagent tool output (tool-results/) |
sessions/ | Active session data |
plans/ | Plan files generated in plan mode |
logs/ | Runtime logs grouped by date and process |
traces/ | OpenTelemetry execution trace data |
file-history/ | File snapshots operated in each session, used for /rewind rollback |
history.jsonl | Global conversation history (used for /resume restoration) |
blobs/ | Binary resources such as images and screenshots, stored by content hash |
tasks/ | Task management system data (TaskCreate/TaskUpdate) |
teams/ | Runtime data of Agent teams (TeamCreate) |
shell-snapshots/ | Bash sandbox startup snapshots for accelerating sandbox creation |
plugins/ | File contents of installed plugins |
local_storage/ | CLI internal key-value persistent storage ( .info files named by content hash) |
.codebuddy/.codebuddy/├── settings.json # Shared project configuration├── settings.local.json # Local personal configuration (automatically ignored by .gitignore)├── CODEBUDDY.md # Project-level memory file│├── agents/ # Project-level custom subagents├── rules/ # Project-level rule files├── skills/ # Project-level skills├── commands/ # Custom slash commands
settings.json{"permissions": {"allow": ["Read", "Edit", "Bash(git:*)", "Bash(npm:*)"],"deny": ["Read(./.env)", "Read(./secrets/**)"]},"enabledPlugins": {"pr-review-toolkit@company-tools": true},"extraKnownMarketplaces": {"company-tools": {"source": {"source": "github","repo": "myorg/codebuddy-plugins"}}}}
settings.local.json.gitignore by CodeBuddy Code. They are suitable for storing personal overrides, such as local debug ports and personal keys, without affecting other team members.CODEBUDDY.md# Project DescriptionThis project is a TypeScript monorepo (Yarn workspaces).## Common Commands- `yarn build` — Build all packages- `yarn test` — Run all tests## Architecture Conventions- Use the CellJS dependency injection framework- Place protocol definitions in `*-protocol.ts` files
CODEBUDDY.md at the root directory (not inside .codebuddy/). Both locations are equivalent.agents/.codebuddy/agents/├── blog-translator.md # Blog translation agent└── docs-reviewer.md # Documentation review agent
rules/.codebuddy/rules/├── code-style.md # Code style conventions├── testing.md # Testing standards├── security.md # Security requirements└── frontend/├── react.md # React component conventions└── styles.md # Style conventions
.md files are automatically loaded recursively.skills/SKILL.md file and optional supporting files:.codebuddy/skills/├── case-executor/│ ├── SKILL.md # Skill definition│ ├── scripts/ # Helper scripts│ └── references/ # Reference materials└── cnb-api/└── SKILL.md
SKILL.md format:---name: case-executordescription: Execute JSON test cases and generate a reportallowed-tools: Read, Write, Bash---You are a test execution expert responsible for running UI test cases in JSON format...
commands//command-name. Supports directory nesting (invoked using /group:command):.codebuddy/commands/├── deploy.md # /deploy command├── team/│ ├── issue-start.md # /team:issue-start command│ └── create-issue.md # /team:create-issue command└── openspec/└── propose.md # /openspec:propose command
---description: Create a new Issueargument-hint: "<description> ; <type> ; <product>"allowed-tools: Bash---Create an Issue based on the following description: $ARGUMENTS
Command line parameters (highest priority)↓.codebuddy/settings.local.json (project-local, not committed to version control)↓.codebuddy/settings.json (project-shared, team-wide)↓~/.codebuddy/settings.json (user-global, personal preferences)↓Built-in product default configuration (lowest priority)
1. User-level memory: ~/.codebuddy/CODEBUDDY.md2. User-level rules: ~/.codebuddy/rules/*.md (recursive)3. Project-level memory: CODEBUDDY.md (searched recursively upward from the cwd)4. Project-level rules: .codebuddy/rules/*.md (cwd only, not upward)5. Project-local memory: CODEBUDDY.local.md6. Subdirectory memory: The tool dynamically loads the CODEBUDDY.md file in a subdirectory when operating on files in that subdirectory.
File/Directory | Submit to Version Control or Not | Description |
.codebuddy/settings.json | ✔ Recommended to commit | Team-shared configuration |
.codebuddy/settings.local.json | ✖ Do not commit | Automatically added to .gitignore |
CODEBUDDY.md / .codebuddy/CODEBUDDY.md | ✔ Recommended to commit | Team-shared knowledge |
CODEBUDDY.local.md | ✖ Do not commit | Automatically added to .gitignore |
.codebuddy/agents/ | ✔ Recommended to commit | Team-shared subagents |
.codebuddy/rules/ | ✔ Recommended to commit | Team-shared rules |
.codebuddy/skills/ | ✔ Recommended to commit | Team-shared skills |
.codebuddy/commands/ | ✔ Recommended to commit | Team-shared commands |
Was this page helpful?
You can also Contact sales or Submit a Ticket for help.
Help us improve! Rate your documentation experience in 5 mins.
Feedback