Skip to content

Project Analysis

When you open a workspace, Ptah runs a multi-phase project analysis. The result is a structured snapshot of your codebase that every agent can reference without re-scanning.

Analysis is incremental — after the first full scan, subsequent runs only re-examine what changed since the last analysis timestamp.

PhaseWhat it doesTypical output
Tech stack detectionIdentifies languages, frameworks, runtimes, build toolsTypeScript, Angular 20, Nx, Electron
Pattern recognitionDetects architectural patterns, conventions, module layoutsNx monorepo, feature-sliced, signals-based
Quality metricsRuns lightweight checks: file size distribution, test coverage hints, TODO/FIXME density~82% files under 300 LOC, 0.4 TODO/KLOC
Dependency analysisParses package.json, requirements.txt, Cargo.toml, go.mod, etc.Direct/transitive dep graph, outdated warnings
Plugin analysisScans .ptah/plugins/ and enabled community plugins for project-relevant agents/skillsangular-frontend-patterns auto-enabled

Analysis runs automatically on:

  • First open of a workspace.
  • Workspace switch.
  • Manual trigger via Workspace → Re-analyze Project.

You can also invoke it programmatically from any agent using the ptah_workspace_analyze MCP tool:

{
"tool": "ptah_workspace_analyze",
"arguments": {
"includeDependencies": true,
"includePatterns": true
}
}

Analysis output is cached in .ptah/analysis/ inside your workspace. The cache is safe to commit (if you want teammates to skip the initial scan) or to gitignore (the default).

my-project/
├── .ptah/
│ └── analysis/
│ ├── stack.json # Detected tech stack
│ ├── patterns.json # Architectural patterns
│ ├── quality.json # Quality metrics
│ └── deps.json # Dependency graph
└── ...

Every agent receives the analysis snapshot as part of its initial context. That’s why, for example, the frontend agent automatically suggests signals-based patterns for an Angular project without you having to mention the framework.

See Workspace intelligence for the full list of context sources.