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 reviewcode-architect- architectural decisionscode-explorer- codebase navigationdebug- debugging assistancetask-researcher- research automation
The Solution
The agentget command follows a simple pattern:
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:
npx agentget add https://github.com/anthropics/claude-code --agent code-reviewerThis command:
- Clones the specified repository
- Extracts the
code-revieweragent configuration - 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:
npx agentget add https://github.com/github/awesome-copilot --agent debugThe 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:
npx agentget add https://github.com/Yeachan-Heo/oh-my-claudecodeWithout 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:
/skill code-reviewerOr Claude Code can invoke them automatically based on your CLAUDE.md configuration:
## 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** agentWith 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:
- Define the agent’s purpose and scope
- Write detailed instructions
- Test and iterate on the behavior
- 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
# WRONG - SSH URL
# CORRECT - HTTPS URLnpx agentget add https://github.com/anthropics/claude-code --agent code-reviewerThe tool expects HTTPS URLs, not SSH format.
2. Non-existent agent name
# This will fail if the agent doesn't exist in the repositorynpx agentget add https://github.com/anthropics/claude-code --agent non-existent-agentAlways 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:
# WRONG - agents don't go herels ~/.config/claude/
# CORRECT - check herels ~/.claude/agents/4. Not verifying the import
I assumed the import worked without checking. Now I verify:
ls ~/.claude/agents/code-reviewer.mdcat ~/.claude/agents/code-reviewer.mdThis confirms the agent file exists and contains the expected configuration.
How It Works
The agentget tool does several things:
-
Fetches the repository - It clones or downloads the specified GitHub repository to a temporary location.
-
Locates agent files - It searches for agent configuration files (typically
.mdor.jsonfiles in anagents/directory). -
Extracts the specified agent - If you specify
--agent, it extracts only that agent. Otherwise, it extracts all agents. -
Installs locally - It copies the agent configuration to
~/.claude/agents/, making it available to Claude Code. -
Cleans up - It removes the temporary repository files.
The result is a ready-to-use agent configuration in your local environment.
Related Knowledge
Skills vs Agents
Claude Code has two extension mechanisms:
- Skills - Single-purpose tools triggered by
/skillcommands. 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:
---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 changed2. Analyze for bugs, style issues, and improvements3. Provide specific, actionable feedbackYou 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:
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:
- 👨💻 Reddit Discussion - joeyism
- 👨💻 agentget npm package
- 👨💻 Claude Code Official Repository
- 👨💻 oh-my-claudecode Community Collection
Oh, and if you found these resources useful, don’t forget to support me by starring the repo on GitHub!
Comments