Custom Agents
Agents are programming assistants tailored for diverse development scenarios. CodeArts Agent not only provides various built-in agents but also supports custom agent capabilities. By configuring prompts, skills, and tool sets within a custom agent as required, you can create a dedicated assistant to handle complex development tasks more efficiently.
CodeArts Agent supports two types of agents: local agents (created on the client) and cloud agents (created on the console).
Categories of Local Custom Agents
| Scope of Application | Description |
|---|---|
| Project | Effective only for the current project, distributed along with the repository, and stored locally. Storage directory: ./.codeartsdoer/agents in the root directory of the project |
| User | Effective for all projects of the current user, and stored locally Local storage directory: %USERPROFILE%/.codeartsdoer/agents/ |
Creating a Local Custom Agent on the GUI
- Log in to CodeArts Agent IDE as instructed in Quick Start.
- Click
in the upper right corner to open the global setting page. - In the navigation pane on the left, choose Agents.
- Click Create Agent.
- Set agent parameters and click Create.
Table 2 Parameters for creating a local custom agent Parameter
Description
Agent icon
The system provides various preset icons for agents. Click
on the icon to select a preferred style.Agent Name
Name of the custom agent to be created.
Naming convention: 2 to 20 characters, consisting of letters, digits, underscores, and hyphens (-), and must start with a letter.
Scope
Application scope of the custom agent.
- Project: The agent is only available within the current project and cannot be called by other projects.
- User: The agent can be called across all projects of the current user.
Agent Type
Working mode of the agent, which affects its behavior logic and capability boundary.
- Primary/Sub-agent: It can be used as a sub-agent to be called by a primary agent or as a primary agent to call a sub-agent.
- Primary agent: It runs independently to process user requests and cannot be called by other agents.
- Sub-agent: It can be called by primary agents to perform specific tasks.
Description
A brief explanation of what the agent does to help users understand its functionality, with a maximum of 5,000 characters.
Prompt
System instructions that define the role, tone, workflow, and rules/specifications of the agent.
Skills
Skills that are associated with the agent to enable it to perform certain specialized tasks.
NOTE:CodeArts Agent has no hard limit on the number of associated skills, but it is recommended that the number not exceed 20 to ensure optimal user experience.
MCP Tools
This configuration item is displayed only when Scope is set to Project.
External tools or services connected to the agent to enable it to interact with the outside world, such as obtaining real-time information and operating software.
Up to 80 MCP tools can be added. It is recommended that no more than eight MCP tools be enabled at the same time, with three being ideal for the optimal user experience.
Built-in tools
Built-in, out-of-the-box tools provided by the agent.
- Read: used to retrieve and view files.
- Edit: used to add, modify, or delete files.
- Terminal: used to run system commands in the command line environment.
- Preview: used to preview the generated frontend page in real time.
- Webfetch: used to capture and read web page content.
- Verify the custom agent.
- After the custom agent is created, you can view it on the corresponding category tab (such as Project or User), and its status will be displayed as enabled.
- In the input box on the chat page, click Agent. Verify that the target agent is displayed in the custom agent list.
If you create a sub-agent, it will not be displayed in the custom agent list.
Creating Custom Agents Using Markdown Files
CodeArts Agent allows you to create local projects or user agents through Markdown files. When project and user agents share the same name, the project agent takes precedence over the user agent.
Agents are written in the Markdown file format, with YAML Frontmatter metadata configured at the top of the file and with prompt instructions contained in the body.
--- name: agent-name # Agent name mode: subagent # Agent mode description: Agent desc # Agent function description tools: # Tool permission configuration tool1: true # Allows the use of tool1. tool2: false # Disables the use of tool2. --- # Prompt Here is the system prompt content of the agent.
The following table describes how to set the agent parameters.
| Parameter | Mandatory (Yes/No) | Parameter Type | Default Value | Description |
|---|---|---|---|---|
| name | Yes | String | N/A | Name of the agent to be created. |
| mode | No | String | N/A | Role of the agent.
|
| description | Yes | String | N/A | Description of the agent. |
| tools | No | N/A | Permissions for tools that can be used by the agent. Table 5 lists the tools supported by CodeArts Agent. You can also use * to match all tools. Example: tools: "*":false #All tools are disabled. | |
| Prompt | Yes | String | - | System prompt of the agent. |
| Parameter | Description |
|---|---|
| true | Allowed to use a tool. |
| false | Not allowed to use a tool. |
| Tool | Description |
|---|---|
| read | Reading files |
| write | Writing data to files |
| edit | Editing files |
| bash | Running commands |
| glob | File pattern matching |
| grep | Retrieving content |
| list | Listing directories |
| task | Sub-task |
| webfetch | Obtaining webpage content |
| websearch | Searching webpages |
| question | Inquiring users |
An agent customized for the current project is distributed along with the repository. A project agent takes effect immediately after being added. If it is a sub-agent, when it is used is determined by the primary agent. You can add a project agent using either of the following methods:
- Method 1: Creating a Project Agent
- Log in to CodeArts Agent IDE as instructed in Quick Start.
- In the ./.codeartsdoer/agents folder of the explorer, right-click and choose New > File from the shortcut menu to create a Markdown file.
The agent name consists of lowercase letters, digits, and hyphens (-). It cannot start or end with a hyphen, cannot contain consecutive hyphens, and must be 1 to 64 characters in length. For example, code-reviewer.
- Write the agent in the code-reviewer.md file and press the shortcut keys (Windows/Linux: Ctrl+S; macOS: Command(⌘)+S) to save the file.
- Method 2: Placing an Existing Agent in the Specified Directory
Place an existing agent in ./.codeartsdoer/agents at the project root directory.
A user agent takes effect immediately after being added. If it is a sub-agent, when it is used is determined by the primary agent. You can add a user agent using either of the following methods:
- Method 1: Creating a User Agent
- Create a Markdown agent file in the local directory %USERPROFILE%/.codeartsdoer/agents/.
The agent name consists of lowercase letters, digits, and hyphens (-). It cannot start or end with a hyphen, cannot contain consecutive hyphens, and must be 1 to 64 characters in length. For example, code-analyzer.
- Write the agent in the code-analyzer.md file and press the shortcut keys (Windows/Linux: Ctrl+S; macOS: Command(⌘)+S) to save the file.
- Create a Markdown agent file in the local directory %USERPROFILE%/.codeartsdoer/agents/.
- Method 2: Placing an Existing Agent in the Specified Directory
Place an existing agent in %USERPROFILE%/.codeartsdoer/agents/.
The following describes how to create and use a project sub-agent.
- In the ./.codeartsdoer/agents folder of the file explorer, right-click and choose New > File from the shortcut menu to create a Markdown file named code-analyzer.md.
- Add the following content to code-analyzer.md and save the file.
The .md file name must match the name field within the file, otherwise your sub-agent will fail to run. For example, both the file name and the name field in the example are code-analyzer.
--- name: code-analyzer mode: subagent description: Code analysis expert for reading but not modifying tools: read: true glob: true grep: true list: true --- You are a code analysis expert. Your tasks are to: 1. Analyze code structure and quality. 2. Identify potential issues and areas for improvement. 3. Provide optimization suggestions. Analyze the code carefully, but do not modify any files.
After the file is saved, you can choose Settings > Agents > Project and find the target agent in the enabled state.
Figure 1 Viewing the target agent
- Add the code file to be checked and call a sub-agent to check the code quality.
- On the chat panel of CodeArts Agent, enter #, click File, and select a file from the list.
- Enter a prompt, for example, "use code-analyzer to check the code quality," and click
. - View the sub-agent calling result.
The agent calls sub-agents and displays their names in the response.
Figure 2 Example of using the sub-agent
Using Custom Agents
- At the bottom of the input box on the chat panel, select a custom agent (for example, Python-debugging) to switch to the custom agent mode. The selected model is displayed on the right. You can select a model as required from the drop-down list.
If the chat panel of CodeArts Agent is not displayed, click
(Expand AI Side Bar) in the upper right corner of the top menu bar to open it. - In the input box on the chat panel, enter a prompt (for example, a Python code block containing errors) and click
or press Enter. - View the agent execution result.
The agent automatically detects syntax or logic errors in the code block and provides accurate correction suggestions and the corrected code.
Figure 3 Viewing the agent execution result
Modifying the Default Model for a Local Custom Agent
Once a custom agent is created, its model usage adheres to the following rules: The primary agent defaults to the model used by the system's built-in agent. For example, if the built-in system agent selects GLM-5.2 as its LLM, the custom agent will also use GLM-5.2. A sub-agent directly inherits the model used by the primary agent that invokes it. If you need to modify the default model used by a custom agent, you can do so by modifying the configuration file of the custom agent.
- Go to the directory where the custom agent's configuration file is stored.
For example, to modify a project custom agent, go to the ./.codeartsdoer/agents/ directory of the project on the local machine. You can also locate the corresponding directory in the explorer of CodeArts Agent IDE. For details about the directories for storing Markdown files of other types of custom agents, see Table 1.
- Open the Markdown file of the custom agent, add the model field, and save the file (Windows/Linux: Ctrl+S; macOS: Command(⌘)+S).
In CodeArts Agent, you can specify the default model for custom agents by configuring the model field. You can dynamically switch to the optimal model for specific tasks to balance performance and cost. For instance, employ a lightweight, high-speed model during the planning phase to boost response speed, and invoke a high-capability model during the implementation phase to ensure execution quality.
The value of the model field is in the format of Provider/Model ID, where Provider indicates the model provider (set to inferhub-provider in CodeArts Agent), and Model ID indicates the ID of the specific model.
If the configured model does not exist or you do not have the permission, the primary agent automatically switches to the default model of the built-in agent, and the sub-agent inherits the model of the primary agent.
--- description: focusing on Python code error check and optimization, expected to be professional and concise. mode: primary model: inferhub-provider/GLM-5.2 permission: skill: '*': deny disable: false scope: project avatar: avatar1 ---Table 6 IDs of built-in models in CodeArts Agent Model Name
Model ID
GLM-5.1
GLM-5.1
GLM-5.2
GLM-5.2
- Return to the settings page of CodeArts Agent IDE. On the Agents tab, click
to refresh the agent configuration. - View the default model of the custom agent.
In the input box on the chat panel, switch to the target custom agent. The system automatically applies the default model (for example, GLM-5.2) defined by the Markdown configuration file.
Managing Local Custom Agents
CodeArts Agent IDE features full-lifecycle management capabilities for custom agents. You can efficiently control and continuously optimize created agents based on actual business needs.
| Operation | Procedure |
|---|---|
| Enabling or disabling a local custom agent | On the settings page, choose Agents > Project or Agents > User. Click |
| Editing a local custom agent | On the settings page, choose Agents > Project or Agents > User. Hover the cursor on the target agent and click |
| Deleting a local custom agent | On the settings page, choose Agents > Project or Agents > User. Hover the cursor on the target agent and click Deleted agents cannot be restored. Ensure that the agent is no longer needed before performing this operation. |
| Synchronizing a Custom Agent from the Cloud to the Local | If you log in to the CodeArts Agent client, the system will cache the cloud agents accessible to you locally. Then, the client will update the cache every 24 hours to keep the agents in sync with the cloud. You can also manually refresh them by clicking |
| Enabling or disabling a custom agent synchronized from the cloud to the local | On the settings page, choose Agents > Enterprise or Agents > Team. Click |
| Viewing the configuration of a custom agent synchronized from the cloud to the local | On the settings page, choose Agents > Enterprise, Agents > Team, or Agents > User > Cloud. Hover the cursor on the target agent, and click |
What is your overall rating for this page?
Thank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot





