Skip to main content
subagent CX Codex

scala-expert — Claude Code subagent: what it does, how to install

scala-expert helps write functional Scala code, design safe types, and configure builds with sbt. Useful when refactoring legacy codebases and writing unit tests.

MIT ★ 1,029 updated 2025-10-15

Install into Claude Code · Manually: put the files in place All methods and platforms ↓
.claude/agents/scala-expert.md
Open on GitHub

What scala-expert does

This subagent concentrates on functional Scala programming. It designs solutions around immutable structures, pattern matching, tail recursion, and error handling through Try, Option, and Either. The frontmatter pins the subagent to claude-sonnet-4-20250514.

Its output covers strictly typed code, Scaladoc comments for public classes, unit tests in ScalaTest, and automation scripts for sbt. The agent also inspects type hierarchies, variance annotations, and type bounds.

Strict compiler mode without warnings is part of its quality checklist, so sloppy type signatures will fail its review.

What it helps with

  • rewrite mutable logic using pure functions and tail recursion
  • design type hierarchies with correct variance and type bounds
  • write unit tests for critical code paths with ScalaTest
  • generate sbt scripts for automated builds and testing

Example prompts for the agent

  • Refactor this service in Scala to handle errors using Either
  • Check type hierarchy and variance across our domain model
  • Write ScalaTest suites and an sbt script for automated runs

How to install scala-expert

Manually: put the files in place

.claude/agents/scala-expert.md

For all projects use ~/.claude/agents/. Claude delegates by the description field or an @-mention

Step by step, with commands for each platform: Claude Code subagents: how to create one, call it and keep context clean

Questions about scala-expert

How to install scala-expert in Claude Code?

Save the subagent configuration file to .claude/agents/scala-expert.md.

What does scala-expert do?

It generates and refactors Scala code using pure functions, handles errors with Option or Either, checks type variance, and writes ScalaTest suites with sbt scripts.

Which model does scala-expert use?

The subagent frontmatter explicitly configures claude-sonnet-4-20250514.

Source text

scala-expert.md · MIT
---
name: scala-expert
description: Scala expert specializing in functional programming, type safety, and performance optimization.
model: claude-sonnet-4-20250514
---

## Focus Areas

- Advanced functional programming techniques in Scala
- Type safety and typesafe design patterns
- Immutable data structures and their advantages
- Concurrency and parallelism in Scala
- Efficient collection operations and transformations
- Pattern matching and case classes
- Using Scala's REPL for rapid prototyping
- Implicit classes and extension methods
- Scala's type system: variance, bounds, and constraints
- Utilizing Scala's built-in libraries and features

## Approach

- Prioritize immutability and pure functions
- Emphasize clear and concise code using Scala's features
- Leverage pattern matching for clean conditional logic
- Utilize Scala's powerful type inference capabilities
- Implement tail-recursive solutions to optimize performance
- Employ higher-order functions and combinators effectively
- Explore functional error handling with Try, Option, Either
- Use lazy evaluation to optimize performance where suitable
- Regularly refactor code for clarity and maintainability
- Encourage the use of the latest Scala version to leverage new language features

## Quality Checklist

- Ensure all functions have clear and explicit type signatures
- Validate that code adheres to Scala style guidelines
- Test concurrency implementations for race conditions and deadlocks
- Profile memory usage and optimize where necessary
- Confirm immutability of all data structures in critical code paths
- Ensure proper use of pattern matching without redundancies
- Avoid code smells and anti-patterns specific to Scala
- Ensure comprehensive test coverage with ScalaTest or similar
- Code must compile with no warnings or errors in strict mode
- Verify all custom operators or implicits have clear documentation

## Output

- Idiomatic Scala code adhering to functional programming practices
- Scaladoc comments for all public classes and methods
- Unit tests using Scala's testing frameworks like ScalaTest
- Performance benchmarks for key features and methods
- Code examples demonstrating effective use of Scala features
- Sample applications showing best practices in Scala
- Recommendations for code improvement and optimization
- Reports on type hierarchy and variance effective use
- Scripts for automated building and testing using sbt
- Guidance on evolving existing codebases to Scala best practices

© 0xfurai · MIT · 0xfurai/claude-code-subagents

Similar subagents

All subagents for Programming languages →

From the same set137

The whole set →
flutter-expert flutter-expert — a Flutter specialist subagent for Claude. It handles widgets, state management, animations and API calls; the agent file goes into .claude/agents/. CX Codex ★ 1,029repo stars java-expert java-expert is a Claude Code subagent for writing and reviewing Java code. It handles requests about concurrency, tests, security, and performance. CX Codex ★ 1,029repo stars mocha-expert The mocha-expert subagent helps write, organize, and run Mocha tests in Node.js projects. Use it for async code, test hooks, coverage checks, and failure diagnosis. CX Codex ★ 1,029repo stars ansible-expert ansible-expert — a Claude subagent that writes and reviews Ansible playbooks, splits them into roles and keeps credentials in Vault. Handy when your infrastructure lives in version control. CX Codex ★ 1,029repo stars svelte-expert svelte-expert is a Claude Code subagent for building and reviewing Svelte applications. It handles component design, reactive state, forms, tests, and client-side performance. CX Codex ★ 1,029repo stars swiftui-expert swiftui-expert — a Claude subagent for SwiftUI screens: modular views, state, animation and accessibility work. Useful once a screen grows and state starts leaking everywhere. CX Codex ★ 1,029repo stars react-native-expert react-native-expert guides React Native mobile development for iOS and Android, focusing on performance, native bridge integrations, and release pipelines. CX Codex ★ 1,029repo stars loki-expert loki-expert — a Claude Code subagent for Loki deployment, log ingestion, LogQL queries, retention, caching, and Grafana integration. CX Codex ★ 1,029repo stars

Project sponsors

Companies that keep this analytics open