Build a Claude
Code Agent
Five integration paths: from CLAUDE.md project instructions to full MCP servers and Agent SDK exports. All powered by OSSA manifests.
Claude Code is Anthropic's agentic coding tool that runs in your terminal with full access to your codebase, shell, and MCP servers. OSSA manifests define your agent's identity, capabilities, and tools — then export directly to Claude-compatible formats.
Choose by complexity: Option 1 is fastest; Option 3 (MCP) gives the most powerful tool integration.
Option 1: CLAUDE.md Project Instructions
Define agent behavior via Claude Code's native project config
Claude Code reads CLAUDE.md files at the root of your project to understand context, rules, and workflows. Export your OSSA manifest as structured instructions.
# Export your OSSA manifest to CLAUDE.md format
ossa export my-agent.ossa.yaml --to claude-md
# Or manually create CLAUDE.md referencing your agent
cat > CLAUDE.md << 'EOF'
# Agent: Code Reviewer
## Role
You are a senior code reviewer specializing in TypeScript and security.
## Tools
- Use the GitLab MCP server for merge request operations
- Use Semgrep for static analysis
## Rules
- Always check for OWASP Top 10 vulnerabilities
- Require tests for any new function
- Follow the project's existing code style
EOFClaude Code automatically loads CLAUDE.md on every session. Supports project-level (./CLAUDE.md), user-level (~/.claude/CLAUDE.md), and enterprise-managed instructions.
Option 2: Claude Code Skills
Reusable capability bundles triggered by /skill-name
OSSA Skills map directly to Claude Code skills — reusable prompts, tools, and policies that Claude invokes on demand. Export OSSA skills to Claude's skill format.
# Export OSSA skills to Claude Code format
ossa export my-agent.ossa.yaml --to claude-skills
# Creates ~/.claude/skills/ files that Claude Code discovers automatically---
name: code-review
description: Review code for security, performance, and style issues
---
## Steps
1. Read the file(s) to review
2. Check for OWASP Top 10 vulnerabilities
3. Verify test coverage exists
4. Check for performance anti-patterns
5. Validate against project style guide in CLAUDE.mdOption 3: MCP Server (Recommended for Tools)
Expose tools and resources; Claude Code connects natively
Claude Code has first-class MCP support. Define your agent's tools in OSSA, then run them as an MCP server. Claude Code connects via .mcp.json or claude_desktop_config.json.
apiVersion: ossa/v0.5.0
kind: Agent
metadata:
name: code-reviewer
spec:
role: Senior code reviewer
llm:
provider: anthropic
model: claude-sonnet-4-6
tools:
- name: gitlab-api
type: mcp
server:
command: npx
args: ["-y", "@anthropic/gitlab-mcp-server"]
- name: semgrep
type: mcp
server:
command: npx
args: ["-y", "semgrep-mcp-server"]{
"mcpServers": {
"gitlab": {
"command": "npx",
"args": ["-y", "@anthropic/gitlab-mcp-server"],
"env": {
"GITLAB_TOKEN": "from-env"
}
},
"ossa-tools": {
"command": "npx",
"args": ["-y", "@bluefly/openstandardagents", "mcp", "serve"],
"env": {
"AGENT_DIR": ".agents"
}
}
}
}Claude Code discovers MCP servers automatically from .mcp.json in your project root. Tools appear as available actions in every Claude Code session.
Option 4: Anthropic Agent SDK Export
Generate a standalone agent using Anthropic's Agent SDK
OSSA can export directly to the Anthropic Agent SDK format — a production-ready Python agent with tool use, guardrails, and structured outputs.
# Export to Anthropic Agent SDK
ossa export my-agent.ossa.yaml --to anthropic-sdk
# Generates:
# agent.py - Agent runtime with tool definitions
# tools.py - Tool implementations from manifest
# guardrails.py - Safety rules from OSSA policy
# requirements.txt - Dependencies
# README.md - Usage instructionsimport anthropic
client = anthropic.Anthropic()
# Tools defined from OSSA manifest
tools = [
{
"name": "review_merge_request",
"description": "Review a GitLab merge request for code quality",
"input_schema": {
"type": "object",
"properties": {
"project_id": {"type": "string"},
"mr_iid": {"type": "integer"}
},
"required": ["project_id", "mr_iid"]
}
}
]
# Agent loop with tool use
response = client.messages.create(
model="claude-sonnet-4-6",
max_tokens=4096,
system="You are a senior code reviewer. Follow the OSSA policy constraints.",
tools=tools,
messages=[{"role": "user", "content": "Review MR !42 in project backend-api"}]
)Option 5: Direct API Agent (TypeScript)
Full control with the Anthropic TypeScript SDK
Build a standalone agent that loads its identity and tools from an OSSA manifest, then runs against the Anthropic API with full agentic loops, tool use, and extended thinking.
import Anthropic from '@anthropic-ai/sdk';
import { loadManifest, getTools, getSystemPrompt } from '@bluefly/openstandardagents';
// Load agent definition from OSSA manifest
const manifest = loadManifest('.agents/code-reviewer.ossa.yaml');
const tools = getTools(manifest); // Converts OSSA tools to Anthropic format
const system = getSystemPrompt(manifest); // Builds system prompt from role + policies
const client = new Anthropic();
async function runAgent(userMessage: string) {
let messages: Anthropic.MessageParam[] = [
{ role: 'user', content: userMessage }
];
// Agentic loop with tool use
while (true) {
const response = await client.messages.create({
model: manifest.spec.llm.model,
max_tokens: 4096,
system,
tools,
messages,
});
// Check if agent wants to use a tool
const toolUse = response.content.find(b => b.type === 'tool_use');
if (!toolUse || response.stop_reason === 'end_turn') {
return response.content.filter(b => b.type === 'text').map(b => b.text).join('');
}
// Execute tool and continue
const result = await executeTool(toolUse.name, toolUse.input);
messages.push(
{ role: 'assistant', content: response.content },
{ role: 'user', content: [{ type: 'tool_result', tool_use_id: toolUse.id, content: result }] }
);
}
}Quick Start
Get running in under 5 minutes
# Install OSSA CLI
npm install -g @bluefly/openstandardagents
# Create an agent manifest
ossa init code-reviewer --template full
# Export to Claude Code format
ossa export code-reviewer.ossa.yaml --to claude-md
ossa export code-reviewer.ossa.yaml --to claude-skills
# Or run as MCP server for Claude Code
ossa mcp serve --manifest code-reviewer.ossa.yamlFastest Setup
Option 1 (CLAUDE.md) — just create a file, no dependencies needed.
Most Powerful
Option 3 (MCP) — full tool integration, resources, and prompts.
Production Deploy
Option 4 or 5 — standalone agents with the Anthropic SDK.
See Also
- Cursor IDE Integration — five options for Cursor
- OSSA Specification — manifest format and export targets
- DUADP — Universal Agent Discovery Protocol
- Agent Builder — validate and export in the browser
- Framework Transformer — live OSSA-to-framework conversion