Skip to content

How Do I Import and Use Community Agents in Claude Code or OpenCode CLI?

Problem

I wanted to extend Claude Code with specialized agents for code review, debugging, and architecture analysis. But I didn’t want to write them from scratch.

I knew there were community-built agents available. The problem was: how do I actually import them into my Claude Code or OpenCode CLI setup?

I searched through documentation but found scattered information. Some posts mentioned copying files manually. Others referenced npm packages without clear instructions. I wanted a simple, repeatable process.

What I Found

I discovered a Reddit discussion by joeyism (7 upvotes) that explained exactly how to import community agents. The answer was simple: use npx agentget.

This tool lets you import agents from:

  • Claude Code’s official repository
  • GitHub Copilot’s collection
  • Community collections like oh-my-claudecode

Available agents include:

  • code-reviewer - automated code review
  • code-architect - architectural decisions
  • code-explorer - codebase navigation
  • debug - debugging assistance
  • task-researcher - research automation

The Solution

The agentget command follows a simple pattern:

Basic agentget syntax
npx agentget add <repository-url> --agent <agent-name>

Let me walk through the actual commands I used.

Import code reviewer agent

I started by importing the official code-reviewer agent from Claude Code’s repository:

Import code-reviewer agent
npx agentget add https://github.com/anthropics/claude-code --agent code-reviewer

This command:

  1. Clones the specified repository
  2. Extracts the code-reviewer agent configuration
  3. Installs it into my local ~/.claude/agents/ directory

After running this, I could immediately use the code-reviewer agent in my Claude Code sessions.

Import debugging agent

Next, I imported the debug agent from GitHub Copilot’s collection:

Import debug agent from Copilot collection
npx agentget add https://github.com/github/awesome-copilot --agent debug

The debug agent helps with:

  • Analyzing error stack traces
  • Suggesting debugging strategies
  • Identifying common bug patterns

Import all agents from community collection

I also found oh-my-claudecode, a community collection with multiple useful agents:

Import all agents from community collection
npx agentget add https://github.com/Yeachan-Heo/oh-my-claudecode

Without specifying --agent, this imports all available agents from the repository. The oh-my-claudecode collection includes several specialized agents for different workflows.

How to Use Imported Agents

Once imported, agents become available in Claude Code automatically. You can invoke them by name:

Using an imported agent
/skill code-reviewer

Or Claude Code can invoke them automatically based on your CLAUDE.md configuration:

~/.claude/CLAUDE.md
## Agent Orchestration
### Immediate Agent Usage (no user prompt needed):
- Code just written/modified → Use **code-reviewer** agent
- Bug fix or debugging → Use **debug** agent
- Architectural decision → Use **code-architect** agent

With this configuration, when I finish writing code, Claude Code automatically runs the code-reviewer agent to analyze my changes.

Why This Matters

Writing agents from scratch takes time. You need to:

  1. Define the agent’s purpose and scope
  2. Write detailed instructions
  3. Test and iterate on the behavior
  4. Maintain the configuration

Community agents solve this by providing battle-tested configurations. Other developers have already:

  • Refined the prompts through real usage
  • Fixed edge cases
  • Documented what works

You benefit from their experience immediately.

Common Mistakes

I made a few mistakes when first using agentget:

1. Wrong repository URL format

Terminal window
# WRONG - SSH URL
npx agentget add [email protected]:anthropics/claude-code.git --agent code-reviewer
# CORRECT - HTTPS URL
npx agentget add https://github.com/anthropics/claude-code --agent code-reviewer

The tool expects HTTPS URLs, not SSH format.

2. Non-existent agent name

Terminal window
# This will fail if the agent doesn't exist in the repository
npx agentget add https://github.com/anthropics/claude-code --agent non-existent-agent

Always check the repository’s agents directory to see available agent names.

3. Forgetting to check installation location

After import, agents go to ~/.claude/agents/. I initially looked in the wrong directory:

Terminal window
# WRONG - agents don't go here
ls ~/.config/claude/
# CORRECT - check here
ls ~/.claude/agents/

4. Not verifying the import

I assumed the import worked without checking. Now I verify:

Verify agent installation
ls ~/.claude/agents/code-reviewer.md
cat ~/.claude/agents/code-reviewer.md

This confirms the agent file exists and contains the expected configuration.

How It Works

The agentget tool does several things:

  1. Fetches the repository - It clones or downloads the specified GitHub repository to a temporary location.

  2. Locates agent files - It searches for agent configuration files (typically .md or .json files in an agents/ directory).

  3. Extracts the specified agent - If you specify --agent, it extracts only that agent. Otherwise, it extracts all agents.

  4. Installs locally - It copies the agent configuration to ~/.claude/agents/, making it available to Claude Code.

  5. Cleans up - It removes the temporary repository files.

The result is a ready-to-use agent configuration in your local environment.

Skills vs Agents

Claude Code has two extension mechanisms:

  • Skills - Single-purpose tools triggered by /skill commands. Stored in ~/.claude/skills/.
  • Agents - Complex workflows with multiple steps and conditional logic. Stored in ~/.claude/agents/.

Agents are more sophisticated. They can:

  • Chain multiple operations
  • Make decisions based on context
  • Call other agents or skills
  • Maintain state across steps

OpenCode CLI Compatibility

The same agents work in OpenCode CLI because both tools share the same agent configuration format. An agent imported with agentget works identically in:

  • Claude Code (Anthropic’s official CLI)
  • OpenCode CLI (community alternative)

This interoperability means you can switch between tools without losing your agent configurations.

Agent Configuration Format

Imported agents are Markdown files with a specific structure:

Example agent structure
---
description: "Reviews code for quality and best practices"
triggers:
- "code-reviewer"
- "review code"
---
# Code Reviewer Agent
You are a code reviewer. When invoked:
1. Read the files that changed
2. Analyze for bugs, style issues, and improvements
3. Provide specific, actionable feedback

You can edit these files directly to customize agent behavior.

Summary

In this post, I showed how to import community-built agents into Claude Code or OpenCode CLI using npx agentget. The key command is:

Terminal window
npx agentget add <repository-url> --agent <agent-name>

This lets you:

  • Import from official repositories like anthropics/claude-code
  • Import from community collections like oh-my-claudecode
  • Skip writing agents from scratch
  • Benefit from community-tested configurations

After import, agents are immediately available in your Claude Code sessions. You can invoke them manually or configure automatic triggers in your CLAUDE.md file.

Final Words + More Resources

My intention with this article was to help others share my knowledge and experience. If you want to contact me, you can contact by email: Email me

Here are also the most important links from this article along with some further resources that will help you in this scope:

Oh, and if you found these resources useful, don’t forget to support me by starring the repo on GitHub!

Comments