{"id":43486353,"url":"https://github.com/existential-birds/daydream","last_synced_at":"2026-05-17T04:10:10.951Z","repository":{"id":335965500,"uuid":"1147075973","full_name":"existential-birds/daydream","owner":"existential-birds","description":"Automated code review and fix agent loop using Claude Agent SDK or Codex with Beagle skills","archived":false,"fork":false,"pushed_at":"2026-03-03T14:18:40.000Z","size":442,"stargazers_count":2,"open_issues_count":5,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-03T18:32:40.494Z","etag":null,"topics":["agentic-ai","ai-agents","automation","claude","cli","code-review","codex","elixir","golang","phoenix","python","react-router-v7"],"latest_commit_sha":null,"homepage":"https://existentialbirds.com","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/existential-birds.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-01T06:30:58.000Z","updated_at":"2026-03-03T14:16:48.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/existential-birds/daydream","commit_stats":null,"previous_names":["existential-birds/daydream"],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/existential-birds/daydream","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/existential-birds%2Fdaydream","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/existential-birds%2Fdaydream/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/existential-birds%2Fdaydream/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/existential-birds%2Fdaydream/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/existential-birds","download_url":"https://codeload.github.com/existential-birds/daydream/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/existential-birds%2Fdaydream/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30068561,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-04T01:03:42.280Z","status":"ssl_error","status_checked_at":"2026-03-04T01:03:23.410Z","response_time":61,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agentic-ai","ai-agents","automation","claude","cli","code-review","codex","elixir","golang","phoenix","python","react-router-v7"],"created_at":"2026-02-03T09:11:39.386Z","updated_at":"2026-05-17T04:10:10.945Z","avatar_url":"https://github.com/existential-birds.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# daydream\n[![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/existential-birds/daydream)\n\nAutomated code review and fix loop powered by Claude and Codex.\n\nDaydream launches review agents equipped with [Beagle](https://github.com/existential-birds/beagle) skills — specialized knowledge modules for your technology stack (FastAPI, React, Phoenix, and more). It parses actionable feedback from the review, applies fixes automatically, and validates changes by running your test suite.\n\n![demo](https://github.com/user-attachments/assets/60a80645-36de-410e-afa7-7a96efef3f57)\n## Features\n\n- **Deep review by default**: Multi-stack parallel pipeline that combines stack-agnostic intent analysis with per-stack Beagle reviews and cross-stack merge\n- **Single-stack mode**: Use `--shallow` for a single Beagle skill review-fix-test loop\n- **Comment mode**: `--comment` posts inline review findings on the open PR; `--review` writes a report to terminal/markdown\n- **Stack-aware reviews**: Beagle skills load framework-specific knowledge (FastAPI patterns, React hooks, Phoenix lifecycle, etc.) as the reviewer encounters relevant code\n- **Codebase exploration**: Tree-sitter-powered pre-scan resolves imports and detects conventions to ground reviews in actual codebase context\n- **Intelligent parsing**: Extracts actionable issues from review output, skipping positive observations\n- **Automated fixes**: Applies fixes one-by-one with minimal changes\n- **PR feedback subcommand**: `daydream feedback \u003cpr#\u003e` fetches bot review comments, fixes them sequentially, and responds automatically\n- **Multi-backend support**: Claude (default) or OpenAI Codex, with per-phase backend overrides\n- **Parallel execution**: Up to 4 concurrent fix agents with live progress tracking\n- **Test validation**: Runs your test suite and offers interactive retry/fix options on failure\n- **Commit integration**: Optionally commits and pushes changes when complete\n- **ATIF v1.6 trajectory recording**: Every run produces a machine-parseable trajectory with automatic secret redaction\n- **Run archive**: Automatic archival to `~/.daydream/archive/` with SQLite index for cross-project querying\n- **Post-run evaluation**: Deterministic analysis of cost, grounding rate, file coverage, and finding quality\n- **Outcome labeling**: Tag archived runs as accepted/rejected/mixed for SFT/RL training datasets\n\n## Prerequisites\n\n- Python 3.12+\n- [uv](https://docs.astral.sh/uv/) package manager\n- [Claude Code](https://claude.ai/code) CLI\n- [Codex CLI](https://openai.com/codex) — required when using `--backend codex`\n- [GitHub CLI](https://cli.github.com/) (`gh`) — required for the `feedback` subcommand and `--comment` mode\n\n### Install Beagle\n\nDaydream requires the [Beagle](https://github.com/existential-birds/beagle) plugin for Claude Code.\n\n```bash\nclaude plugin marketplace add https://github.com/existential-birds/beagle\nclaude plugin install beagle\n```\n\nVerify by running `/beagle:` in Claude Code — you should see the command list.\n\n## Installation\n\n```bash\ngit clone https://github.com/existential-birds/daydream.git\ncd daydream\nuv sync\n```\n\n## Updating\n\n```bash\ncd daydream\ngit pull\nuv sync\n```\n\n## Usage\n\n```bash\n# Default: deep multi-stack review-fix-test loop\ndaydream /path/to/project\n\n# Single-stack loop (skip multi-stack auto-detection)\ndaydream --shallow /path/to/project\n\n# Force a specific Beagle skill instead of auto-detecting\ndaydream -s python /path/to/project\n\n# Review and post inline PR comments, then exit (no fix, no test)\ndaydream --comment --branch feat/my-feature /path/to/project\n\n# Review and write a report to terminal/markdown, then exit\ndaydream --review /path/to/project\n\n# Use Codex backend instead of Claude\ndaydream --backend codex /path/to/project\n\n# Fix bot review comments on a PR\ndaydream feedback 42 --bot \"coderabbitai[bot]\" /path/to/project\n\n# Label an archived run for training datasets\ndaydream label abc12345 --accepted\n```\n\n### More Examples\n\n```bash\n# Resume from a specific phase\ndaydream --shallow --start-at fix /path/to/project\n\n# Resume deep review from the per-stack stage\ndaydream --start-at per-stack /path/to/project\n\n# Mix backends per phase\ndaydream --backend codex --fix-backend claude /path/to/project\n\n# Override models per phase (defaults come from the per-backend table)\ndaydream --review-model claude-opus-4-6 --parse-model claude-haiku-4-5 /path/to/project\n\n# Force ephemeral worktree even without --branch\ndaydream --worktree /path/to/project\n\n# Generate an implementation plan and embed it in PR comments\ndaydream --comment --plan --branch feat/my-feature /path/to/project\n\n# Exclude paths from the diff\ndaydream --ignore-path .planning --ignore-path vendor /path/to/project\n\n# Run with evaluation analysis, skip archival\ndaydream --eval --no-archive /path/to/project\n\n# Write trajectory to a custom path\ndaydream --trajectory /tmp/run.json /path/to/project\n```\n\n### Command Line Options\n\n| Option | Description | Default |\n|--------|-------------|---------|\n| `TARGET` | Target directory | Prompt interactively |\n| `-s, --skill` | Force review skill: `python`, `react`, `elixir`, `go`, `rust`, `ios` | Auto-detect from changed files |\n| `-b, --backend` | Agent backend: `claude` or `codex` | `claude` |\n| `--review-backend` | Override backend for the review phase | `--backend` value |\n| `--fix-backend` | Override backend for the fix phase | `--backend` value |\n| `--test-backend` | Override backend for the test phase | `--backend` value |\n| `--review-model` | Override model for the REVIEW phase (default: per-backend table; see README). | Per-backend table (see below) |\n| `--parse-model` | Override model for the PARSE phase (default: per-backend table; see README). | Per-backend table (see below) |\n| `--fix-model` | Override model for the FIX phase (default: per-backend table; see README). | Per-backend table (see below) |\n| `--test-model` | Override model for the TEST phase (default: per-backend table; see README). | Per-backend table (see below) |\n| `--exploration-model` | Model for exploration subagents. Use a smaller model to save cost. | Per-backend table (see below) |\n| `--comment` | Review and post inline PR comments, then exit | |\n| `--review` | Review and write a report to terminal/markdown, then exit | |\n| `--shallow` | Single-stack review (skip multi-stack auto-detection) | |\n| `--branch BRANCH` | Branch to review | cwd's local HEAD |\n| `--base BASE` | Base ref to compare against | PR base if any, else `origin/HEAD` |\n| `--worktree` | Force ephemeral worktree even when `--branch` is omitted | |\n| `--copy PATH` | Extra path to copy into ephemeral worktree (repeatable) | |\n| `--plan` | Generate implementation plan and embed in PR comments (with `--comment`) | |\n| `--start-at` | Start at phase: `review`, `parse`\\*, `fix`, `test`\\*, `ttt`†, `per-stack`†, `merge`† | `review` |\n| `--loop` | Repeat review-fix-test cycle until zero issues or max iterations | |\n| `--max-iterations N` | Maximum loop iterations (only meaningful with `--loop`) | `5` |\n| `--trajectory \u003cpath\u003e` | Write trajectory to custom path | `\u003ctarget\u003e/.daydream/runs/\u003cid\u003e/trajectory.json` |\n| `--no-archive` | Disable automatic archival to `~/.daydream/archive/` | |\n| `--eval` | Run deterministic evaluation analysis and store in archive | |\n| `--ignore-path PATH` | Exclude path from diff (repeatable) | |\n| `--cleanup` | Remove `.review-output.md` after completion | |\n| `--no-cleanup` | Keep `.review-output.md` after completion | |\n\n\\* `parse` and `test` are valid only with `--shallow`.\n† `ttt`, `per-stack`, `merge` are valid only in deep (default) mode.\n\n### Per-phase model defaults\n\nEach phase resolves its model in this order: explicit per-phase flag → per-backend phase default (below) → backend default. Phases without an override flag (WONDER, ENVISION, MERGE, INTENT, PR_FEEDBACK) still resolve through the per-backend table — they get phase-appropriate models without a knob.\n\n**Claude backend:**\n\n| Phase | Default model |\n|-------|---------------|\n| `parse` | `claude-haiku-4-5` |\n| `fix` | `claude-sonnet-4-6` |\n| `test` | `claude-sonnet-4-6` |\n| `exploration` | `claude-sonnet-4-6` |\n| `review` | `claude-opus-4-6` |\n| `wonder` | `claude-opus-4-6` |\n| `envision` | `claude-opus-4-6` |\n| `merge` | `claude-opus-4-6` |\n| `intent` | `claude-opus-4-6` |\n| `pr_feedback` | `claude-opus-4-6` |\n\n**Codex backend:**\n\n| Phase | Default model |\n|-------|---------------|\n| `parse` | `gpt-5.5` |\n| `fix` | `gpt-5.5` |\n| `test` | `gpt-5.5` |\n| `exploration` | `gpt-5.5` |\n| `review` | `gpt-5.5` |\n| `wonder` | `gpt-5.5` |\n| `envision` | `gpt-5.5` |\n| `merge` | `gpt-5.5` |\n| `intent` | `gpt-5.5` |\n| `pr_feedback` | `gpt-5.5` |\n\nThe codex table uses `gpt-5.5` for every phase in v1; per-phase tiering for codex is deferred to a future release once concrete model picks across the codex lineup are settled.\n\n### Subcommands\n\n#### `daydream feedback`\n\nFetch bot review comments from a GitHub PR, fix them, and respond.\n\n```bash\ndaydream feedback \u003cpr#\u003e --bot \u003cBOT_NAME\u003e [TARGET]\n```\n\n| Argument | Description |\n|----------|-------------|\n| `pr#` | Pull request number to process |\n| `--bot BOT_NAME` | Bot username to filter PR comments (e.g. `coderabbitai[bot]`) |\n| `TARGET` | Target directory (default: current directory) |\n\n#### `daydream label`\n\nUpdate outcome labels on an archived run for SFT/RL training datasets.\n\n```bash\ndaydream label \u003csession_id\u003e --accepted|--rejected|--mixed\n```\n\n| Argument | Description |\n|----------|-------------|\n| `session_id` | Session ID (full UUID or prefix) |\n| `--accepted` | Label run as accepted |\n| `--rejected` | Label run as rejected |\n| `--mixed` | Label run as mixed |\n\n## How It Works\n\nDaydream has four output modes selected by flag combinations:\n\n- **Default loop** (no flag): full review → fix → test cycle\n- **`--comment`**: review and post inline PR comments, then exit\n- **`--review`**: review and write a report, then exit\n- **`daydream feedback \u003cpr#\u003e`**: ingest bot PR comments and fix them\n\nWithin the loop mode, `--shallow` opts into a single-stack review-fix-test pipeline; the default is the deep multi-stack pipeline. All modes support multiple backends (Claude and Codex), including per-phase overrides.\n\n### Deep Review (default)\n\nA five-stage pipeline that combines stack-agnostic intent analysis with parallel per-stack Beagle reviews and a cross-stack merge. Use `--start-at` to resume from a specific stage.\n\n1. **Exploration pre-scan**: Tree-sitter import resolution and convention detection (auto-skipped for trivial diffs)\n2. **Intent (`ttt`)**: Understands the git diff and commit history to build context\n3. **Alternative review**: Identifies potential improvements as numbered issues\n4. **Per-stack reviews**: Parallel Beagle skill invocations, one per detected stack (Python, TypeScript, Go, etc.)\n5. **Cross-stack merge**: Synthesizes per-stack findings into a unified review with deduplication\n\nAfter the merge, an optional fix gate offers test/commit/push phases.\n\n### Shallow Review (`--shallow`)\n\nA single-skill four-phase workflow. Use `--start-at` to resume from a specific phase.\n\n#### Phase 1: Review\n\nInvokes the resolved Beagle review skill (e.g., `beagle-python:review-python`). The review output is written to `.review-output.md` in the project root.\n\n#### Phase 2: Parse Feedback\n\nExtracts actionable issues from the review output as structured JSON. Positive observations and summary sections are filtered out.\n\n**Note:** `--start-at parse` requires an existing `.review-output.md` file.\n\n#### Phase 3: Apply Fixes\n\nFor each actionable issue:\n\n1. Displays the issue description, file, and line number\n2. Prompts the agent to apply the minimal fix needed\n3. Shows progress as fixes are applied\n\n**Note:** `--start-at fix` requires an existing `.review-output.md` file.\n\n#### Phase 4: Test and Heal\n\nRuns your project's test suite. On failure, offers interactive options:\n\n- **Retry tests**: Run again without fixes\n- **Fix and retry**: Launch the agent to analyze and fix failures\n- **Ignore**: Mark as passed and continue\n- **Abort**: Exit with failure status\n\nAfter tests pass, optionally commit and push changes.\n\n**Note:** `--start-at test` skips all other phases and runs tests directly.\n\n### Comment / Review Modes\n\n`--comment` and `--review` run a three-phase conversational review:\n\n1. **Understand intent**: Explores the git diff and commit history to build context\n2. **Evaluate alternatives**: Reviews the changes and identifies potential improvements as numbered issues\n3. **Generate plan** (optional): With `--plan`, writes an implementation plan to `.daydream/plan-{timestamp}.md`\n\n`--comment` then posts the issues as inline review comments on the open PR for the current branch (use `--branch` to point at a specific branch). `--review` writes the report to terminal/markdown and exits without posting.\n\n### PR Feedback Subcommand\n\n`daydream feedback \u003cpr#\u003e --bot \u003cname\u003e` resolves bot review comments on a PR:\n\n1. **Fetch**: Pulls bot comments from the PR via the `fetch-pr-feedback` Beagle skill\n2. **Parse**: Extracts actionable issues (reuses the shallow-mode parser)\n3. **Fix**: Applies fixes sequentially, one issue at a time\n4. **Commit \u0026 Push**: Automatically commits and pushes all changes\n5. **Respond**: Posts fix results back on the PR as comment replies\n\n## Output Files\n\n| File | Description |\n|------|-------------|\n| `.review-output.md` | Review results (removed with `--cleanup`, required for `--start-at parse/fix`) |\n| `.daydream/runs/\u003cid\u003e/trajectory.json` | ATIF v1.6 trajectory (customize path with `--trajectory`) |\n| `.daydream/trajectories/` | Forked sub-trajectories from parallel fan-outs (fix-parallel, deep, exploration) |\n| `.daydream/diff.patch` | Unified git diff captured at run start |\n| `.daydream/plan-{timestamp}.md` | Implementation plan (created by `--comment --plan` and `--review`) |\n| `.daydream/deep/` | Deep pipeline artifacts: intent, per-stack reviews, merged report (default mode) |\n\n### Archive\n\nUnless `--no-archive` is passed, each run is automatically archived to `~/.daydream/archive/runs/{session_id}/` with:\n\n| File | Description |\n|------|-------------|\n| `manifest.json` | Run metadata, git context, backend config, token/cost metrics |\n| `trajectory.json` | Copy of the run trajectory |\n| `review-output.md` | Copy of review findings |\n| `evaluation.json` | Deterministic evaluation results (only with `--eval`) |\n| `deep/` | Deep artifacts copy (default mode) |\n| `diff.patch` | Diff copy |\n\nA SQLite index at `~/.daydream/archive/index.db` enables cross-project querying by repo, backend, cost, grounding rate, and outcome labels.\n\n## Trajectory Output\n\nEvery daydream run produces an [ATIF v1.6](https://www.harborframework.com/docs/agents/trajectory-format) trajectory file at `\u003ctarget\u003e/.daydream/runs/\u003cid\u003e/trajectory.json`. The trajectory captures the full agent interaction history — prompts, responses, tool calls, observations, and per-step token/cost metrics. Use `--trajectory \u003cpath\u003e` to write to a custom location.\n\nSensitive content is automatically redacted before writing: API keys (`sk-*`, `ghp_*`, `xoxb-*`, `AKIA*`), JWT tokens, URL credentials, username segments in file paths, and `.env`-style secret values are replaced with type-specific `[REDACTED_*]` tokens. Interrupted runs (SIGINT/SIGTERM) flush a `\u003cpath\u003e.partial` file with `extra.partial=true` so consumers can detect incomplete trajectories.\n\n**Consumer integration:**\n- Validate trajectories with [Harbor](https://github.com/laude-institute/harbor)'s trajectory validator\n- Replay in any ATIF-compatible viewer\n- Use as training data for SFT/RL pipelines (trajectories are machine-parseable by design)\n- Label outcomes with `daydream label` for supervised fine-tuning datasets\n\n\n\n## License\n\nApache License 2.0. See [LICENSE](LICENSE) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexistential-birds%2Fdaydream","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fexistential-birds%2Fdaydream","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexistential-birds%2Fdaydream/lists"}