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.
npx agentmods add skills/jimmc414/claude-code-plugin-marketplace/stack-based-backtracknpx skills add jimmc414/claude-code-plugin-marketplace --skill stack-based-backtrackgit clone --depth 1 https://github.com/jimmc414/claude-code-plugin-marketplaceWrote 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.
[](https://agentmods.dev/skills/jimmc414/claude-code-plugin-marketplace/stack-based-backtrack)<a href="https://agentmods.dev/skills/jimmc414/claude-code-plugin-marketplace/stack-based-backtrack"><img src="https://agentmods.dev/badge/skills/jimmc414/claude-code-plugin-marketplace/stack-based-backtrack.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00027 | $0.00730 |
| Opus 5 | $0.00014 | $0.00365 |
| Sonnet 5 | $0.00005 | $0.00146 |
| Haiku 4.5 | $0.00003 | $0.00073 |
Grade A, and why
stack-based-backtrack 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 yesterday.
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.
How it starts
The opening of the file, as written. The whole thing — 121 lines — stays where its author put it; the contents beside it link to each section on GitHub.
stack-based-backtrack
When to Use
- DFS with backtracking
- Puzzle solving
- Game tree search
- Undo/redo functionality
- When recursion depth is too deep
When NOT to Use
- Simple recursion works
- BFS needed (use queue)
- No backtracking required
The Pattern
Maintain explicit stack of decisions; pop and undo on failure.
def search_with_backtrack(initial_state):
"""DFS with explicit stack for backtracking."""
stack = [(initial_state, get_choices(initial_state))]
while stack:
state, choices = stack[-1]
if is_goal(state):
return state
if not choices:
# Backtrack: no more choices at this level
stack.pop()
if stack:
undo_last_choice(stack[-1][0])
continue
# Try next choice
choice = choices.pop()
new_state = apply_choice(state, choice)
if is_valid(new_state):
stack.append((new_state, get_choices(new_state)))
return None # No solution
Example (from pytudes)
# pal2.py - Panama palindrome search
class Panama:
def search(self, steps=50000000):
"""Depth-first search with explicit backtrack stack."""
for _ in range(steps):
if not self.stack:
return 'done'
action, direction, substr, arg = self.stack[-1]
if action == 'added':
# Undo the addition
self.remove(direction, arg)
elif action == 'trying':
if arg: # More candidates to try
word = arg.pop()
self.add(direction, word)
self.consider_candidates()
else: # Exhausted candidates
self.stack.pop()
return 'incomplete'
def consider_candidates(self):
"""Push new choice points onto stack."""
substr = self.get_target_substring()
direction = 'left' if self.diff < 0 else 'right'
candidates = self.find_candidates(substr, direction)
if candidates:
self.stack.append(('trying', direction, substr, candidates))
# Conceptual example: N-Queens
def solve_queens(n):
"""Place N queens with backtracking."""
stack = [([], list(range(n)))] # (placed, available_rows)
while stack:
placed, available = stack[-1]
if len(placed) == n:
return placed # Solution found
if not available:
stack.pop() # Backtrack
continue
row = available.pop()
col = len(placed)
if is_safe(placed, row, col):
new_placed = placed + [row]
new_available = [r for r in range(n)
if r not in new_placed and is_safe(new_placed, r, col+1)]
stack.append((new_placed, new_available))
return None
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.
- yesterday First seen · 121 lines · 27 tokens per session scan A d9d6fa2c4cee
stack-based-backtrack is a skill published in the GitHub repository jimmc414/claude-code-plugin-marketplace (4 stars, last pushed today), licensed MIT. It adds 27 tokens to every session and 730 once invoked, about $0.0001 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-09-04.
Other skills, from other repositories
interview
Interview relentlessly to reach shared understanding on a plan, decision, or idea. Questions arrive in frontier rounds: every question whose prerequisites are settled asked together as one numbered set, each with a recommendation. Routes by context: an engineering task locks a task contract (goal, constraints…
plan
Produce structured implementation plans with goal, approach, test strategy, blast-radius assessment, parallelism analysis, and a user approval gate before any code is written. Persisting PLAN.md for fresh-session handoff. Use when: 'plan this', 'architect this', 'how should we implement', 'implementation plan', 'write…
research
Multi-source external research in chained phases, corpus enumeration, broad, targeted + falsification, preferred sources, with per-claim source tiers, recency checks, a coverage ledger, and a binary outcome gate before presenting. Dispatches a fresh-context subagent by default so the research transcript stays out of…
clean
Audit an arbitrary directory tree for orphaned, temporary, stale-lock, failed-write, partial-download, and empty leftover artifacts; classify evidence into confidence tiers; and optionally remove exact validated paths after explicit per-tier approval. Read-only by default and manual-only. Use when: 'audit this…
teach
Interactive multi-session learning coach for general topics or repo-grounded concepts; also a single-session domain primer (primer action). Use when: 'teach me', 'study session', 'help me learn', 'onboard me to', 'learn this codebase'. Coaches through the Knowledge-Skills-Wisdom progression with persistent per-topic…
implement
Execute approved plans, fix bugs, and make code changes inline with incremental validation. TDD by default, build+test after each logical block, commit at green checkpoints, and divergence detection that routes back to planning instead of pushing through a broken approach. Use when: 'implement this', 'execute the…