NEEDLE: Instructions file for Codex

AGENTS.md

NEEDLE AGENTS.md is an instructions file for Codex, OpenCode from jedarden/NEEDLE. It costs 3,770 tokens per session, scanned A, original, MIT.

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

Written for Codex and OpenCode: the file is AGENTS.md. Also seen: mentions AGENTS.md; mentions Codex.

This is jedarden/NEEDLE's own configuration. It tells Codex and OpenCode how to work on NEEDLE itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything NEEDLE configures →

Reuse

Borrowing it

Nothing to install: this file belongs to jedarden/NEEDLE. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/jedarden/NEEDLE/main/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/jedarden/NEEDLE

Made for: Codex, OpenCode.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for NEEDLE AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/jedarden/needle/agents-md/github.svg)](https://agentmods.dev/instructions/jedarden/needle/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/jedarden/needle/agents-md"><img src="https://agentmods.dev/badge/instructions/jedarden/needle/agents-md/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for NEEDLE AGENTS.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/jedarden/needle/agents-md"><img src="https://agentmods.dev/badge/instructions/jedarden/needle/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 3,770 This file is loaded in full into every session.
When invoked 3,770 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.03770 $0.03770
Opus 5.5 $0.01508 $0.01508
Sonnet 5.5 $0.00754 $0.00754
Haiku 4.5 $0.00377 $0.00377

Measured 21d ago against content hash 54d43e05f58d, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 21d 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 · 324 lines

How it starts

The opening of the file, as written. The whole thing — 324 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.
  • Never advance a branch ref without its tree. In a shared checkout, do not move main (or any branch) with git update-ref, git reset --soft, or git branch -f. Each moves the ref and leaves the index and working tree where they were, so every file the skipped commits changed now reads as a staged revert of them, and the next pathspec commit of such a file silently undoes another worker's commit. Workers did exactly this to ~/NEEDLE (git update-ref refs/heads/main <origin/main>, about twenty times from 2026-10-07) and left the checkout 85 files and 9,959 lines behind HEAD by 2026-10-16 (needle-8879251b). To pick up origin/main, run git merge --ff-only origin/main, which moves the ref, index and worktree together; if local commits have diverged, reconcile with a merge commit, never a rebase or a force-push. If a dirty tree or staged files block the merge, stop and report the blocking paths on the bead — do not move the ref by hand, and do not stash, reset or check out other workers' files to clear the way. needle audit reports a checkout whose tracked files hold older committed content than HEAD as F7_STALE_TREE_DRIFT.
  • 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 · 324 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. 21d ago Changed · +16 lines · +316 tokens per session 54d43e05f58d
  2. 27d ago Changed · +3 lines · +47 tokens per session 6de9cd3ae64f
  3. 1mo ago Changed · -1 lines · -2 tokens per session 9200fb6bbf1b
  4. 1mo ago Changed · +16 lines · +157 tokens per session 1211ebba8c62
  5. 1mo ago Changed · +4 lines · +79 tokens per session 6a71d8a04b05
  6. 1mo ago Changed · +7 lines · +90 tokens per session 84f1a1b163a5
  7. 2mo ago Changed · +3 lines · +38 tokens per session 312d1f468145
  8. 2mo ago Changed · +20 lines · +262 tokens per session 3e8f36decc99
  9. 2mo 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 (33 stars, last pushed 2d ago), licensed MIT. It adds 3,770 tokens to every session, about $0.0151 per session on Opus 5.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.

Related

NEEDLE AGENTS.md compared with instructions from other repositories

NEEDLE AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
NEEDLE AGENTS.mdjedarden/NEEDLEInstructions file332d agoMITA3,770Codex, OpenCode
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143kyesterdayMITA7,461Codex, OpenCode
langchain AGENTS.mdlangchain-ai/langchainInstructions file149kyesterdayMITA4,680Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA5,516GitHub Copilot
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA3,093GitHub Copilot
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file274k2d agoMITA4,313Codex, OpenCode