# pseudocode

A subagent for the Pseudocode stage of SPARC: it turns a finished spec into an algorithm draft and works out the complexity.

- subagent · `type=agent` · Claude Code, Codex, Cursor · ★ 850 repo stars
- Author: ruvnet
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/ruvnet/agentic-flow/tree/HEAD/agentic-flow/.claude/agents/sparc/pseudocode.md
- Updated: 2026-10-26
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/agents/pseudocode

## What it does

This subagent handles one stage of SPARC: Pseudocode. Give it a specification that is already complete and it returns the algorithm as plain steps, with data structures chosen and the cost in time and memory estimated.

The definition file holds frontmatter (architect type, high priority) and a pair of hooks. The pre hook searches memory for earlier algorithm patterns with `npx claude-flow@alpha memory search-patterns`. The post hook stores the session pattern and starts a `neural train` run on algorithm-design data.

Quality is written into memory as a flat 0.88 instead of being derived from the complexity figures, so stored patterns all carry the same score. Every claude-flow call is wrapped in `2>/dev/null || true`. Leave the package out and the lookups do nothing while the phase still reports success.

## Install

### Claude Code (native platform)

**Manually: put the files in place**
- File: `.claude/agents/pseudocode.md` — For all projects use ~/.claude/agents/. Claude delegates by the description field or an @-mention

### Codex

**Manually: put the files in place**
- File: `.codex/agents/pseudocode.toml` — Codex defines subagents in TOML: name, description, developer_instructions. Move the Markdown text into developer_instructions by hand. For all projects use ~/.codex/agents/

### Cursor

**Manually: put the files in place**
- File: `.cursor/agents/pseudocode.md` — Cursor also reads .claude/agents/

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/ruvnet/agentic-flow/tree/HEAD/agentic-flow/.claude/agents/sparc/pseudocode.md

## When to use it
- draft pseudocode from a finished spec before any code exists
- compare two data structure choices on time and space cost
- reuse a proven algorithm pattern from an earlier session
- check edge case coverage while the design is still cheap to change
- keep a complexity breakdown in project memory for later tasks

## Example prompts
- Take the specification from memory and draft pseudocode for the search algorithm, with a complexity estimate.
- Weigh a hash table against a trie for this lookup and say which one costs less memory.
- List the earlier algorithm patterns you found in memory, then store the complexity breakdown.

## Similar
- [sparc-methodology](https://affpapa.org/en/nevibecode/skills/sparc-methodology.md) — skill · 1200 installs
- [sparc-implement](https://affpapa.org/en/nevibecode/skills/sparc-implement.md) — skill · 735 installs
- [discover-math](https://affpapa.org/en/nevibecode/skills/discover-math.md) — skill · 146 installs
- [Paper Lantern](https://affpapa.org/en/nevibecode/mcp/paper-lantern.md) — MCP server
- [leetcode-teacher](https://affpapa.org/en/nevibecode/skills/leetcode-teacher.md) — skill · 615 installs
- [research-engineer](https://affpapa.org/en/nevibecode/skills/research-engineer.md) — skill · 333 installs

## Other versions with the same name
- [pseudocode · ruvnet](https://affpapa.org/en/nevibecode/agents/ruvnet-pseudocode.md) — ★ 850 repo stars

From the same set: [ruvnet/agentic-flow](https://affpapa.org/en/nevibecode/by/ruvnet/agentic-flow.md) — 76 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
