# How to teach Devin CLI your knowledge

Add project guidance to an `AGENTS.md` file at the project root, or use `~/.config/devin/AGENTS.md` for [global rules](https://www.knowman.io/guides/knowledge-base-for-ai-agents) on Linux and macOS ([Devin CLI rules](https://docs.devin.ai/cli/extensibility/rules.md)). [Devin CLI loads rules](https://www.knowman.io/guides/devin-cli-memory) at the start of each session, and recommends Skills for instructions that apply only in [relevant scenarios](https://www.knowman.io/guides/teach-codex-your-knowledge) ([Devin CLI rules](https://docs.devin.ai/cli/extensibility/rules.md)).

## Add project instructions with AGENTS.md

Create an `AGENTS.md` file at your project root. Devin CLI reads it automatically, and the file can be version-controlled and used across AI tools ([Devin CLI rules](https://docs.devin.ai/cli/extensibility/rules.md)).

Use [project rules](https://www.knowman.io/guides/ai-agent-memory) for coding standards, architecture guidance, preferred libraries, testing conventions, and [project constraints](https://www.knowman.io/guides/knowledge-base-for-teams) ([Devin CLI rules](https://docs.devin.ai/cli/extensibility/rules.md)).

## Set rules that apply across projects

On Linux and macOS, put global rules in `~/.config/devin/AGENTS.md`. On Windows, use `%APPDATA%\devin\AGENTS.md`. Global and project rules are active together ([Devin CLI rules](https://docs.devin.ai/cli/extensibility/rules.md)).

For [personal instructions](https://www.knowman.io/guides/ai-memory-for-individuals), put `AGENTS.local.md` beside `AGENTS.md`. Devin CLI loads it alongside the project rules. Add the local file to `.gitignore` if it should stay private ([Devin CLI rules](https://docs.devin.ai/cli/extensibility/rules.md)).

## Use Skills for scenario-specific guidance

Devin CLI recommends Skills instead of Rules when possible because Skills are added to context only when relevant. A rule can point to Skills for particular scenarios ([Devin CLI rules](https://docs.devin.ai/cli/extensibility/rules.md)).

Keep Rules and AGENTS files as small as possible ([Devin CLI rules](https://docs.devin.ai/cli/extensibility/rules.md)).

## Choose a rule file location

Project-root rules load at session start. Rule files in subdirectories are discovered when Devin CLI accesses those directories ([Devin CLI rules](https://docs.devin.ai/cli/extensibility/rules.md)).

Devin CLI also reads rules from `.devin/rules/` and `.devin/global_rules.md`. The `.devin/` directory takes precedence over `.windsurf/` when both provide a global rules file ([Devin CLI rules](https://docs.devin.ai/cli/extensibility/rules.md)).

## Import rules from other tools

Devin CLI supports rule files including `AGENTS.md`, `AGENTS.local.md`, `AGENT.md`, `.windsurfrules`, and `CLAUDE.md` ([Devin CLI rules](https://docs.devin.ai/cli/extensibility/rules.md)).

You can enable or disable imports from other tool formats with `read_config_from` in the Devin CLI [config file](https://www.knowman.io/guides/mcp-server-knowledge-base) ([Devin CLI rules](https://docs.devin.ai/cli/extensibility/rules.md)).

## Questions

### Where should I put project rules for Devin CLI?

Put them in an `AGENTS.md` file at the project root. Devin CLI reads it automatically, and it can be version-controlled ([Devin CLI rules](https://docs.devin.ai/cli/extensibility/rules.md)).

### How can I make rules apply to every project?

On Linux or macOS, use `~/.config/devin/AGENTS.md`. On Windows, use `%APPDATA%\devin\AGENTS.md`; global and project rules are active together ([Devin CLI rules](https://docs.devin.ai/cli/extensibility/rules.md)).

### When should I use a Skill instead of a Rule?

Devin CLI recommends Skills for instructions that apply only when relevant. A Rule can point to a Skill for a particular scenario ([Devin CLI rules](https://docs.devin.ai/cli/extensibility/rules.md)).

### Can I keep personal rules out of the project file?

Put them in `AGENTS.local.md` beside `AGENTS.md`. Devin CLI loads it alongside the project rules; add it to `.gitignore` if it should stay private ([Devin CLI rules](https://docs.devin.ai/cli/extensibility/rules.md)).

## Related guides

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

- [Persistent Memory for AI Agents](https://www.knowman.io/guides/persistent-memory-for-ai-agents)

- [What is a personal knowledge base, and how do you build one?](https://www.knowman.io/guides/personal-knowledge-base)

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

## More in this topic

- [How to teach Hermes Agent your knowledge](https://www.knowman.io/guides/teach-hermes-your-knowledge)
- [How to teach Gemini CLI your knowledge](https://www.knowman.io/guides/teach-gemini-cli-your-knowledge)
- [How to teach Goose your knowledge](https://www.knowman.io/guides/teach-goose-your-knowledge)

## More for Devin CLI

- [Add the KnowMan MCP server to Devin CLI](https://www.knowman.io/integrations/devin-cli)
- [How to give Devin CLI better memory](https://www.knowman.io/guides/devin-cli-memory)

## Keep your knowledge close

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-devin-cli-your-knowledge
