# How to teach Roo Code your knowledge

Teach Roo Code your knowledge by adding [custom instructions](https://www.knowman.io/guides/give-your-ai-context) through its Prompts tab, [global rules, workspace rules](https://www.knowman.io/guides/roo-code-memory), or mode-specific rules. Use `.roo/rules/` for project guidance. KnowMan can keep [saved articles](https://www.knowman.io/guides/how-to-save-articles) and other [personal knowledge](https://www.knowman.io/guides/personal-knowledge-base), but its local stdio MCP server is not documented as a Roo Code connection.

## Start with custom instructions

Use Roo Code custom instructions to shape its responses, coding style, and decisions. Roo Code supports [global rules](https://www.knowman.io/guides/knowledge-base-for-ai-agents), workspace rules, and instructions entered through the Prompts tab. See [Roo Code's custom instructions guide](https://roocodeinc.github.io/Roo-Code/features/custom-instructions/).

## Choose global or workspace rules

Global rules apply across all projects. Put general global rules in `~/.roo/rules/` on Linux and macOS, or `%USERPROFILE%\.roo\rules\` on Windows. Workspace rules apply only to the current project and take precedence when they conflict with global rules. See [Roo Code's custom instructions guide](https://roocodeinc.github.io/Roo-Code/features/custom-instructions/).

## Store project guidance in rule files

Roo Code prefers a `.roo/rules/` directory for workspace-wide rules, with `.roorules` as a fallback. It reads files in `.roo/rules/` recursively, including subdirectories, and adds their contents to the system prompt in alphabetical filename order. If the directory exists but is empty, Roo Code falls back to `.roorules`. See [Roo Code's custom instructions guide](https://roocodeinc.github.io/Roo-Code/features/custom-instructions/).

## Add instructions for a specific mode

Mode-specific instructions can be set through the Prompts tab or through rule files and directories. A mode-specific workspace directory is `.roo/rules-{modeSlug}/`, with `.roorules-{modeSlug}` as its fallback. Roo Code combines instructions from the Prompts tab, global rules, workspace rules, and mode-specific rules. See [Roo Code's custom instructions guide](https://roocodeinc.github.io/Roo-Code/features/custom-instructions/).

## Use agent rules for repository guidance

Roo Code loads workspace `AGENTS.md` or `AGENT.md` files automatically by default. If both exist, it prefers `AGENTS.md`. To disable this behavior, set `"roo-cline.useAgentRules": false` in VS Code settings. See [Roo Code's custom instructions guide](https://roocodeinc.github.io/Roo-Code/features/custom-instructions/).

## Keep project guidance in version control

Use workspace `.roo/rules/` directories under version control to standardize Roo Code behavior for specific projects. See [Roo Code's custom instructions guide](https://roocodeinc.github.io/Roo-Code/features/custom-instructions/). KnowMan is built for one person's library today, and team plans are not available yet.

## Where KnowMan fits

Roo Code rules are suited to concise instructions and project guidance. KnowMan can [save articles and links](https://www.knowman.io/guides/personal-knowledge-base), read and tag them, answer questions with citations, and [keep claims, decisions, and playbooks](https://www.knowman.io/guides/ai-agent-memory) as memories. See the [MCP server guide](https://www.knowman.io/guides/mcp-server-knowledge-base) and [guide to giving AI context](https://www.knowman.io/guides/give-your-ai-context). KnowMan runs locally with `npx -y @knowman/mcp` over stdio, and is also available as a hosted server at https://api.knowman.io/mcp.

## Connect KnowMan to Roo Code

KnowMan provides a hosted MCP server at https://api.knowman.io/mcp. In clients that support remote MCP servers, add this URL and sign in on the KnowMan consent page, or use an API key as an `Authorization: Bearer <key>` header.

Roo Code rules can guide how an assistant uses project knowledge. KnowMan also runs locally with `npx -y @knowman/mcp`; see the [open-source MCP client](https://github.com/Essatt/knowman-mcp) for its package details.

## Questions

### Where should I put custom instructions for Roo Code?

Use the Prompts tab for direct instructions, global rules for guidance across projects, and workspace rules for a specific project. Roo Code combines these sources, with workspace rules taking precedence over conflicting global rules. See [Roo Code's custom instructions guide](https://roocodeinc.github.io/Roo-Code/features/custom-instructions/).

### Can Roo Code read reference files from a folder?

Yes. Roo Code reads `.roo/rules/` recursively and appends file contents to the system prompt in alphabetical filename order. It uses `.roorules` as a fallback when the preferred directory is empty. See [Roo Code's custom instructions guide](https://roocodeinc.github.io/Roo-Code/features/custom-instructions/).

### What can KnowMan add beyond Roo Code rule files?

KnowMan can keep [saved articles](https://www.knowman.io/guides/ai-article-saver), links, notes, tags, answers with citations, and memories such as claims, decisions, and playbooks. Its [MCP tools](https://www.knowman.io/guides/what-is-an-mcp-server) include `kb_search`, `kb_ask`, `kb_get_item`, and `kb_save`, as listed in the [KnowMan MCP server guide](https://www.knowman.io/guides/mcp-server-knowledge-base).

### Can Roo Code access KnowMan directly?

KnowMan offers a local MCP server with `npx -y @knowman/mcp` and a hosted MCP server at https://api.knowman.io/mcp. In clients that support remote MCP servers, add the hosted server URL and sign in with OAuth or use an API key. Read the [KnowMan MCP server guide](https://www.knowman.io/guides/mcp-server-knowledge-base) for setup details.

## Related guides

- [How to Give Your AI Context from What You Read](https://www.knowman.io/guides/give-your-ai-context)

- [What Is a Knowledge Base for AI Agents?](https://www.knowman.io/guides/knowledge-base-for-ai-agents)

- [Connect your knowledge base through KnowMan's MCP server](https://www.knowman.io/guides/mcp-server-knowledge-base)

- [How Do You Connect AI to Your Notes?](https://www.knowman.io/guides/connect-any-ai-to-your-notes)

## More in this topic

- [How to teach Grok Bot your knowledge](https://www.knowman.io/guides/teach-grok-bot-your-knowledge)
- [How to teach VS Code your knowledge](https://www.knowman.io/guides/teach-vscode-your-knowledge)
- [How to teach Windsurf your knowledge](https://www.knowman.io/guides/teach-windsurf-your-knowledge)

## More for Roo Code

- [Add the KnowMan MCP server to Roo Code](https://www.knowman.io/integrations/roo-code)
- [How to give Roo Code better memory](https://www.knowman.io/guides/roo-code-memory)

## Give Roo Code a knowledge library

Try KnowMan Pro for 14 days with no credit card. [Create your account](https://app.knowman.io/signup)

[Start free](https://app.knowman.io/signup)

Every new account starts with 14 days of Pro. No credit card.

Source: https://www.knowman.io/guides/teach-roo-code-your-knowledge
