{"id":47619947,"url":"https://github.com/takezoh/loki","last_synced_at":"2026-04-01T21:58:54.505Z","repository":{"id":344030340,"uuid":"1180050191","full_name":"takezoh/Loki","owner":"takezoh","description":"Automate the full dev cycle—from Linear issue to PR—by autonomously investigating, planning, implementing, and handling reviews with Claude Code.","archived":false,"fork":false,"pushed_at":"2026-03-15T08:56:47.000Z","size":245,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-15T13:59:28.809Z","etag":null,"topics":["ai-agent","automation","claude-code","github-pr","linear"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/takezoh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"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-03-12T16:42:38.000Z","updated_at":"2026-03-15T08:56:50.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/takezoh/Loki","commit_stats":null,"previous_names":["takezoh/forge","takezoh/linear-autopilot","takezoh/loki"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/takezoh/Loki","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takezoh%2FLoki","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takezoh%2FLoki/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takezoh%2FLoki/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takezoh%2FLoki/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/takezoh","download_url":"https://codeload.github.com/takezoh/Loki/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takezoh%2FLoki/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31292631,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-01T21:15:39.731Z","status":"ssl_error","status_checked_at":"2026-04-01T21:15:34.046Z","response_time":53,"last_error":"SSL_read: 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":["ai-agent","automation","claude-code","github-pr","linear"],"created_at":"2026-04-01T21:58:53.513Z","updated_at":"2026-04-01T21:58:54.497Z","avatar_url":"https://github.com/takezoh.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Loki\n\nAutomate the full dev cycle—from Linear issue to PR—by autonomously investigating, planning, implementing, and handling reviews.\n\nTriggered by Linear status changes, Loki runs Claude Code CLI in isolated worktrees to execute each phase of the workflow.\n\nTwo-process architecture:\n\n- **Forge** — Polling daemon. Periodically polls Linear for status changes and dispatches tasks for execution\n- **Sleipnir** — Webhook server. Receives webhooks from the Linear Agent API and relays tasks to Forge via a file-based queue\n\nEach task runs in an isolated Git worktree inside Claude Code's sandbox.\n\n![Linear issue with sub-issues managed by Loki](docs/images/linear-sub-issues.png)\n\n## Linear Setup\n\n### GitHub Integration\n\nConnect at Settings → Integrations → GitHub. Required for automatic PR syncing.\n\n### Issue Statuses\n\nAdd the following statuses at Settings → Teams → Issue statuses \u0026 automations:\n- Planning, Pending Approval, Implementing, Changes Requested, Failed\n\n(Backlog, In Review, Done, Cancelled exist by default in Linear)\n\n### OAuth App (Agent API / Webhook)\n\n1. Settings → Account → API → OAuth applications → Create\n2. Enter application name and redirect URL\n3. Webhook URL: `https://\u003cserver\u003e:3000/webhook`\n4. Set webhook secret → `LINEAR_WEBHOOK_SECRET`\n5. Generate actor token (actor=application) → `LINEAR_OAUTH_TOKEN`\n6. Enable agent features: Manage → Enable agent features\n\n## Prerequisites\n\n- Python 3.10+\n- Node.js (for Linear MCP server via `npx`)\n- [Claude Code](https://claude.com/claude-code) CLI\n- [GitHub CLI](https://cli.github.com/) (`gh`)\n- [Linear](https://linear.app/) account\n- `bubblewrap` and `socat` (for sandbox)\n\n```bash\n# Ubuntu/Debian\nsudo apt-get install bubblewrap socat\n```\n\n### Configuration\n\n1. Copy example configs:\n   ```bash\n   cp config/settings.json.example config/settings.json\n   cp config/secrets.env.example config/secrets.env\n   cp config/repos.conf.example config/repos.conf\n   ```\n\n2. Edit `config/settings.json`:\n   - `team` — Linear team name (required; `team_id` is resolved automatically via API)\n   - `log_dir`, `lock_dir`, `worktree_dir` — directory paths (required)\n   - Optional: `model`, `budget`, `max_turns`, `max_concurrent`, `sandbox`\n\n3. Edit `config/secrets.env` — set `LINEAR_OAUTH_TOKEN` (and `LINEAR_WEBHOOK_SECRET` if using Webhook)\n\n4. Edit `config/repos.conf` — map labels to repository paths:\n   ```\n   myproject=/home/user/dev/myproject\n   ```\n\n5. Add the Linear MCP server to Claude Code:\n   ```bash\n   claude mcp add -s user linear-server -- npx -y @anthropic-ai/linear-mcp-server\n   ```\n\n6. Authenticate the Linear MCP server:\n   Launch Claude Code and run `/mcp` to open the MCP authentication flow, then authorize the `linear-server` connection with your Linear account.\n\n## Usage\n\n```bash\nbin/forge.sh --check    # check environment\nbin/forge.sh            # start polling daemon\nbin/sleipnir.sh         # webhook server\n```\n\n### systemd (Linux)\n\n```bash\n# Polling service\nbin/service-systemd.sh register-polling\nbin/service-systemd.sh start-polling\nbin/service-systemd.sh logs-polling\n\n# Webhook service\nbin/service-systemd.sh register-webhook\nbin/service-systemd.sh start-webhook\nbin/service-systemd.sh logs-webhook\n```\n\n### launchd (macOS)\n\n```bash\nbin/service-launchd.sh register\nbin/service-launchd.sh enable\nbin/service-launchd.sh start\nbin/service-launchd.sh logs\n```\n\n## Workflow\n\n```mermaid\nstateDiagram-v2\n    [*] --\u003e Planning : Issue created / status change\n    Planning --\u003e PendingApproval : Plan needs human review\n    Planning --\u003e Implementing : Plan auto-approved\n    PendingApproval --\u003e Planning : Human moves back to Planning\n    PendingApproval --\u003e Implementing : Human approves\n    Implementing --\u003e InReview : All sub-issues done + PR created\n    InReview --\u003e ChangesRequested : Human requests changes\n    ChangesRequested --\u003e InReview : Agent applies fixes\n    InReview --\u003e Done : Human merges PR\n\n    PendingApproval: Pending Approval\n    InReview: In Review\n    ChangesRequested: Changes Requested\n```\n\n| Status | Category | Actor | Description |\n|--------|----------|-------|-------------|\n| Backlog | Backlog | Human | Not started |\n| Planning | Started | Agent | Creating sub-issues and plan |\n| Pending Approval | Started | Human | Reviewing the plan |\n| Implementing | Started | Agent | Building + PR creation |\n| In Review | Started | Human | Reviewing PRs |\n| Changes Requested | Started | Agent | Fixing PR review feedback |\n| Failed | Started | Auto | Execution failed |\n| Done | Completed | Auto | Completed |\n| Cancelled | Cancelled | Human | Cancelled |\n\n## Models\n\n| Role | Model | Rationale |\n|------|-------|-----------|\n| Planner | Sonnet + Opus subagent | Sonnet orchestrates, Opus subagent for codebase analysis |\n| Plan Reviewer | Sonnet + Opus subagent | Sonnet orchestrates, Opus subagent for re-investigation |\n| Conductor | Sonnet | Orchestrates implementer + reviewer, commits results |\n| Implementer | Sonnet | Code generation, speed and cost balance |\n| Reviewer | Opus | Deep reasoning for bug and design issue detection |\n| PR Description | Haiku | Simple text generation, low cost |\n\n## Sandbox\n\nEach Claude CLI execution runs with [Claude Code's native sandbox](https://code.claude.com/docs/en/sandboxing).\nConfigure sandbox settings in `claude.sandbox` in `settings.json` (see `settings.json.example`).\n`setup_sandbox` dynamically adds log directory and parent repo's `.git/worktrees` to `allowWrite`. Sub-issue execution also adds the parent issue's worktree directory.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftakezoh%2Floki","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftakezoh%2Floki","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftakezoh%2Floki/lists"}