Claude Codeis an AI-based developer tool developed by Anthropic, AI code generation, Automated refactoring, Code reviews, Create tests It supports various development workflows, etc. However, the more powerful the tool, the more important it is to accurately understand its usage and effects. This is especially true when used at the team or organization level.
AI API cost management and token usage tracking
Measuring development productivity KPIs and AI tool ROI
Observability of agnotic workflows
When using Claude Code as an agent, it's essential to track complex workflows and find bottlenecks. Workflows can be optimized by analyzing agents' decision-making processes and tool usage patterns.
Team collaboration and governance
At the organizational level, there is a need to understand how developers are using AI tools and share best practices. Audit tracking of the use of AI tools is also important from a security and compliance perspective.
If individual developers want to quickly understand their Claude Code usage, CCUSAGEis the best choice.
# 즉시 사용 (설치 불필요)
npx ccusage@latest
# 일별 사용량 확인
ccusage daily
# 실시간 모니터링
ccusage blocks --live
# 모델별 비용 분석
ccusage daily --breakdown
The main advantages of ccusage:
It's the perfect solution for individual developers or small teams who want to quickly check usage. For more details, please refer to the GitHub project. [link]
Beyond individual use, more systematic monitoring is needed when using Claude Code at a team or organization level. OpenTelemetryis an industry-standard observability framework that meets these requirements.
To set up Claude Code's OpenTelemetry function, you can use environment variables or use configuration files.
export CLAUDE_CODE_ENABLE_TELEMETRY=1
export OTEL_METRICS_EXPORTER=otlp
export OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317
export OTEL_EXPORTER_OTLP_PROTOCOL=grpc
Add the following content to ~/.claude/settings.json: OTEL_METRICS_EXPORTER
et OTEL_LOGS_EXPORTER
console
If you set it to, you can easily confirm that the exporter is set to the console log without a separate installation.
{
"env": {
"CLAUDE_CODE_ENABLE_TELEMETRY": "1",
"OTEL_METRICS_EXPORTER": "otlp",
"OTEL_LOGS_EXPORTER": "otlp",
"OTEL_EXPORTER_OTLP_PROTOCOL": "grpc",
"OTEL_EXPORTER_OTLP_ENDPOINT": "<http://localhost:4317>"
}
}
important information: The priority between configuration files must be understood correctly. If multiple settings conflict, data may not be queried as intended.
For more details and enterprise settings Anthropic's articlePlease refer to
If building your own OpenTelemetry infrastructure is burdensome, claude-code-otel Try using the project. For details, please refer to the GitHub project. [link]
# 저장소 클론
git clone https://github.com/ColeMurray/claude-code-otel.git
cd claude-code-otel
# Docker 기반 모니터링 스택 실행
make up
# 대시보드 접근
# Grafana: <http://localhost:3000> (admin/admin)
# Prometheus: <http://localhost:9090>
Features provided by claude-code-otel:
Current situationClaude Code is currently mainly metrics It provides central monitoring, Full tracking functionality for complex multi-agent workflows is not yet available. Currently possible monitoring is limited to basic usage metrics (token usage, frequency of API calls, amount of code generated, etc.) for individual Claude Code sessions.
Future prospects: AI is more complex Autonomous agents As you play a role, the three pillars of observability (Observability) — Metrics, Traces, and Logs — will all become important.
Note: The advanced agent monitoring features described below are currently not directly supported by Claude Code, and they anticipate the future development direction of AI tools.
Get visibility into complex AI workflows
[사용자 요청] → [코드 분석 에이전트] → [테스트 생성 에이전트] → [리팩토링 에이전트] → [문서화 에이전트]
↓ ↓ ↓ ↓ ↓
Span 1 Span 2 Span 3 Span 4 Span 5
Expected usage scenarios in practice:
Transparency in the AI decision-making process
{
"timestamp": "2024-08-07T10:30:15Z",
"trace_id": "abc123",
"span_id": "def456",
"agent": "code-reviewer",
"action": "analyze_security",
"context": {
"file_path": "src/auth.py",
"lines_analyzed": 45,
"security_rules_checked": ["sql_injection", "xss", "secrets"]
},
"result": {
"issues_found": 2,
"confidence": 0.89,
"recommendations": ["Use parameterized queries", "Sanitize user input"]
}
}
Organization-level AI governanceManagement systems required when scaling up
1. Allocate and limit usage
2. Quality and compliance
3. Collaboration and knowledge sharing
Monitoring AI development tools like Claude Code is no longer an option but a necessity. Beyond simple usage tracking, it's a key element in securing transparency and efficiency in a new development paradigm where AI and humans collaborate.
Start simple, scale systematically!
In the future, measuring and improving “how effectively they are collaborating with AI” will become a core competency for development teams, going beyond simply “how much AI has been used.” If we establish a monitoring foundation from now on, we will be able to advance even in more advanced AI development environments.