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 commands/codeblockz/langchain-community-plugin/new-chaingit clone --depth 1 https://github.com/Codeblockz/langchain-community-pluginWhat 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.00015 | $0.02309 |
| Opus 5 | $0.00008 | $0.01154 |
| Sonnet 5 | $0.00003 | $0.00462 |
| Haiku 4.5 | $0.00002 | $0.00231 |
Grade A, and why
new-chain 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.
How it starts
The opening of the file, as written. The whole thing — 396 lines — stays where its author put it; the contents beside it link to each section on GitHub.
New Chain Command
Create a new LCEL chain file for common patterns.
Workflow
-
Ask the user which chain type they want:
summarization- Summarize documents or textextraction- Extract structured dataclassification- Classify text into categoriestranslation- Translate between languages
-
Get filename from argument or ask user (default:
chain.py) -
Generate the chain file using the appropriate template below
-
Inform user about customization options
Templates
Summarization Template
"""
Summarization Chain
Install: pip install langchain langchain-openai
"""
from langchain_core.prompts import ChatPromptTemplate
from langchain_core.output_parsers import StrOutputParser
from langchain_openai import ChatOpenAI
def create_summarization_chain(
model: str = "gpt-4o",
style: str = "concise",
max_points: int = 5,
):
"""
Create a summarization chain.
Args:
model: The model to use
style: Summary style (concise, detailed, bullet_points)
max_points: Maximum bullet points for bullet_points style
"""
style_instructions = {
"concise": "Provide a brief, 2-3 sentence summary.",
"detailed": "Provide a comprehensive summary covering all main points.",
"bullet_points": f"Provide a summary as {max_points} bullet points.",
}
prompt = ChatPromptTemplate.from_template("""
Summarize the following text.
{style_instruction}
Text:
{text}
Summary:
""")
llm = ChatOpenAI(model=model, temperature=0)
chain = (
prompt.partial(style_instruction=style_instructions.get(style, style_instructions["concise"]))
| llm
| StrOutputParser()
)
return chain
def main():
# Create chain
chain = create_summarization_chain(style="bullet_points", max_points=5)
# Example usage
text = """
Artificial intelligence (AI) is transforming industries across the globe.
From healthcare to finance, AI applications are improving efficiency and
enabling new capabilities. Machine learning, a subset of AI, allows systems
to learn from data without explicit programming. Deep learning, using neural
networks, has achieved remarkable results in image and speech recognition.
However, challenges remain around bias, interpretability, and ethical use.
"""
summary = chain.invoke({"text": text})
print(summary)
if __name__ == "__main__":
main()
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.
- 2d ago First seen · 396 lines · 15 tokens per session scan A ca386e6f0718
new-chain is a command published in the GitHub repository Codeblockz/langchain-community-plugin (3 stars, last pushed 7mo ago), licensed Apache-2.0. It adds 15 tokens to every session and 2,309 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-08-31.
Other commands, from other repositories
date
询问当天的日期,输出的格式为 yyyy-MM-dd 星期几.
add-eval
Create a new evaluator for assessing agent performance.
human-in-the-loop
Add human approval or intervention points to your workflow.
add-subgraph
Create a modular subgraph that can be composed into the main workflow.
debug-graph
Help debug issues with the LangGraph workflow.
run-evals
Execute the evaluation suite against the LangGraph agent.