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 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/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.
<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="Reviewed on agentmods" width="80" 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.1 | $0.00027 | $0.00730 |
| Opus 5.5 | $0.00011 | $0.00292 |
| Sonnet 5.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 3mo 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.
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.
- 3mo ago 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.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.
stack-based-backtrack compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| stack-based-backtrackjimmc414/claude-code-plugin-marketplace | Skill | 4 | today | MIT | A | 27 | Claude Code |
| write-for-agentsmelodic-software/claude-code-plugins | Skill | 34 | today | MIT | A | 164 | Claude Code |
| eli5melodic-software/claude-code-plugins | Skill | 34 | today | MIT | A | 155 | Claude Code |
| usemelodic-software/claude-code-plugins | Skill | 34 | today | MIT | A | 183 | Claude Code |
| generate-file-name-gatemelodic-software/claude-code-plugins | Skill | 34 | today | MIT | A | 87 | Claude Code |
| routemelodic-software/claude-code-plugins | Skill | 34 | today | MIT | A | 89 | Claude Code |
| devils-advocatemelodic-software/claude-code-plugins | Skill | 34 | today | MIT | A | 139 | Claude Code |