NEEDLE AGENTS.md

Project instructions for NEEDLE, a Rust worker that claims queued work, sends it to a coding agent, records activity, and tracks each result through defined states.

In plain words
What is it for?
They guide safe changes, backend selection, work claiming, agent dispatch, telemetry, and state handling in NEEDLE.
Why use it?
They prevent workers from using the wrong task database or outdated commands and help preserve correctness when several workers share a repository.

Instructions file for CodexOpenCode

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/jedarden/needle/agents-md
Clone the repo
git clone --depth 1 https://github.com/jedarden/NEEDLE

Made for: Codex, OpenCode.

Per session 2,783 This file is loaded in full into every session.
When invoked 2,783 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.02783 $0.02783
Opus 5 $0.01392 $0.01392
Sonnet 5 $0.00557 $0.00557
Haiku 4.5 $0.00278 $0.00278

Measured 2d ago against content hash de1139920380, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

NEEDLE AGENTS.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

AGENTS.md · 256 lines

How it starts

The opening of the file, as written. The whole thing — 256 lines — stays where its author put it; the contents beside it link to each section on GitHub.

NEEDLE Codex Guide

This file is the primary operating guide for Codex in this repository, both in interactive sessions and when Codex runs headlessly as a NEEDLE worker. Inspect the current repository state and the relevant source before relying on older examples or planning documents.

Project Overview

NEEDLE (Navigates Every Enqueued Deliverable, Logs Effort) is a Rust worker binary. It selects and claims work through the repository's configured bead backend, dispatches a coding agent, records telemetry, and routes every outcome through an explicit state machine.

The primary backend is bead-rs (bead); bead-forge (bf) remains supported for explicitly bound legacy workspaces. Check .needle.yaml and the .beads/ layout before running either CLI. Do not infer the backend from which binaries happen to be installed, and never use one backend's repair or import command on the other backend's database. br is retired and must not be introduced in source, prompts, scripts, tests, or documentation.

Working Safely

  • Inspect git status --short before editing. Preserve unrelated user and worker changes in a dirty worktree.
  • Multiple NEEDLE workers may share the same repository. Re-check files before modifying them and avoid broad rewrites that can overwrite concurrent work.
  • Do not create per-worker git worktrees to isolate concurrent workers — a shared checkout is the intended model, not a bug to route around. Worktrees add disk and build-cache duplication without addressing the actual failure mode, which happens at the bead level: the same bead getting claimed and worked twice (confirmed 2026-08-09, commitgraph cg-l0v0kc — two byte-identical commits at the same second from two concurrent workers). The supported backends provide atomic claim operations, so avoid this by decomposing and dependency-ordering beads so the same unit of work is never independently claimable twice — see the target repo's own AGENTS.md for repo-specific guidance.
  • A disposable clone under ~/scratch is the same thing as a worktree for this purpose, and the rule above covers it. git clone into a mktemp -d is the usual way this rule gets routed around: it satisfies the letter (no git worktree) while costing the identical disk. On 2026-08-21 there were 241 of them on ex44 — ~/scratch at 95G, each a full clone plus a Rust target/ — and the root filesystem reached 100%, which fails writes with ENOSPC for every agent on the box, not just the one that filled it. Work in the shared checkout. If a disposable checkout is genuinely warranted, the thing that creates it owns removing it: mktemp -d with a trap that cleans on success and deliberately leaves the tree on failure for diagnosis. Do not file cleanup as its own bead — fleet workers share no filesystem, so a cleanup bead can be claimed by a worker that cannot see the directory. A startup sweep is the backstop (needle-f40a5de7).
  • Do not use destructive Git operations (reset --hard, forced checkout, forced push) to resolve unrelated changes.
  • Forgejo (git.ardenone.com) is the authoritative remote. GitHub is a mirror. Push only to the configured origin, and never use --force or --force-with-lease.
  • Keep commands suitable for unattended execution: avoid prompts, pagers, and commands that require an interactive terminal.
  • Treat docs/plan/plan.md as architecture and design history. Verify current behavior in source and against the installed CLI before depending on old command examples.

Read the full file on GitHub · 256 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 256 lines · 2,783 tokens per session scan A de1139920380

Subscribe to this mod's changes

NEEDLE AGENTS.md is an instructions file published in the GitHub repository jedarden/NEEDLE (18 stars, last pushed 2d ago), licensed MIT. It adds 2,783 tokens to every session, about $0.0139 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.