-
Notifications
You must be signed in to change notification settings - Fork 0
explain
github-actions[bot] edited this page Feb 28, 2026
·
1 revision
Ask the AI to explain a file, code range, stdin input, or error message — directly from the terminal. Creates an ephemeral AI session that is not persisted after the command exits.
clawd explain src/main.rs # explain the whole file
clawd explain src/main.rs --line 42 # explain around line 42 (±10 lines)
clawd explain src/main.rs --lines 40-60 # explain lines 40–60
clawd explain --stdin # read code from stdin
clawd explain --error "E0308 ..." # explain a compiler/runtime error
clawd explain src/lib.rs --format json # structured JSON output
clawd explain src/main.rs --provider codex # use a specific AI provider| Flag | Description |
|---|---|
<file> |
File to explain (positional argument) |
--line <n> |
Focus on a specific line (1-based); shows ±10 lines of context |
--lines <start-end> |
Focus on a line range, e.g. 40-60
|
--stdin |
Read code from stdin instead of a file |
--error <msg> |
Explain a compiler or runtime error message |
--format text |
Plain text output (default) |
--format json |
Structured JSON: {explanation, suggestions: [{action, code}]}
|
--provider <name> |
AI provider to use (default: claude) |
Explain a Rust error:
cargo build 2>&1 | clawd explain --stdinExplain a specific function:
clawd explain src/session.rs --lines 120-145Get structured JSON for IDE integration:
clawd explain src/lib.rs --format json | jq '.suggestions[].action'{
"explanation": "This function creates a new WebSocket session...",
"suggestions": [
{
"action": "Add error handling for the timeout case",
"code": "if timeout_elapsed { return Err(...) }"
}
]
}- Creates an ephemeral
session.createsession — not visible in session history - Uses existing
session.send+session.message.deltastreaming — no new RPC methods - Streaming output via indicatif spinner
- clawd chat — interactive AI chat in the terminal
- CLI Reference — all clawd commands
ClawDE · GitHub · MIT License
ClawDE
Getting started
Reference
- Architecture
- Daemon-Reference
- Folder-Structure
- Providers
- Multi-Account
- Security
- Features
- Features/Daemon
- Features/Session-Manager
- Features/Mode-System
- Features/Repo-Intelligence
- Features/Projects
- Features/Remote-Access
- Features/Desktop-App
- Features/Provider-Knowledge
- Features/Coding-Standards
- Roadmap
Branding
Contributing