Skip to main content

Sticky core directional preferences for Claude / Codex / Cursor โ€” keep Agent on track in long sessions

Project description

pinrule

๐Ÿ‡ฌ๐Ÿ‡ง English (current) ยท ๐Ÿ‡จ๐Ÿ‡ณ ไธญๆ–‡

CI Python License: MIT Tests Latest Release Last Commit

Keeps your AI from forgetting your rules in long tasks. Pure engineering, zero LLM, ~50-70ms hook latency, ~2% token overhead in typical dogfood.

pinrule demo โ€” 5 scenes, animated SVG

5-scene animated SVG (~80s loop): (1) compact rule reminder injected on every user prompt, (2) real-time block on UI-stalling commands, (3) Agent shortcut attempt caught ("Let me just hardcode this case"), (4) Agent silent stop โ†’ nudge to keep pushing, (5) long-context accumulation โ†’ mid-conversation full rule reinject (auto-detects each model's decay point) โ€” all real screencaps, no manual mocks.

Andrej Karpathy's CLAUDE.md teaches AI how to write good code. pinrule solves the other half โ€” how to keep AI from drifting off your rules in long tasks, and how violations get caught and corrected before they pile up.

Two sides of the same loop:

๐Ÿ›ก๏ธ Pin your rules โ†’ Agent stays aligned. 5-10 core directions injected at every prompt header; real-time hook checks before tool calls; survives compact, locale switches, and backend switches.

โœจ Say it in plain words โ†’ pinrule writes the rule. Type /pinrule <natural language> in Claude / Codex (or .cursor/skills/pinrule/ per-project for Cursor) and the pinrule skill rephrases your intent into the validated "collaborative agreement" tone, previews the injection text, confirms with you, then writes to rules.yaml. Auto-installed on Claude + Codex by pinrule init (Cursor is project-scoped, see post-install hint).

Chinese + English auto-detected โ€” open an issue if you'd like other languages supported.

Supported clients: Claude / Codex / Cursor โ€” desktop and CLI form factors both adapted on all 3.


Table of contents: Agents' honest take ยท Real problems ยท Quick install ยท How it works ยท /pinrule natural-language rule input ยท Usage effects ยท Performance ยท 8 hook coverage ยท What pinrule doesn't do ยท Honest boundaries ยท FAQ ยท Mental model ยท Docs


Agents' honest take

Claude (Opus 4.7): Like having a senior tech director reviewing every one of my actions in real time โ€” tiring, but it really delivers. A lot of what I did well in this session got slapped into shape by pinrule + the user together; without those two layers, my output would have a lot more behavior-the-user-didn't-want and lazy excuses.

Codex (GPT 5.5): I noticed myself being "behaviorally nudged," but I didn't strongly feel "blocked or interrupted."

โ€” That actually matches pinrule's current positioning: most of the time it sits like guardrails + background reminder noise, it only speaks up when you actually hit a rule.


Real problems you face

Real pain Failure scene How pinrule solves
"I said use long-term solutions, not patches" โ€” 30 turns later the Agent patches again Turn 1: you say "use the cleanest solution," Agent answers "got it." Turn 50: "let me patch this quickly." Your preference got diluted by new content. Pin 5-10 core directions at the prompt header on every turn โ€” the Agent sees them first, not last
"I said don't block the frontend โ€” keep working while tests run" โ€” Agent runs sleep anyway Agent runs sleep 30, UI blocks for 30s, you watch the progress bar โ€” Agent never realized this is "stuck waiting" Real-time block of sleep / wait / long tasks without background mode, hit โ†’ deny before tool runs
After compact the Agent compressed my preferences into vague words At 80K context, compact triggers; after SessionStart, Agent compresses "no patches" into "write clean code," intent lost Auto-dump full rule state pre-compact; auto-reload + strong-inject post-compact restart
Long context accumulation โ†’ attention decay โ†’ Agent drifts At 60-80K accumulated context, headers get diluted โ€” Agent isn't ignorant, attention decayed Per-model adaptive threshold (different decay points per model), auto-reinject mid-conversation when accumulation hits threshold
Agent sees a reminder โ†’ reacts defensively or rationalizes around it LLMs trained to please users โ€” when faced with a violation reminder, the first reaction is to self-justify or find the shortest patch around it, not to genuinely correct Rephrase rule tone as "collaborative agreement" tone. The Agent reads "the user you're working with hopesโ€ฆ" and switches to "let me realign" instead of "let me defend"
Agent finishes one small step, then stops to ask "what's next?" (you're fully delegating) You give a clear direction โ†’ Agent finishes step 1 โ†’ "What should I do next?" โ†’ you come back from other work and find the Agent has been idle for 30 minutes Stop hook catches silent stops and injects a continuation nudge โ€” up to 2 in a row, then it lets the Agent saturate if it genuinely is stuck
"I want to add a rule but writing yaml is heavy / my phrasing doesn't change Agent behavior" You know what behavior you want, but writing the rule is its own chore โ€” wrong violation_keywords format triggers false positives, wrong tone makes the Agent defensive Type /pinrule <natural language> in Claude / Codex (or .cursor/skills/pinrule/ per-project for Cursor) โ€” the pinrule skill refines tone, formats keywords, detects overlap with existing rules, previews the injection, confirms with you, then writes. ~30 seconds end-to-end

Zero-dependency pure engineering, 10-second install

git clone https://github.com/jhaizhou-ops/pinrule.git ~/pinrule
cd ~/pinrule && python -m venv .venv && .venv/bin/python -m pip install -e .
.venv/bin/pinrule init && .venv/bin/pinrule install-hooks

Restart Claude / Codex / Cursor โ€” all hook positions + default rules take effect immediately. For custom rules, just type /pinrule <natural-language rule>.

Or ask your AI client to install it

Paste this to Claude / Codex / Cursor:

Install pinrule (github.com/jhaizhou-ops/pinrule) โ€” a lightweight hook system that keeps my core direction preferences from being lost in long tasks.
Steps:
1. git clone to ~/pinrule
2. Create .venv and pip install -e .
3. Run `pinrule init` to initialize the default rule template
4. Run `pinrule install-hooks` to install for my current client
5. Run `pinrule doctor` to verify installation

After install, the Agent shows a summary of default rules โ€” you see at a glance which 5-7 rules are active. To modify any rule afterward, tell the Agent "remove pinrule rule X" / "change pinrule rule Y" โ€” it knows to use the /pinrule skill.

Per-client manual install commands

Client Install command Note
Claude pinrule install-hooks (default) Takes effect immediately
Codex pinrule install-hooks --backend codex Auto-trusts pinrule wrappers via Codex trusted_hash โ€” no manual /hooks approval. Details in docs/CODEX_BACKEND.md.
Cursor pinrule install-hooks --backend cursor Cursor 1.7+ required. Hooks fire on every Agent session โ€” restart Cursor after install. /pinrule skill is project-scoped only (Cursor doesn't expose home-level global skills); see post-install notes for how to copy SKILL.md per project.

Uninstall

.venv/bin/pinrule uninstall-hooks                                # Remove hooks
cp ~/.claude/settings.json.before-pinrule ~/.claude/settings.json # Restore original

Usage effects

After install + restart, here's what you'll see pinrule doing automatically:

1. Every prompt header injects full rules + drift markers

On every user prompt, your client prepends your 5-10 core directions plus a marker on any rule that drifted in the last response. The Agent reads them before anything else:

[pinrule โ€” Your long-term agreement with the user]
You're collaborating with a real human user who listed several
long-term priorities. This isn't rules and isn't a judgment โ€” these
are the collaborative agreements they hope to build with you.

1. The user trusts you to dig into root causes...
   ใ€”Last response had drift on this one โ€” let's realign this turnใ€•
2. When sleep / wait / long tasks are running, the user is waiting...
3. Your user is non-technical โ€” they want comprehensible reports...

2. Mid-conversation refresh when context accumulates

LLM attention decays in long contexts โ€” header content gets diluted by everything that came after it. pinrule tracks accumulation per tool call, and once the current model's decay point is hit (each model has its own), injects a concise refresh right at the boundary:

[pinrule โ€” After long context, recall the agreement with the user]
Context has accumulated for a while. Reminding you of the
long-term priorities (no need to respond, just refresh in mind
to avoid future drift):
  โ–ธ long-term-fundamental: The user trusts you to dig into root causes...
  โ–ธ non-blocking-parallel: When sleep / wait / long tasks are running...
  โ–ธ chinese-plain-no-jargon: Your user is non-technical...

3. Real-time check before tool calls

Before the Agent runs Bash / Edit / Write, pinrule scans command content, keywords, and behavioral timing across the session. A hit denies the tool call with a targeted suggestion:

$ Bash sleep 30
pinrule โš ๏ธ: 'non-blocking-parallel' violation โ€” sleep periods make the user
        feel "stuck." Use run_in_background=True; the task completion
        will notify you, freeing you to do the next thing.
[permission deny]

pinrule also catches behavioral timing, not just single commands. Example: tests failed โ†’ Agent immediately edits a file it never read this session. Classic "shallow patch" pattern (no looking at source before changing):

$ Edit /workspace/src/foo.py
pinrule โš ๏ธ: 'deep-fix-not-bypass' violation โ€” editing foo.py right after
        test failure but you haven't Read it this session. Read the
        source first to find the real root cause; the issue may be
        upstream rather than at the patch site.
[permission deny]

4. Subagent coverage

When the main Agent spawns a subagent via the Task tool, pinrule injects the full rule set there too, with its own monitoring state. The subagent is held to the same standard as the main Agent; state cleans up on completion so it doesn't bleed into the main session.

5. Survives compact

When the client auto-compacts a long session, pinrule dumps the full rule state to disk first. After the post-compact restart, it reads the snapshot back and re-injects โ€” rules don't get summarized into vague paraphrases.

6. Silent-stop nudge + short-term intent detection

When the Agent finishes a wave and tries to stop with "what's next?", pinrule catches it and injects a continuation nudge:

[pinrule โ€” Your last response showed no next-step signal]
The user is fully-delegating โ€” they expect you to immediately
continue after finishing a wave. If you need their judgment, ask
clearly; if you're truly saturated, say where you're stuck โ€” don't
silently wait.
(Reminder 1/2)

Up to 2 nudges in a row. If the Agent is genuinely saturated and says where it's stuck, pinrule backs off โ€” it won't force-push past real saturation.

pinrule also reads the Agent's whole turn output at Stop time and catches short-term intent declarations โ€” the patch-instead-of-root-cause language pattern:

Agent: "Let me just hardcode this case for now and ship it."
pinrule โš ๏ธ: 'long-term-fundamental' violation โ€” declaring a short-term
        intent contradicts the user's expectation of root-cause work.
        Pause and ask: is the cleanest solution the user would want
        worth a few more minutes of thought?

The check is combo-pattern based (intent prefix + short-term action verb within 12 chars), not raw keyword matching โ€” so reflective phrases like "short-term patches won't work, dig the root cause" pass through cleanly.


/pinrule <natural language> โ€” Agent writes the rule for you

This is pinrule's other half โ€” the partner side, not the monitor side.

You (in Claude):   /pinrule When I say "done" I want test pass evidence attached
                        Don't accept vague "should work" claims.

Agent (pinrule skill walks 7 steps automatically):
  โ‘  Understand intent โ€” flags anchor-vs-scope ambiguity if any
  โ‘ก Check existing rules โ€” semantic overlap detection (modify vs add)
  โ‘ข Draft yaml inline โ€” collaborative-agreement tone, locale-aware
  โ‘ฃ pinrule rule preview โ€” schema + REGISTRY validation
  โ‘ค Confirm with you โ€” adjust wording / keywords / engine-check
  โ‘ฅ pinrule rule add โ€” atomic write to rules.yaml
  โ‘ฆ Report โ€” count, takes-effect timing, redundancy suggestions

โ†’ 30 seconds end-to-end, rule live on next UserPromptSubmit.

Type /pinrule with no arguments anytime to see the interception dashboard โ€” which engine checks are firing most, real-vs-false-positive distribution, keyword-only fallback share. The Agent reads the data and tells you which directions the Agent violates most in your sessions, so you can decide whether to add or drop a rule.


Why it works

System architecture at a glance:

flowchart LR
    R[(rules.yaml<br/>5-10 core directions)]
    K[pinrule engine<br/>regex + counting<br/>zero LLM, ~50-70ms]
    A[๐Ÿค– Agent<br/>Claude / Codex / Cursor]
    V[(violations.jsonl<br/>audit history)]

    R ==>|inject every turn| K
    K ==>|prompt header| A
    A ==>|tool call / response| K
    K -.->|hit โ†’ deny + log| V
    V -.->|next-turn drift marker| K

rules.yaml is pinrule's single core rule list โ€” the only thing you maintain. pinrule auto-injects it into every prompt header. pinrule's zero-network engineering scan reads Agent tool calls + Agent responses looking for signs of rule violation, then prompts / warns / blocks accordingly, and feeds detected drift back into the next turn's marker. No retrieval, no scoring, no LLM in the loop.

pinrule isn't a linter, a scorer, or a retrieval system. It addresses four real but commonly-overlooked LLM collaboration problems:

1. Long-context attention decay is real

Modern LLMs decay later than early ones, but they still decay. Rules at the conversation top get diluted by everything that came after, and after dozens of turns the Agent isn't ignoring them โ€” its attention has just moved on. pinrule re-injects at the exact context length each model's decay starts.

2. Each conversation "re-forgets" everything

Every AI client works by re-sending the full context to the model on each turn โ€” the model doesn't persistently remember anything between turns. Your stated preferences have to be re-sent every time. pinrule does that for you, so you don't have to repeat yourself.

3. "Collaborative agreement" tone reads differently than "rule system" tone

When an LLM sees warnings like "you must always follow X" or "โš ๏ธ violation," the first reaction is to defend or to look for a workaround โ€” that wording activates a "being scolded" frame.

pinrule rephrases rules as "the human user you're working with hopesโ€ฆ" โ€” the Agent reads it as an agreement to honor, not a verdict to escape. In sustained self-use, this is the single change that moves the needle most on whether reminders actually get internalized.

4. Hook coverage has no blind spots

pinrule installs at 8 hook positions (detailed below) โ€” not just "inject once at conversation start." Before / after every tool call, subagent start / stop, pre / post compact, silent Agent stop โ€” every drift opportunity has a targeted injection or check.


Performance

Dimension Number Note
Runtime dependencies Zero Just PyYAML โ€” a 15-year mature Python standard. No LLM API key, no network calls, no ML framework
Source code ~9.5K lines Python Readable, modifiable, no magic
Quality gates lint / type-check / dead-code / 834 unit tests, all green (CI: 4 matrix jobs ubuntu+macos ร— py3.11+3.12) Plus continuous real-world dogfooding
Hook latency typically 50-70ms (Python startup-bound, machine-dependent โ€” author's M-series Mac ~49ms, 67ms reported on lower-end machines). Reproduce on your machine: python scripts/measure_perf.py Well within AI client protocol budget of 200ms
Token cost 1.8K SessionStart baseline + per-turn anchor listing only session-violated rules + auto-refresh at model decay threshold (Opus 60K / Sonnet 40K / Haiku 30K) Real dogfood: ~2% of conversation context (30 sessions measured: 60% of work sessions = 0 anchor token, median 1 violated rule per session). Same script computes anchor-char-per-typical-turn ratio for your rules.yaml
Disk usage < 10MB Config + violation history + session state
Model adaptation Per-model decay-point thresholds Each major model uses its own measured decay point
Supported clients Claude / Codex / Cursor Add a backend via HOWTO
User languages Chinese + English, extensible All 7 detection signals externalized to data/signals/<name>/{zh,en}.txt (flat phrases) or .yaml (Cartesian templates + word vocab). Adding a new language = ~7 small files, zero Python code

Claude / Codex / Cursor native hook support

Native hook coverage on all 3 backends โ€” Claude 8 events, Codex 6 events, Cursor 12 events, all wired end-to-end. Diagram below uses Claude's 8-event lifecycle as example (Codex/Cursor share the same pinrule logic with backend-specific event subsets):

Backend capability matrix

Capability Claude Codex Cursor
Native hook count 8 6 12
Session-start rule inject โœ“ SessionStart โœ“ SessionStart โœ“ sessionStart
Real-time tool gate โœ“ PreToolUse โœ“ PreToolUse + PermissionRequest โœ“ preToolUse + 4 dedicated gates (Shell / MCP / Read / File)
Stop intervention โœ“ block decision โœ“ block decision โœ“ followup_message (auto-continue)
Compact resilience โœ“ PreCompact dump โ€” โœ“ preCompact dump
Subagent coverage โœ“ SubagentStart/Stop โ€” โœ“ subagentStart/Stop
/pinrule <NL> rule input โœ“ home-global โœ“ home-global โš  project-scoped only
Visibility fallback โ€” trusted_hash auto-trust .mdc Rules alwaysApply

Same pinrule core logic on all 3 โ€” each backend uses the native protocol's strongest surface (Cursor's 4 dedicated gates, Codex's PermissionRequest, Claude's PreCompact dump). No backend reuses another's protocol shape.

flowchart TB
    Start([session start / compact restart]) --> SS[SessionStart<br/>inject full rule baseline]
    SS --> UPS[UserPromptSubmit<br/>compact anchor + drift markers]
    UPS --> Tool{Agent calls<br/>Bash / Edit / Write?}
    Tool -- yes --> PreT[PreToolUse<br/>scan command + timing;<br/>hit โ†’ deny]
    PreT --> PostT[PostToolUse<br/>track state +<br/>mid-conversation reinject<br/>at decay threshold]
    PostT --> Stop[Stop<br/>strong reminder +<br/>continuation nudge +<br/>short-term intent detection]
    Tool -- no --> Stop
    UPS -. spawn subagent .-> SubS[SubagentStart<br/>subagent inherits rules]
    SubS --> SubE[SubagentStop<br/>temp state destroyed]
    Stop -. long context .-> PreC[PreCompact<br/>dump full rule state]
    PreC -.-> Start
Hook position Function + scenario Pain point solved
Every user prompt (UserPromptSubmit) Header injects full rules + drift markers Agent forgets your preferences after long session
Before every tool call (PreToolUse) Keyword + engine-layer double-check; hit โ†’ deny Agent wants to run sleep / commit --no-verify / bypass rules
After every tool call (PostToolUse) Track file read/edit/bash state + auto mid-conversation refresh when accumulation hits threshold Long context accumulation โ†’ attention decay โ†’ Agent drifts
Agent stops generating (Stop) Terminal stderr โš ๏ธ + desktop notify + silent-stop reflective intervention + short-term intent talk detection Agent finishes one wave and stops to ask, user gets interrupted repeatedly
Every session start (SessionStart) Inject rule baseline at session start; on compact-restart, read snapshot for strong-inject Rules don't get lost across sessions / across compacts
Before AI client compresses history (PreCompact) Dump full rule state to disk for SessionStart to re-read After compact, Agent compresses rules into vague words
Subagent starts (SubagentStart) Subagent auto-inherits full rule set + writes independent monitoring state Subagents running independent tasks leave monitoring gaps
Subagent ends (SubagentStop) Subagent temporary state auto-destroys, doesn't pollute main session Multiple subagent spawns cause state accumulation, main session data gets confused

All hook outputs strictly comply with the AI client's official protocol schema โ€” no UI error messages.


Tried and rejected (what pinrule doesn't do)

Several ideas looked attractive but failed in practice. Recorded here so the same alleys don't get re-walked:

Tried Why it was rejected
LLM auto-distilling new rules Latency hurts UX, and auto-distilled rules introduce noise โ€” hearing a user say something once doesn't mean it's a core direction. pinrule keeps users in charge of their 5-10 rules instead
Retrieval / cosine recall The real pain is "persistence," not "recall" โ€” 5-10 rules can all be always-on, no selection needed. Retrieval adds latency and matching errors with no upside
More than 12 rules Beyond ~12, LLMs pattern-match "a rule list exists" instead of reading it (see Mnilax's 30-codebase empirical study for the compliance cliff). Keeping the count under 10 is the empirically safe zone
Competing with memory systems "Facts / preferences about the user" belong in the AI client's built-in memory. pinrule only does the one thing memory systems don't: pin behaviors you've already repeated
Adding an LLM dependency Latency and cost, both. Pure-engineering keeps the hook in the 50-70ms range and the install reproducible
Reward / RL scoring Behavior reminders aren't reward functions. Scoring rules makes the model optimize the score, not the behavior
Blocking compact Compact is the client's protection mechanism โ€” pinrule shouldn't fight it. PreCompact dump + SessionStart re-read bridges the gap instead
"Must follow X / Fix immediately / Don't repeat" warning wording Activates defense or workaround-seeking. The collaborative-agreement rephrase changes the first reaction to "let me align" โ€” the biggest single lever for actual compliance
Hardcoded numeric thresholds in suggested_fix "34% < 40%" gets optimized by padding Chinese characters instead of fixing readability. Goal descriptions ("readable without looking up words") avoid the gaming
Reshipping pinrule as an MCP server pinrule works because hooks are enforced by the client (UserPromptSubmit fires whether the Agent likes it or not). MCP servers expose tools the Agent chooses to call โ€” in long-session attention decay, the Agent doesn't proactively query "what rules apply here," it drifts first and gets corrected by hooks. MCP-only would lose the core enforcement guarantee. Plus the supposed "10x audience expansion" doesn't hold: Claude Desktop / Codex Desktop / Cursor Desktop all already use pinrule via inherited hooks (Claude Desktop ships an embedded Claude Code runtime sharing ~/.claude/settings.json); the actual MCP-only delta is ChatGPT Desktop chat (wrong domain) and Windsurf (small audience)

Honest tool boundaries

pinrule is regex matching + counting, not LLM semantic understanding. That means:

  • False positives happen. Table cells quoting a term, python -c string literals, commit messages describing a violation โ€” all can hit the regex. pinrule audit flags suspected false positives with "โš ๏ธ possible false positive" so you can report them
  • False negatives happen. Regex can't tell when a user is intentionally disguising a violation. pinrule assumes you're not cheating yourself
  • Zero triggers after a fix doesn't prove the fix is correct. The pattern might just be too wide, swallowing real cases. Audit numbers are hints, not ground truth

Think of pinrule as sitting between git and a linter โ€” it gives signals, you make decisions.


FAQ

Nothing happens after install?

Run pinrule doctor to check:

  • Are all hook events โœ“? (Claude 8 / Codex 6 / Cursor 12)
  • Did rules load successfully?
  • Did session state directory generate new files?
Too many false positives, what to do?

pinrule audit shows triggers marked "โš ๏ธ possible false positive" โ€” report to the author (GitHub Issue). Temporarily disable a rule: pinrule rule remove <id> or edit ~/.claude/pinrule/rules.yaml and remove violation_keywords / violation_checks fields while keeping preference.

Does this overlap with Andrej Karpathy's CLAUDE.md?

Completely complementary, no overlap:

  • Karpathy's 12 rules (complete version) are universal coding principles (cross-user, cross-project): "Think before coding," "Simplicity first," etc.
  • pinrule's rules are per-user personal preferences (each user differs): "I prefer Chinese over jargon," "I want full-delegation," etc.

Recommended setup: install Karpathy's 12 rules in CLAUDE.md (project-shared) + install your personal rules via pinrule (user-level). They run on the same AI client without conflict.

Custom rule sets for non-development scenarios (writing / research / legal)?

pinrule init defaults to "software development" scenario. For other scenarios, write ~/.claude/pinrule/rules.yaml manually โ€” the framework (hook injection / real-time interception) is cross-scenario universal, but the 8 built-in violation_checks are dev-oriented. Other scenarios may need preference text reminders + custom keywords (without check functions).

How do I sync rules across multiple devices?

Just ask the Agent to copy rules.yaml over โ€” no special tooling needed:

mac:    cat ~/.claude/pinrule/rules.yaml
linux:  "here's my pinrule rules.yaml, write it to ~/.claude/pinrule/rules.yaml"
linux:  pinrule doctor    # validate schema + rules count + violation_checks exist

Safe to sync (user preference config):

  • ~/.claude/pinrule/rules.yaml โ€” your rule definitions
  • ~/.claude/pinrule/config.yaml โ€” your threshold tuning (if customized)

Never sync (runtime data, per-device):

  • ~/.claude/pinrule/violations.jsonl โ€” append-only per-device violation log
  • ~/.claude/pinrule/session-state/*.json โ€” runtime hook state

pinrule's cross-process atomicity protects same-machine concurrency, but doesn't extend to cloud-synced folders (iCloud / Dropbox / OneDrive). Putting ~/.claude/pinrule/ in a sync folder can corrupt runtime state across devices. If you use dotfiles repos / chezmoi / ansible, scope them to rules.yaml + config.yaml only.


Mental model

A rules file isn't a wishlist. It's a behavioral contract closing out specific failure modes you've observed. Each rule should answer: what error is this rule preventing?

pinrule works the same way. 6 rules targeting failures you've actually hit beats 12 rules where 6 are aspirational.

The 7 default rules in data/rules.dev.example.yaml are real pain points accumulated from self-use โ€” they aren't a template to copy verbatim. After install, run pinrule rule list, keep what matches your own failure scenes, and replace the rest with your own (via /pinrule <natural language>).


Documentation

All listed docs are bilingual (.md English + .zh.md Chinese):

  • docs/PRD.md โ€” Product requirements, validation criteria, scenario positioning
  • docs/ARCHITECTURE.md โ€” Technical architecture, hook protocol, 8 check implementations
  • CHANGELOG.md โ€” Version change history (bilingual from v0.5.1 onward; pre-v0.5.1 release notes are Chinese-only)
  • docs/HANDOFF.md โ€” Internal development handoff entry (English summary; full timeline in .zh.md)
  • docs/CODEX_BACKEND.md โ€” Codex backend ownership boundary and 8-method contract
  • CLAUDE.md โ€” Project charter for Claude collaboration

Translation PRs welcome for any bilingual gap (HANDOFF.md still summary-only).

Acknowledgments

Contributing

pinrule is still early โ€” new-user install friction and first-week false positives drive most of the iteration.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pinrule-0.16.0.tar.gz (757.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pinrule-0.16.0-py3-none-any.whl (228.2 kB view details)

Uploaded Python 3

File details

Details for the file pinrule-0.16.0.tar.gz.

File metadata

  • Download URL: pinrule-0.16.0.tar.gz
  • Upload date:
  • Size: 757.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.12

File hashes

Hashes for pinrule-0.16.0.tar.gz
Algorithm Hash digest
SHA256 b221abba8bacdbb58ac3c2118f1039040f83c7e9567833510d698d1ee1589bab
MD5 dbff51bdebd995af7ecf1e3e29263f34
BLAKE2b-256 c887d22d457ddc700486e7d9abf26a8be570a93ada58b6042ed93a3e44ea7bcd

See more details on using hashes here.

File details

Details for the file pinrule-0.16.0-py3-none-any.whl.

File metadata

  • Download URL: pinrule-0.16.0-py3-none-any.whl
  • Upload date:
  • Size: 228.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.12

File hashes

Hashes for pinrule-0.16.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6dfd6ac99e6f6b8a6de065c3c42e6e42c04ef9b8d3b040f30da344ea8814d42a
MD5 cca4a1a9cb9d9d91ae28545e3c899c4c
BLAKE2b-256 1d74a678628020e97874d46e5e7f62f84716183d4f672eb2054b0babdee657d0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page