Your code has behaviors.
pecto makes them visible.

Open-source CLI that extracts behavior specs from your codebase in seconds. Static analysis powered by Rust + tree-sitter. No LLMs. No cloud.

terminal

$ cd ./my-spring-app

$ pecto init

pecto Analyzing ./my-spring-app...

Analyzed 86 files → 29 capabilities

  8 entities

  109 operations

  7 dependencies

---

name: spring-petclinic-rest

capabilities:

  - name: owner-entity

    entities:

      - name: Owner

        table: owners

        fields:

          - name: firstName

            constraints: ["@NotBlank"]

pecto serve — interactive dashboard with dependency graph, domain clusters, and flow tracing

pecto dashboard showing dependency graph and capability sidebar

The problem

Code grows faster than understanding. AI generates code nobody fully grasps. Documentation is always outdated. pecto fixes this.

76%

of developers using AI tools generate code they don't fully understand

$1.14T

spent annually on legacy code maintenance worldwide

<2s

to analyze 250+ files and extract every behavior, entity, and endpoint

What pecto does

Extract, analyze, and visualize — from annotations, patterns, and code structure.

Extraction

REST Endpoints

HTTP methods, paths, parameters, request bodies, validation rules, error responses.

Database Entities

Tables, fields, types, constraints, relationships. JPA/Hibernate and Entity Framework Core.

Services + Security

Operations, transactions, side effects, auth rules, CORS, rate limits, scheduled tasks.

Intelligence

Dependency Graph

See how controllers, services, and repositories connect. Export as text, DOT, JSON, or interactive HTML.

Domain Clustering

Auto-group capabilities into business domains. See which domains depend on each other.

Impact Analysis

pecto impact Owner — know what breaks before you change it.

Workflow

Drift Detection

pecto verify in CI catches undocumented behavior changes. pecto diff compares git refs.

Dashboard + Report

pecto serve for a live web dashboard. pecto report for a shareable HTML file.

AI Context Export

pecto context — compact project summary optimized for LLM context windows.

Automation

Request Flow Tracing

pecto flow — trace endpoint call chains as Mermaid sequence diagrams. Interactive trace highlighting in the dashboard.

PR Behavior Bot

pecto pr-diff — auto-post behavior diffs on PRs. See which endpoints, entities, and dependencies changed.

Architecture Rules

pecto check — validate fitness rules in CI. Catch circular deps, missing auth, and layering violations.

How it works

Parse
tree-sitter AST
Detect
Frameworks
Extract
Behaviors
Resolve
Cross-file types
Generate
YAML / JSON

No LLM. No API keys. No cloud. Just fast, deterministic analysis.

Language support

Java

Ready
  • Spring Boot: @RestController, @GetMapping, @PostMapping
  • Jakarta EE: @Path, @GET, @POST, @PathParam
  • JPA @Entity, @Table, relationships, EntityManager
  • Spring Data JpaRepository + JPA @PersistenceContext
  • @Service, @Stateless, @Inject, side effects
  • Validation: @NotBlank, @Email, @Size
  • Security: @PreAuthorize, @RolesAllowed, @PermitAll
  • @Scheduled, @EventListener

C# / .NET

Ready
  • ASP.NET [ApiController], [HttpGet], [Route]
  • EF Core DbSet<T>, [Table], [Key]
  • Data Annotations: [Required], [EmailAddress], [Range]
  • Services by convention (*Service) or interface (I*Service)
  • [Authorize], [AllowAnonymous]
  • BackgroundService, IHostedService
  • Task<ActionResult<T>> async unwrapping

Python

Ready
  • FastAPI: @router.get, @app.post, Depends()
  • Flask: @app.route, @blueprint.route
  • Django REST: ModelViewSet, @api_view
  • SQLAlchemy: Column(), mapped_column()
  • SQLModel: table=True, inheritance resolution
  • Django Models: CharField, ForeignKey
  • Pydantic: BaseModel, Field() constraints
  • Celery + APScheduler: @shared_task, add_job()
  • Services: *Service classes, module-level CRUD

TypeScript / JavaScript

Ready
  • Express: router.get, app.post, :param
  • NestJS: @Controller, @Get/@Post, @UseGuards
  • Next.js: App Router export function GET/POST
  • TypeORM: @Entity, @Column, relationships
  • Mongoose: Schema detection
  • Services: @Injectable, *Service classes

Performance

0.5s
Spring PetClinic
Java · 86 files
29 caps, 8 entities
0.5s
eShopOnWeb
C# · 254 files
18 caps, 25 endpoints
0.4s
FastAPI Template
Python · 27 files
8 caps, 23 endpoints
0.4s
NestJS TypeORM
TypeScript · 7 files
3 caps, 4 endpoints

Parallel parsing with rayon. No network calls. Pure tree-sitter static analysis.

How pecto compares

Feature pecto Swagger SonarQube
REST endpoints
Database entities
Business logic / side effects
Request flow tracing
Security rules~
Architecture fitness rules
Behavior drift detection
PR behavior diff
Fully offline
Multi-language (4)~
Speed (250 files)<1sN/Aminutes

Get started

# Install

cargo install pecto

# Analyze your project

cd ./my-app

pecto init

# Launch interactive dashboard

pecto serve

Or download pre-built binaries from GitHub Releases.

Get in touch

Questions, feedback, or enterprise inquiries? Reach out directly.