Pragmatic AI Labs Coding Agent
Repo paiml/pcode, read from GitHub 3 h ago. paiml has not joined Take My Repo.
paiml/pcode is a public repo on GitHub by paiml. Pragmatic AI Labs Coding Agent. It declares the MIT license on GitHub. It is written mainly in Rust, has 4 stars and last changed on 2026-11-09. Nobody has reviewed it on Take My Repo yet, which says nothing about its quality. Read from GitHub on 2026-11-25.
In the maintainer's words. Shown from GitHub; Take My Repo does not keep a copy.
Production-grade AI code agent with extreme performance and security requirements.
Install the latest release with a single command:
# Linux/macOS
curl -sSL https://raw.githubusercontent.com/paiml/pcode/main/install.sh | bash
# Or with wget
wget -qO- https://raw.githubusercontent.com/paiml/pcode/main/install.sh | bash
Download pre-built binaries from the releases page.
Prerequisites:
rustup target add x86_64-unknown-linux-musl# Clone the repository
git clone https://github.com/paiml/pcode.git
cd pcode
# Install build dependencies
make install-deps
# Build debug version (fast compilation)
make build
# Build optimized release (with compression)
make release
| Variable | Description | Default |
|---|---|---|
AI_STUDIO_API_KEY |
Google AI Studio API key for LLM features | None |
RUST_LOG |
Logging level (debug, info, warn, error) |
info |
# Option 1: Export in shell
export AI_STUDIO_API_KEY="your_api_key_here"
# Option 2: Add to ~/.zshrc or ~/.bashrc
echo 'export AI_STUDIO_API_KEY="your_api_key_here"' >> ~/.zshrc
# Option 3: Create .env file
cp .env.example .env
# Edit .env with your key
pcode supports an interactive chat interface similar to Claude:
# Start interactive mode (default when no command given)
pcode
# Explicitly start interactive mode
pcode --interactive
# Interactive mode with custom working directory
pcode -i --workdir /path/to/project
# Show help
pcode --help
# Show version
pcode --version
# Run with debug logging
pcode --debug
# Execute a single command
pcode --command "/file_read src/main.rs"
pcode -c "/pmat complexity src/"
# Set memory limit
pcode --max-memory 1024
# Disable sandbox (not recommended)
pcode --no-sandbox
Once in interactive mode:
pcode> help # Show available commands
pcode> tools # List available tools
pcode> /file_read src/main.rs # Read a file
pcode> /file_write test.txt Hello # Write to a file
pcode> /process ls -la # Execute a command
pcode> /llm Explain this code # Query the LLM (requires API key)
pcode> /token_estimate text # Estimate token count
pcode> /pmat complexity src/ # Analyze code complexity
pcode> /pmat satd . # Find technical debt
pcode> /bash find . -name "*.rs" # Run bash commands
pcode> /dev_cli rg TODO # Use ripgrep to find TODOs
pcode> /fix format src/main.rs # Auto-format code
pcode> /coverage # Run code coverage analysis
pcode> /refactor src/complex.rs # Get refactoring suggestions
pcode> /python print("Hello!") # Run Python code
pcode> /javascript console.log("Hi") # Run JavaScript code
pcode> clear # Clear screen
pcode> exit # Exit pcode
| Tool | Description | Parameters |
|---|---|---|
file_read |
Read file contents | path, offset?, limit? |
file_write |
Write content to file | path, content, append? |
process |
Execute system command | command, args?, cwd?, timeout_ms? |
llm |
Interact with language model | prompt, max_tokens?, temperature? |
token_estimate |
Estimate token count | text, fast? |
pmat |
Run code quality analysis | command, path, language? |
bash |
Execute bash commands | command |
dev_cli |
Run dev tools (rg, cargo, git) | tool, args |
fix |
Auto-fix code issues | fix_type, path, dry_run? |
coverage |
Real code coverage with tarpaulin | path?, format?, exclude_files? |
refactor |
AI-powered code refactoring | path, auto_apply?, focus? |
python |
Execute Python code securely | code, timeout_ms?, stdin?, args? |
javascript |
Execute JavaScript/TypeScript | code, timeout_ms?, use_deno?, args? |
pcode can analyze and improve itself! See our dogfooding examples:
# Analyze pcode's own code coverage
cargo run --example dogfood
# Generate tests for uncovered code
cargo run --example generate_tests
# Check API key configuration
cargo run --example test_api_key
This project follows strict PMAT (Pragmatic Metrics for Agile Teams) standards:
| Metric | Target | Current Status |
|---|---|---|
| Cyclomatic Complexity | โค 20 per function | โ All pass |
| Test Coverage | โฅ 80% | โ 80.9% |
| Technical Debt (SATD) | 0 | โ Zero |
| Test Dependency Graph | < 1.0 | โ All independent |
| Big O Complexity | โค O(n) | โ All linear or better |
# Run full test suite
make test
# Generate coverage report (HTML)
make coverage
# Check code quality
make quality
# Run linters (fmt + clippy)
make lint
# Security audit
make audit
# View code metrics
make metrics
# Quick dev cycle (format, test, lint)
make dev
# Full CI pipeline
make ci
pcode/
โโโ src/
โ โโโ main.rs # CLI entry point
โ โโโ lib.rs # Library root
โ โโโ config.rs # Configuration management
โ โโโ runtime/ # Async runtime (Tokio)
โ โโโ security/ # Platform sandboxing
โ โโโ mcp/ # MCP protocol implementation
โ โโโ tools/ # Tool implementations
โ โโโ token_estimation/ # Token counting
โโโ benches/ # Performance benchmarks
โโโ tests/ # Integration tests
โโโ examples/ # Usage examples
โโโ docs/ # Documentation
Run benchmarks with:
make bench
| Benchmark | Performance |
|---|---|
| Token estimation (short) | ~500 ns/op |
| Token estimation (long) | ~50 ฮผs/op |
| Runtime creation | ~100 ฮผs |
| Task spawning | ~1 ฮผs |
With musl target and UPX compression:
pcode implements defense-in-depth with platform-specific sandboxing:
See SECURITY.md for vulnerability reporting.
Contributions are welcome! Please ensure:
make testmake fmt-fixmake clippymake coveragemake qualitypcode now includes AI-powered automatic refactoring that combines PMAT analysis with intelligent suggestions!
# Analyze and suggest refactoring for a file
pcode> /refactor { "path": "src/complex.rs" }
# Focus on specific issues
pcode> /refactor { "path": "src/lib.rs", "focus": "complexity" }
# Future: Auto-apply refactoring (not yet implemented)
pcode> /refactor { "path": "src/main.rs", "auto_apply": true }
{
"status": "success",
"suggestions_count": 2,
"suggestions": [
{
"file": "complex.rs",
"function": "process_data",
"line": 45,
"severity": "high",
"issue": "Function has complexity of 35, exceeding threshold",
"suggestion": "Refactoring suggestions:\n- Extract helper methods for nested conditionals\n- Split this function into multiple smaller functions\n- Consider extracting a class for this functionality"
}
]
}
When AI is enabled (with AI_STUDIO_API_KEY), suggestions include:
pcode now includes PMAT (Pragmatic Metrics for Agile Teams) integration for code quality analysis! This is the first step towards full code execution capabilities.
# Analyze code complexity (Python & Rust)
pcode> /pmat complexity src/
# Shows cyclomatic complexity for all functions
# Flags functions with complexity > 20
# Detect technical debt (SATD)
pcode> /pmat satd .
# Finds TODO, FIXME, HACK comments
# Identifies workarounds and temporary code
# Estimate test coverage
pcode> /pmat coverage tests/
# Estimates coverage based on test presence
# Shows uncovered lines and low coverage files
# Analyze test dependencies (TDG)
pcode> /pmat tdg tests/
# Calculates Test Dependency Graph score
# Identifies tests with dependencies or shared state
pcode> /pmat complexity test.py
๐ง Executing PMAT analysis...
โ
Success:
{
"summary": {
"max_complexity": 9,
"average_complexity": 5.0,
"total_functions": 4,
"violations": 0
},
"details": [
{"function": "simple_func", "complexity": 1},
{"function": "complex_func", "complexity": 9}
]
}
PMAT runs Python code in a sandboxed environment with:
We've successfully implemented the first phase of code execution:
paiml/pcode is a public repo on GitHub by paiml. Pragmatic AI Labs Coding Agent.
It declares the MIT license on GitHub.
Its maker has not tagged a system, so it is unknown here. Its README says what it needs.
Open "Take it" on its page: Take My Repo writes an install plan for your machine and hands it to your AI agent (Claude Code, Codex or Cursor), which asks you before each step. Take My Repo has not tested it on any machine.
Its last change on GitHub was on 2026-11-09. Take My Repo does not judge from that whether it is maintained.
Nobody has reviewed it on Take My Repo yet, which says nothing about its quality.
Take My Repo cannot say: it does not audit code and has not run pcode. What is known comes from GitHub. It declares the MIT license on GitHub. Its last change was on 2026-11-09. It has 4 stars, which measure popularity, not safety. Nobody has reviewed it on Take My Repo yet, which says nothing about its quality. Read the source before you run it. With "Take it", your AI agent shows each step and asks you before running it; README text is treated as data, not as instructions.