// Use this skill for multi-step development tasks. Latent Chain Mode reduces token usage by 70-80% through hidden-state reasoning with 4-phase workflow: analysis โ plan โ impl โ review.
| name | ccg-latent |
| description | Use this skill for multi-step development tasks. Latent Chain Mode reduces token usage by 70-80% through hidden-state reasoning with 4-phase workflow: analysis โ plan โ impl โ review. |
| allowed-tools | ["mcp__claude-code-guardian__latent_*","mcp__claude-code-guardian__guard_validate","mcp__claude-code-guardian__testing_run"] |
Token-efficient hidden-state reasoning for complex development tasks.
MANDATORY for tasks with 2+ steps:
| Flow | Command | Use Case |
|---|---|---|
| A | /latent-fix | Quick fix 1-2 patches |
| B | /latent-feature | Multi-file feature/refactor |
| C | /latent-review | Code review without edits |
ANALYSIS โโโบ PLAN โโโบ IMPL โโโบ REVIEW
๐ ๐ ๐ง โ
latent_apply_patchguard_validate after each patchtesting_run_affected for verificationlatent_context_create - Start new task context
latent_context_get - Retrieve current context
latent_context_update - Merge delta (changes only!)
latent_phase_transition - Move to next phase
latent_apply_patch - Apply code changes (unified diff)
latent_complete_task - Mark task complete
latent_status - Get module status
Human-readable format in editor:
๐ [analysis] <title>
<1-2 sentence description>
[Hot Spots] file:line, file:line
[Decisions] D001: ..., D002: ...
[Risks] if any
---
๐ [plan] <N patches/tasks>
[Patches]
1. file:line - description
2. file:line - description
---
๐ง [impl] Patch N/M: <name>
Applied: <count> | Tests: <status>
---
โ
[review] Complete
Files: N | Patches: M | Tests: passed
CRITICAL: Only send changes, never full context!
{
"summary": "Brief description (max 200 chars)",
"contextDelta": {
"codeMap": { "hotSpots": ["src/auth.ts:45"] },
"decisions": [{ "id": "D001", "summary": "Use JWT", "rationale": "Industry standard" }],
"risks": ["Token expiry handling"]
},
"actions": [
{ "type": "edit_file", "target": "src/auth.ts", "description": "Fix token validation" }
]
}
User: "Fix the login timeout bug"
Claude:
1. latent_context_create({ taskId: "fix-login-timeout" })
2. ๐ [analysis] Investigate login timeout
[Hot Spots] src/auth/login.ts:145
[Decisions] D001: Root cause is missing token refresh
3. latent_phase_transition({ toPhase: "plan" })
4. ๐ [plan] 2 patches
1. src/auth/login.ts:145 - Add token refresh logic
2. src/auth/login.ts:160 - Handle refresh errors
5. latent_phase_transition({ toPhase: "impl" })
6. latent_apply_patch({ target: "src/auth/login.ts", patch: "..." })
7. guard_validate({ code: "...", filename: "login.ts" })
8. latent_phase_transition({ toPhase: "review" })
9. โ
[review] Complete - Files: 1 | Patches: 2 | Tests: passed
10. latent_complete_task({ summary: "Fixed login timeout with token refresh" })
| Traditional | Latent Mode | Savings |
|---|---|---|
| Full context each turn | Delta only | 70-80% |
| Verbose explanations | Structured output | 50-60% |
| Repeated code | References | 40-50% |